diff --git a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md index 622a8666f97e..62c1dc8130b2 100644 --- a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md @@ -1,5 +1,155 @@ # Release History +## 10.0.0 (2026-05-20) +### Breaking Changes + +- Function `*IpamPoolsClient.Update` parameter(s) have been changed from `(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientUpdateOptions)` to `(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPoolUpdate, options *IpamPoolsClientUpdateOptions)` +- Function `*StaticCidrsClient.Create` parameter(s) have been changed from `(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientCreateOptions)` to `(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, body StaticCidr, options *StaticCidrsClientCreateOptions)` +- Function `*VerifierWorkspacesClient.Update` parameter(s) have been changed from `(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientUpdateOptions)` to `(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body VerifierWorkspaceUpdate, options *VerifierWorkspacesClientUpdateOptions)` +- Type of `EffectiveNetworkSecurityGroup.TagMap` has been changed from `*string` to `map[string][]*string` +- Type of `ManagedServiceIdentity.UserAssignedIdentities` has been changed from `map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties` to `map[string]*ManagedServiceIdentityUserAssignedIdentities` +- Type of `OperationStatusResult.PercentComplete` has been changed from `*float32` to `*float64` +- Type of `VirtualNetworkAppliancePropertiesFormat.BandwidthInGbps` has been changed from `*string` to `*float64` +- Enum `ConnectionMonitorSourceStatus` has been removed +- Enum `ConnectionState` has been removed +- Enum `EvaluationState` has been removed +- Enum `HubVirtualNetworkConnectionStatus` has been removed +- Enum `NetworkOperationStatus` has been removed +- Enum `TunnelConnectionStatus` has been removed +- Struct `AzureAsyncOperationResult` has been removed +- Struct `ChildResource` has been removed +- Struct `CommonErrorAdditionalInfo` has been removed +- Struct `CommonErrorDetail` has been removed +- Struct `CommonErrorResponse` has been removed +- Struct `CommonProxyResource` has been removed +- Struct `CommonResource` has been removed +- Struct `CommonTrackedResource` has been removed +- Struct `Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties` has been removed +- Struct `ConnectionMonitorQueryResult` has been removed +- Struct `ConnectionStateSnapshot` has been removed +- Struct `Error` has been removed +- Struct `ErrorDetails` has been removed +- Struct `ErrorResponse` has been removed +- Struct `PatchRouteFilter` has been removed +- Struct `PatchRouteFilterRule` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed +- Struct `ResourceSet` has been removed +- Struct `SecurityPerimeterProxyResource` has been removed +- Struct `SecurityPerimeterResource` has been removed +- Struct `TrackedResource` has been removed +- Struct `VPNSiteID` has been removed +- Field `Body` of struct `IpamPoolsClientUpdateOptions` has been removed +- Field `CaptchaCookieExpirationInMins` of struct `PolicySettings` has been removed +- Field `Body` of struct `StaticCidrsClientCreateOptions` has been removed +- Field `Body` of struct `VerifierWorkspacesClientUpdateOptions` has been removed + +### Features Added + +- New value `NextHopTypeVirtualApplianceEcmp` added to enum type `NextHopType` +- New value `RouteNextHopTypeVirtualApplianceEcmp` added to enum type `RouteNextHopType` +- New enum type `DisablePeeringRoute` with values `DisablePeeringRouteAll`, `DisablePeeringRouteNone` +- New enum type `ExpressRouteFailoverBgpStatusAddressFamily` with values `ExpressRouteFailoverBgpStatusAddressFamilyIPv4`, `ExpressRouteFailoverBgpStatusAddressFamilyIPv6` +- New enum type `ExpressRouteFailoverLinkType` with values `ExpressRouteFailoverLinkTypePrimary`, `ExpressRouteFailoverLinkTypeSecondary` +- New enum type `ExpressRouteLinkFailoverBgpStatus` with values `ExpressRouteLinkFailoverBgpStatusConnected`, `ExpressRouteLinkFailoverBgpStatusDisconnected`, `ExpressRouteLinkFailoverBgpStatusUndefined` +- New enum type `InterconnectGroupScope` with values `InterconnectGroupScopeInfiniBand`, `InterconnectGroupScopeNone` +- New enum type `LoadBalancerDetailLevel` with values `LoadBalancerDetailLevelReduced` +- New enum type `MaintenanceTestCategory` with values `MaintenanceTestCategoryASPathPrepend`, `MaintenanceTestCategoryBgpDisconnect` +- New enum type `Nat64State` with values `Nat64StateDisabled`, `Nat64StateEnabled`, `Nat64StateNone` +- New enum type `NspReadinessState` with values `NspReadinessStateGA`, `NspReadinessStateNotReady`, `NspReadinessStateOnboarding`, `NspReadinessStatePreview` +- New enum type `PrivateEndpointBillingSKU` with values `PrivateEndpointBillingSKUFixed`, `PrivateEndpointBillingSKUPayAsYouGo` +- New enum type `SubgroupProfileScope` with values `SubgroupProfileScopeNone`, `SubgroupProfileScopeVerticalConnect` +- New enum type `VirtualNetworkApplianceIPVersionType` with values `VirtualNetworkApplianceIPVersionTypeDualStack`, `VirtualNetworkApplianceIPVersionTypeIPv4` +- New function `*ClientFactory.NewCommitsClient() *CommitsClient` +- New function `*ClientFactory.NewConnectionPoliciesClient() *ConnectionPoliciesClient` +- New function `*ClientFactory.NewInterconnectGroupsClient() *InterconnectGroupsClient` +- New function `*ClientFactory.NewSubgroupsClient() *SubgroupsClient` +- New function `NewCommitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommitsClient, error)` +- New function `*CommitsClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, resource Commit, options *CommitsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CommitsClientCreateOrUpdateResponse], error)` +- New function `*CommitsClient.BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *CommitsClientBeginDeleteOptions) (*runtime.Poller[CommitsClientDeleteResponse], error)` +- New function `*CommitsClient.Get(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *CommitsClientGetOptions) (CommitsClientGetResponse, error)` +- New function `*CommitsClient.NewListPager(resourceGroupName string, networkManagerName string, options *CommitsClientListOptions) *runtime.Pager[CommitsClientListResponse]` +- New function `NewConnectionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionPoliciesClient, error)` +- New function `*ConnectionPoliciesClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, resource ConnectionPolicy, options *ConnectionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConnectionPoliciesClientCreateOrUpdateResponse], error)` +- New function `*ConnectionPoliciesClient.BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *ConnectionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ConnectionPoliciesClientDeleteResponse], error)` +- New function `*ConnectionPoliciesClient.Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *ConnectionPoliciesClientGetOptions) (ConnectionPoliciesClientGetResponse, error)` +- New function `*ConnectionPoliciesClient.NewListPager(resourceGroupName string, virtualHubName string, options *ConnectionPoliciesClientListOptions) *runtime.Pager[ConnectionPoliciesClientListResponse]` +- New function `*DdosCustomPoliciesClient.NewListAllPager(options *DdosCustomPoliciesClientListAllOptions) *runtime.Pager[DdosCustomPoliciesClientListAllResponse]` +- New function `*DdosCustomPoliciesClient.NewListPager(resourceGroupName string, options *DdosCustomPoliciesClientListOptions) *runtime.Pager[DdosCustomPoliciesClientListResponse]` +- New function `*ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions) (*runtime.Poller[ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse], error)` +- New function `*ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, failoverTestID string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions) (*runtime.Poller[ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse], error)` +- New function `*ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, options *ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions) (*runtime.Poller[ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse], error)` +- New function `*ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, stopParameters ExpressRouteLinkFailoverStopAPIParameters, options *ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions) (*runtime.Poller[ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, failoverTestID string, options *ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginGetResiliencyInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetResiliencyInformationResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginGetRoutesInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetRoutesInformationOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetRoutesInformationResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginStartSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, options *ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions) (*runtime.Poller[ExpressRouteGatewaysClientStartSiteFailoverTestResponse], error)` +- New function `*ExpressRouteGatewaysClient.BeginStopSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions) (*runtime.Poller[ExpressRouteGatewaysClientStopSiteFailoverTestResponse], error)` +- New function `NewInterconnectGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterconnectGroupsClient, error)` +- New function `*InterconnectGroupsClient.CreateOrUpdate(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters InterconnectGroup, options *InterconnectGroupsClientCreateOrUpdateOptions) (InterconnectGroupsClientCreateOrUpdateResponse, error)` +- New function `*InterconnectGroupsClient.Delete(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientDeleteOptions) (InterconnectGroupsClientDeleteResponse, error)` +- New function `*InterconnectGroupsClient.Get(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientGetOptions) (InterconnectGroupsClientGetResponse, error)` +- New function `*InterconnectGroupsClient.BeginGetNodeAvailability(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientBeginGetNodeAvailabilityOptions) (*runtime.Poller[InterconnectGroupsClientGetNodeAvailabilityResponse], error)` +- New function `*InterconnectGroupsClient.NewListAllPager(options *InterconnectGroupsClientListAllOptions) *runtime.Pager[InterconnectGroupsClientListAllResponse]` +- New function `*InterconnectGroupsClient.NewListPager(resourceGroupName string, options *InterconnectGroupsClientListOptions) *runtime.Pager[InterconnectGroupsClientListResponse]` +- New function `*InterconnectGroupsClient.UpdateTags(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters TagsObject, options *InterconnectGroupsClientUpdateTagsOptions) (InterconnectGroupsClientUpdateTagsResponse, error)` +- New function `NewSubgroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubgroupsClient, error)` +- New function `*SubgroupsClient.Get(ctx context.Context, resourceGroupName string, interconnectGroupName string, subgroupName string, options *SubgroupsClientGetOptions) (SubgroupsClientGetResponse, error)` +- New function `*SubgroupsClient.NewListPager(resourceGroupName string, interconnectGroupName string, options *SubgroupsClientListOptions) *runtime.Pager[SubgroupsClientListResponse]` +- New struct `AfcConfiguration` +- New struct `ApplicationGatewayManagedHsm` +- New struct `Commit` +- New struct `CommitListResult` +- New struct `CommitProperties` +- New struct `ConnectionPolicy` +- New struct `ConnectionPolicyProperties` +- New struct `DdosCustomPolicyListResult` +- New struct `DdosFrontendIPConfigurationSettings` +- New struct `ExpressRouteLinkFailoverAllTestsDetails` +- New struct `ExpressRouteLinkFailoverRoute` +- New struct `ExpressRouteLinkFailoverRouteList` +- New struct `ExpressRouteLinkFailoverSingleTestDetails` +- New struct `ExpressRouteLinkFailoverStopAPIParameters` +- New struct `ExpressRouteLinkFailoverTestBgpStatus` +- New struct `InterconnectGroup` +- New struct `InterconnectGroupListResult` +- New struct `InterconnectGroupNodeAvailability` +- New struct `InterconnectGroupPropertiesFormat` +- New struct `ListConnectionPoliciesResult` +- New struct `ManagedServiceIdentityUserAssignedIdentities` +- New struct `RouteNextHopEcmp` +- New struct `StopCircuitLinkFailoverTestParameterBody` +- New struct `StopSiteFailoverTestParameterBody` +- New struct `Subgroup` +- New struct `SubgroupListResult` +- New struct `SubgroupNodeAvailabilityEntry` +- New struct `SubgroupProfile` +- New struct `SubgroupProperties` +- New field `Hsm` in struct `ApplicationGatewaySSLCertificatePropertiesFormat` +- New field `AfcConfiguration` in struct `AzureFirewallPropertiesFormat` +- New field `CreateAfcControlPlane` in struct `AzureFirewallsClientBeginCreateOrUpdateOptions` +- New field `RoutingConfiguration` in struct `BgpConnectionProperties` +- New field `NextLink` in struct `ConnectionMonitorListResult` +- New field `PublicIPAddresses` in struct `DdosCustomPolicyPropertiesFormat` +- New field `DdosCustomPolicy` in struct `DdosSettings` +- New field `DdosSettings` in struct `FrontendIPConfigurationPropertiesFormat` +- New field `ConnectionPolicy` in struct `HubVirtualNetworkConnectionProperties` +- New field `DetailLevel` in struct `LoadBalancersClientGetOptions` +- New field `Nat64` in struct `NatGatewayPropertiesFormat` +- New field `NextLink` in struct `PacketCaptureListResult` +- New field `Description`, `OutboundSupported`, `ReadinessState`, `ServiceTags` in struct `PerimeterAssociableResourceProperties` +- New field `CaptchaExpirationInMins` in struct `PolicySettings` +- New field `BillingSKU` in struct `PrivateEndpointProperties` +- New field `NextHop` in struct `RoutePropertiesFormat` +- New field `DisablePeeringRoute` in struct `RouteTablePropertiesFormat` +- New field `PrivateIPAddressVersion` in struct `VirtualNetworkAppliancePropertiesFormat` +- New field `RoutingConfiguration` in struct `VirtualNetworkGatewayConnectionListEntityPropertiesFormat` +- New field `RoutingConfiguration` in struct `VirtualNetworkGatewayConnectionPropertiesFormat` +- New field `SummarizedGatewayPrefixes` in struct `VirtualNetworkPropertiesFormat` +- New field `NextLink` in struct `WatcherListResult` + + ## 9.0.0 (2026-02-19) ### Breaking Changes diff --git a/sdk/resourcemanager/network/armnetwork/README.md b/sdk/resourcemanager/network/armnetwork/README.md index 0c0e660c563c..9f8d923b53da 100644 --- a/sdk/resourcemanager/network/armnetwork/README.md +++ b/sdk/resourcemanager/network/armnetwork/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Network module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10 ``` ## Authorization diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go index 622a2c032662..0c13ef6e0718 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // AdminRuleCollectionsClient contains the methods for the AdminRuleCollections group. // Don't use this type directly, use NewAdminRuleCollectionsClient() instead. +// +// Generated from API version 2025-07-01 type AdminRuleCollectionsClient struct { internal *arm.Client subscriptionID string } // NewAdminRuleCollectionsClient creates a new instance of AdminRuleCollectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAdminRuleCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRuleCollectionsClient, error) { @@ -44,9 +44,7 @@ func NewAdminRuleCollectionsClient(subscriptionID string, credential azcore.Toke // CreateOrUpdate - Creates or updates an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -103,9 +101,10 @@ func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleCollection); err != nil { return nil, err } @@ -123,9 +122,7 @@ func (client *AdminRuleCollectionsClient) createOrUpdateHandleResponse(resp *htt // BeginDelete - Deletes an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -138,8 +135,7 @@ func (client *AdminRuleCollectionsClient) BeginDelete(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdminRuleCollectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -151,8 +147,6 @@ func (client *AdminRuleCollectionsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AdminRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdminRuleCollectionsClient.BeginDelete" @@ -202,20 +196,17 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a network manager security admin configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -271,8 +262,8 @@ func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -287,9 +278,7 @@ func (client *AdminRuleCollectionsClient) getHandleResponse(resp *http.Response) } // NewListPager - Lists all the rule collections in a security admin configuration, in a paginated format. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - options - AdminRuleCollectionsClientListOptions contains the optional parameters for the AdminRuleCollectionsClient.NewListPager @@ -347,8 +336,8 @@ func (client *AdminRuleCollectionsClient) listCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go index 77c001035bfa..3b6fde547874 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go @@ -1,181 +1,194 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleCollectionList.json -func ExampleAdminRuleCollectionsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleCollectionPut.json +func ExampleAdminRuleCollectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewAdminRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.AdminRuleCollectionsClientListOptions{Top: nil, - SkipToken: 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.AdminRuleCollectionListResult = armnetwork.AdminRuleCollectionListResult{ - // Value: []*armnetwork.AdminRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewAdminRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.AdminRuleCollection{ + Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ + Description: to.Ptr("A sample policy"), + AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + { + NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + }, + }, + }, + }, 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 = armnetwork.AdminRuleCollectionsClientCreateOrUpdateResponse{ + // AdminRuleCollection: armnetwork.AdminRuleCollection{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleCollectionGet.json -func ExampleAdminRuleCollectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleCollectionDelete.json +func ExampleAdminRuleCollectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAdminRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", nil) + poller, err := clientFactory.NewAdminRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.AdminRuleCollectionsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.AdminRuleCollection = armnetwork.AdminRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.AdminRuleCollectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleCollectionPut.json -func ExampleAdminRuleCollectionsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleCollectionGet.json +func ExampleAdminRuleCollectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAdminRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.AdminRuleCollection{ - Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - { - NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - }}, - }, - }, nil) + res, err := clientFactory.NewAdminRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", 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.AdminRuleCollection = armnetwork.AdminRuleCollection{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.AdminRuleCollectionsClientGetResponse{ + // AdminRuleCollection: armnetwork.AdminRuleCollection{ + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleCollectionDelete.json -func ExampleAdminRuleCollectionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleCollectionList.json +func ExampleAdminRuleCollectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAdminRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.AdminRuleCollectionsClientBeginDeleteOptions{Force: to.Ptr(false)}) - 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) + pager := clientFactory.NewAdminRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", 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 = armnetwork.AdminRuleCollectionsClientListResponse{ + // AdminRuleCollectionListResult: armnetwork.AdminRuleCollectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.AdminRuleCollection{ + // { + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/adminrules_client.go b/sdk/resourcemanager/network/armnetwork/adminrules_client.go index d2a552bc7bc1..1bdadd0731ea 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // AdminRulesClient contains the methods for the AdminRules group. // Don't use this type directly, use NewAdminRulesClient() instead. +// +// Generated from API version 2025-07-01 type AdminRulesClient struct { internal *arm.Client subscriptionID string } // NewAdminRulesClient creates a new instance of AdminRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAdminRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRulesClient, error) { @@ -44,9 +44,7 @@ func NewAdminRulesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates an admin rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -108,9 +106,10 @@ func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, adminRule); err != nil { return nil, err } @@ -128,9 +127,7 @@ func (client *AdminRulesClient) createOrUpdateHandleResponse(resp *http.Response // BeginDelete - Deletes an admin rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -143,8 +140,7 @@ func (client *AdminRulesClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdminRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +152,6 @@ func (client *AdminRulesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an admin rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AdminRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdminRulesClient.BeginDelete" @@ -211,20 +205,17 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a network manager security configuration admin rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -284,8 +275,8 @@ func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -300,9 +291,7 @@ func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRul } // NewListPager - List all network manager security configuration admin rules. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - ruleCollectionName - The name of the network manager security Configuration rule collection. @@ -364,8 +353,8 @@ func (client *AdminRulesClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go index baa127138d7e..98f9060fb990 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go @@ -1,214 +1,115 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleList.json -func ExampleAdminRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdminRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.AdminRulesClientListOptions{Top: nil, - SkipToken: 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.AdminRuleListResult = armnetwork.AdminRuleListResult{ - // Value: []armnetwork.BaseAdminRuleClassification{ - // &armnetwork.AdminRule{ - // Name: to.Ptr("SampleAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.AdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleGet.json -func ExampleAdminRulesClient_Get_getsSecurityAdminRule() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRulePut.json +func ExampleAdminRulesClient_CreateOrUpdate_createAnAdminRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", nil) + res, err := clientFactory.NewAdminRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRule{ + Kind: to.Ptr(armnetwork.AdminRuleKindCustom), + Properties: &armnetwork.AdminPropertiesFormat{ + Description: to.Ptr("This is Sample Admin Rule"), + Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), + DestinationPortRanges: []*string{ + to.Ptr("22"), + }, + Destinations: []*armnetwork.AddressPrefixItem{ + { + AddressPrefix: to.Ptr("*"), + AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + }, + }, + Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + Priority: to.Ptr[int32](1), + SourcePortRanges: []*string{ + to.Ptr("0-65535"), + }, + Sources: []*armnetwork.AddressPrefixItem{ + { + AddressPrefix: to.Ptr("Internet"), + AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), + }, + }, + Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + }, + }, 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 = armnetwork.AdminRulesClientGetResponse{ - // BaseAdminRuleClassification: &armnetwork.AdminRule{ + // res = armnetwork.AdminRulesClientCreateOrUpdateResponse{ + // BaseAdminRuleClassification: &armnetwork.AdminRule{ // Name: to.Ptr("SampleAdminRule"), // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, // Properties: &armnetwork.AdminPropertiesFormat{ // Description: to.Ptr("This is Sample Admin Rule"), // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerDefaultAdminRuleGet.json -func ExampleAdminRulesClient_Get_getsSecurityDefaultAdminRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleDefaultAdminRule", 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 = armnetwork.AdminRulesClientGetResponse{ - // BaseAdminRuleClassification: &armnetwork.DefaultAdminRule{ - // Name: to.Ptr("SampleDefaultAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleDefaultAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindDefault), + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // Priority: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("Internet"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Default Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Flag: to.Ptr("AllowVnetInbound"), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRulePut_NetworkGroupSource.json +// Generated from example definition: 2025-07-01/NetworkManagerAdminRulePut_NetworkGroupSource.json func ExampleAdminRulesClient_CreateOrUpdate_createAAdminRuleWithNetworkGroupAsSourceOrDestination() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -218,21 +119,25 @@ func ExampleAdminRulesClient_CreateOrUpdate_createAAdminRuleWithNetworkGroupAsSo Description: to.Ptr("This is Sample Admin Rule"), Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), DestinationPortRanges: []*string{ - to.Ptr("22")}, + to.Ptr("22"), + }, Destinations: []*armnetwork.AddressPrefixItem{ { AddressPrefix: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/ng1"), AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeNetworkGroup), - }}, + }, + }, Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), Priority: to.Ptr[int32](1), SourcePortRanges: []*string{ - to.Ptr("0-65535")}, + to.Ptr("0-65535"), + }, Sources: []*armnetwork.AddressPrefixItem{ { AddressPrefix: to.Ptr("Internet"), AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - }}, + }, + }, Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), }, }, nil) @@ -243,144 +148,272 @@ func ExampleAdminRulesClient_CreateOrUpdate_createAAdminRuleWithNetworkGroupAsSo _ = 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 = armnetwork.AdminRulesClientCreateOrUpdateResponse{ - // BaseAdminRuleClassification: &armnetwork.AdminRule{ + // BaseAdminRuleClassification: &armnetwork.AdminRule{ // Name: to.Ptr("SampleAdminRule"), // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, // Properties: &armnetwork.AdminPropertiesFormat{ // Description: to.Ptr("This is Sample Admin Rule using a network group as a source and destination."), // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("Internet"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // Priority: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("Internet"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), // }, // }, - // } + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRulePut.json -func ExampleAdminRulesClient_CreateOrUpdate_createAnAdminRule() { +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleDelete.json +func ExampleAdminRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAdminRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRule{ - Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - Properties: &armnetwork.AdminPropertiesFormat{ - Description: to.Ptr("This is Sample Admin Rule"), - Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - DestinationPortRanges: []*string{ - to.Ptr("22")}, - Destinations: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - Priority: to.Ptr[int32](1), - SourcePortRanges: []*string{ - to.Ptr("0-65535")}, - Sources: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("Internet"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - }}, - Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - }, - }, nil) + poller, err := clientFactory.NewAdminRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRulesClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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 = armnetwork.AdminRulesClientCreateOrUpdateResponse{ - // BaseAdminRuleClassification: &armnetwork.AdminRule{ + // res = armnetwork.AdminRulesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleGet.json +func ExampleAdminRulesClient_Get_getsSecurityAdminRule() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", 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 = armnetwork.AdminRulesClientGetResponse{ + // BaseAdminRuleClassification: &armnetwork.AdminRule{ // Name: to.Ptr("SampleAdminRule"), // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, // Properties: &armnetwork.AdminPropertiesFormat{ // Description: to.Ptr("This is Sample Admin Rule"), // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("Internet"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // Priority: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), // }, // }, - // } + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerAdminRuleDelete.json -func ExampleAdminRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerDefaultAdminRuleGet.json +func ExampleAdminRulesClient_Get_getsSecurityDefaultAdminRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAdminRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRulesClientBeginDeleteOptions{Force: to.Ptr(false)}) + res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleDefaultAdminRule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + // 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 = armnetwork.AdminRulesClientGetResponse{ + // BaseAdminRuleClassification: &armnetwork.DefaultAdminRule{ + // Name: to.Ptr("SampleDefaultAdminRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleDefaultAdminRule"), + // Kind: to.Ptr(armnetwork.AdminRuleKindDefault), + // Properties: &armnetwork.DefaultAdminPropertiesFormat{ + // Description: to.Ptr("This is Sample Default Admin Rule"), + // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // Flag: to.Ptr("AllowVnetInbound"), + // Priority: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerAdminRuleList.json +func ExampleAdminRulesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAdminRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", 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 = armnetwork.AdminRulesClientListResponse{ + // AdminRuleListResult: armnetwork.AdminRuleListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkManagers/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules?api-version=2025-07-01&$skipToken=10"), + // Value: []armnetwork.BaseAdminRuleClassification{ + // &armnetwork.AdminRule{ + // Name: to.Ptr("SampleAdminRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), + // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), + // Properties: &armnetwork.AdminPropertiesFormat{ + // Description: to.Ptr("This is Sample Admin Rule"), + // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // Priority: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go index 0c07f3384cb1..5edc2c154b1d 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ApplicationGatewayPrivateEndpointConnectionsClient contains the methods for the ApplicationGatewayPrivateEndpointConnections // group. // Don't use this type directly, use NewApplicationGatewayPrivateEndpointConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationGatewayPrivateEndpointConnectionsClient struct { internal *arm.Client subscriptionID string } // NewApplicationGatewayPrivateEndpointConnectionsClient creates a new instance of ApplicationGatewayPrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateEndpointConnectionsClient, error) { @@ -44,11 +44,9 @@ func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string // BeginDelete - Deletes the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. -// - connectionName - The name of the application gateway private endpoint connection. +// - connectionName - Name of the private endpoint connection on an application gateway. // - options - ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the // ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete method. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse], error) { @@ -58,8 +56,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ct // Delete - Deletes the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete" @@ -97,6 +92,10 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperatio // deleteCreateRequest creates the Delete request. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, _ *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,28 +108,21 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. -// - connectionName - The name of the application gateway private endpoint connection. +// - connectionName - Name of the private endpoint connection on an application gateway. // - options - ApplicationGatewayPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.Get // method. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (ApplicationGatewayPrivateEndpointConnectionsClientGetResponse, error) { @@ -158,6 +150,10 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx contex // getCreateRequest creates the Get request. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, _ *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,17 +166,13 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateReque return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -195,9 +187,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleRespo } // NewListPager - Lists all private endpoint connections on an application gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager // method. @@ -227,6 +217,10 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) NewListPager(r // listCreateRequest creates the List request. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -235,17 +229,13 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequ return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -261,11 +251,9 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listHandleResp // BeginUpdate - Updates the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. -// - connectionName - The name of the application gateway private endpoint connection. +// - connectionName - Name of the private endpoint connection on an application gateway. // - parameters - Parameters supplied to update application gateway private endpoint connection operation. // - options - ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the // ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate method. @@ -276,8 +264,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginUpdate(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -289,8 +276,6 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginUpdate(ct // Update - Updates the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewayPrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate" @@ -315,6 +300,10 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) update(ctx con // updateCreateRequest creates the Update request. func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, _ *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -327,18 +316,15 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRe return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go index 49d6505d620e..5f1e26f1312d 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayPrivateEndpointConnectionDelete.json +// Generated from example definition: 2025-07-01/ApplicationGatewayPrivateEndpointConnectionDelete.json func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,69 +27,25 @@ func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginDelete() { 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayPrivateEndpointConnectionUpdate.json -func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().BeginUpdate(ctx, "rg1", "appgw", "connection1", armnetwork.ApplicationGatewayPrivateEndpointConnection{ - Name: to.Ptr("connection1"), - Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - PrivateEndpoint: &armnetwork.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/subId2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - }, - PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - Description: to.Ptr("approved it for some reason."), - Status: to.Ptr("Approved"), - }, - }, - }, 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) + log.Fatalf("failed to poll 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.ApplicationGatewayPrivateEndpointConnection = armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/testPlePeConnection"), - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("linkId"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, + // res = armnetwork.ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayPrivateEndpointConnectionGet.json +// Generated from example definition: 2025-07-01/ApplicationGatewayPrivateEndpointConnectionGet.json func ExampleApplicationGatewayPrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -103,32 +56,34 @@ func ExampleApplicationGatewayPrivateEndpointConnectionsClient_Get() { // 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.ApplicationGatewayPrivateEndpointConnection = armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), - // Name: to.Ptr("coonection1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("805319460"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), + // res = armnetwork.ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{ + // ApplicationGatewayPrivateEndpointConnection: armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // Name: to.Ptr("connection1"), + // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), + // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ + // LinkIdentifier: to.Ptr("805319460"), + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approval Done"), + // Status: to.Ptr("Approved"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approval Done"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayPrivateEndpointConnectionList.json +// Generated from example definition: 2025-07-01/ApplicationGatewayPrivateEndpointConnectionList.json func ExampleApplicationGatewayPrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -143,24 +98,78 @@ func ExampleApplicationGatewayPrivateEndpointConnectionsClient_NewListPager() { _ = 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.ApplicationGatewayPrivateEndpointConnectionListResult = armnetwork.ApplicationGatewayPrivateEndpointConnectionListResult{ - // Value: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), - // Name: to.Ptr("coonection1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("805319460"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approval Done"), - // Status: to.Ptr("Approved"), + // page = armnetwork.ApplicationGatewayPrivateEndpointConnectionsClientListResponse{ + // ApplicationGatewayPrivateEndpointConnectionListResult: armnetwork.ApplicationGatewayPrivateEndpointConnectionListResult{ + // Value: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // { + // Name: to.Ptr("connection1"), + // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), + // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ + // LinkIdentifier: to.Ptr("805319460"), + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approval Done"), + // Status: to.Ptr("Approved"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/ApplicationGatewayPrivateEndpointConnectionUpdate.json +func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().BeginUpdate(ctx, "rg1", "appgw", "connection1", armnetwork.ApplicationGatewayPrivateEndpointConnection{ + Name: to.Ptr("connection1"), + Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ + PrivateEndpoint: &armnetwork.PrivateEndpoint{ + ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + }, + PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + Description: to.Ptr("approved it for some reason."), + Status: to.Ptr("Approved"), + }, + }, + }, 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 poll 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 = armnetwork.ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse{ + // ApplicationGatewayPrivateEndpointConnection: armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // Name: to.Ptr("testPlePeConnection"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/testPlePeConnection"), + // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ + // LinkIdentifier: to.Ptr("linkId"), + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go index 07d95bec7d06..b7e77f435540 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ApplicationGatewayPrivateLinkResourcesClient contains the methods for the ApplicationGatewayPrivateLinkResources group. // Don't use this type directly, use NewApplicationGatewayPrivateLinkResourcesClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationGatewayPrivateLinkResourcesClient struct { internal *arm.Client subscriptionID string } // NewApplicationGatewayPrivateLinkResourcesClient creates a new instance of ApplicationGatewayPrivateLinkResourcesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateLinkResourcesClient, error) { @@ -42,9 +42,7 @@ func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, cred } // NewListPager - Lists all private link resources on an application gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.NewListPager // method. @@ -74,6 +72,10 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) NewListPager(resourc // listCreateRequest creates the List request. func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewayPrivateLinkResourcesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,17 +84,13 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ct return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go index 1432b57e7ff9..28fe7894e486 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayPrivateLinkResourceList.json +// Generated from example definition: 2025-07-01/ApplicationGatewayPrivateLinkResourceList.json func ExampleApplicationGatewayPrivateLinkResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,20 +33,24 @@ func ExampleApplicationGatewayPrivateLinkResourcesClient_NewListPager() { _ = 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.ApplicationGatewayPrivateLinkResourceListResult = armnetwork.ApplicationGatewayPrivateLinkResourceListResult{ - // Value: []*armnetwork.ApplicationGatewayPrivateLinkResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateLinkResources"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkResourceProperties{ - // GroupID: to.Ptr("privateLink1"), - // RequiredMembers: []*string{ - // to.Ptr("privateLink1")}, + // page = armnetwork.ApplicationGatewayPrivateLinkResourcesClientListResponse{ + // ApplicationGatewayPrivateLinkResourceListResult: armnetwork.ApplicationGatewayPrivateLinkResourceListResult{ + // Value: []*armnetwork.ApplicationGatewayPrivateLinkResource{ + // { + // Name: to.Ptr("privateLink1"), + // Type: to.Ptr("Microsoft.Network/applicationGateways/privateLinkResources"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/privateLink1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkResourceProperties{ + // GroupID: to.Ptr("privateLink1"), + // RequiredMembers: []*string{ + // to.Ptr("privateLink1"), + // }, // RequiredZoneNames: []*string{ // }, // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go index 747abe3d2aee..704a2dadc15d 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ApplicationGatewaysClient contains the methods for the ApplicationGateways group. // Don't use this type directly, use NewApplicationGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationGatewaysClient struct { internal *arm.Client subscriptionID string } // NewApplicationGatewaysClient creates a new instance of ApplicationGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewaysClient, error) { @@ -43,9 +43,7 @@ func NewApplicationGatewaysClient(subscriptionID string, credential azcore.Token // BeginBackendHealth - Gets the backend health of the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth // method. @@ -56,8 +54,7 @@ func (client *ApplicationGatewaysClient) BeginBackendHealth(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -69,8 +66,6 @@ func (client *ApplicationGatewaysClient) BeginBackendHealth(ctx context.Context, // BackendHealth - Gets the backend health of the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealth" @@ -95,6 +90,10 @@ func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, reso // backendHealthCreateRequest creates the BackendHealth request. func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -103,10 +102,6 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -115,8 +110,8 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -124,9 +119,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. // BeginBackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - probeRequest - Request body for on-demand test probe operation. // - options - ApplicationGatewaysClientBeginBackendHealthOnDemandOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealthOnDemand @@ -138,8 +131,7 @@ func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthOnDemandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -152,8 +144,6 @@ func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context. // BackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) backendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealthOnDemand" @@ -178,6 +168,10 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemand(ctx context.Conte // backendHealthOnDemandCreateRequest creates the BackendHealthOnDemand request. func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -186,10 +180,6 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -198,9 +188,10 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, probeRequest); err != nil { return nil, err } @@ -209,9 +200,7 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx // BeginCreateOrUpdate - Creates or updates the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to the create or update application gateway operation. // - options - ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate @@ -223,8 +212,7 @@ func (client *ApplicationGatewaysClient) BeginCreateOrUpdate(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -236,8 +224,6 @@ func (client *ApplicationGatewaysClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginCreateOrUpdate" @@ -262,6 +248,10 @@ func (client *ApplicationGatewaysClient) createOrUpdate(ctx context.Context, res // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, _ *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -270,18 +260,15 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -290,9 +277,7 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete // method. @@ -303,8 +288,7 @@ func (client *ApplicationGatewaysClient) BeginDelete(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -316,8 +300,6 @@ func (client *ApplicationGatewaysClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginDelete" @@ -342,6 +324,10 @@ func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, re // deleteCreateRequest creates the Delete request. func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -350,26 +336,19 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. func (client *ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (ApplicationGatewaysClientGetResponse, error) { @@ -397,6 +376,10 @@ func (client *ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupN // getCreateRequest creates the Get request. func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -405,17 +388,13 @@ func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -431,9 +410,7 @@ func (client *ApplicationGatewaysClient) getHandleResponse(resp *http.Response) // GetSSLPredefinedPolicy - Gets Ssl predefined policy with the specified policy name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - predefinedPolicyName - Name of Ssl predefined policy. +// - predefinedPolicyName - The name of the ssl predefined policy. // - options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy // method. func (client *ApplicationGatewaysClient) GetSSLPredefinedPolicy(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (ApplicationGatewaysClientGetSSLPredefinedPolicyResponse, error) { @@ -474,8 +451,8 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -490,9 +467,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(re } // NewListPager - Lists all application gateways in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager // method. func (client *ApplicationGatewaysClient) NewListPager(resourceGroupName string, options *ApplicationGatewaysClientListOptions) *runtime.Pager[ApplicationGatewaysClientListResponse] { @@ -521,21 +496,21 @@ func (client *ApplicationGatewaysClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *ApplicationGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -550,8 +525,6 @@ func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) } // NewListAllPager - Gets all the application gateways in a subscription. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager // method. func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { @@ -589,8 +562,8 @@ func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -606,8 +579,6 @@ func (client *ApplicationGatewaysClient) listAllHandleResponse(resp *http.Respon // ListAvailableRequestHeaders - Lists all available request headers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { @@ -644,8 +615,8 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -661,8 +632,6 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersHandleRespon // ListAvailableResponseHeaders - Lists all available response headers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { @@ -699,8 +668,8 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -716,8 +685,6 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersHandleRespo // ListAvailableSSLOptions - Lists available Ssl options for configuring Ssl policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions // method. func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { @@ -754,8 +721,8 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -770,8 +737,6 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(r } // NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager // method. func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { @@ -809,8 +774,8 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -826,8 +791,6 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesHandl // ListAvailableServerVariables - Lists all available server variables. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables // method. func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { @@ -864,8 +827,8 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -881,8 +844,6 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesHandleRespo // ListAvailableWafRuleSets - Lists all available web application firewall rule sets. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets // method. func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { @@ -919,8 +880,8 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -936,9 +897,7 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsHandleResponse( // BeginStart - Starts the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart // method. @@ -949,8 +908,7 @@ func (client *ApplicationGatewaysClient) BeginStart(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -962,8 +920,6 @@ func (client *ApplicationGatewaysClient) BeginStart(ctx context.Context, resourc // Start - Starts the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStart" @@ -988,6 +944,10 @@ func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGrou // startCreateRequest creates the Start request. func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewaysClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -996,26 +956,19 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginStop - Stops the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop // method. @@ -1026,8 +979,7 @@ func (client *ApplicationGatewaysClient) BeginStop(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1039,8 +991,6 @@ func (client *ApplicationGatewaysClient) BeginStop(ctx context.Context, resource // Stop - Stops the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStop" @@ -1065,6 +1015,10 @@ func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroup // stopCreateRequest creates the Stop request. func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, _ *ApplicationGatewaysClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1073,26 +1027,19 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // UpdateTags - Updates the specified application gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to update application gateway tags. // - options - ApplicationGatewaysClientUpdateTagsOptions contains the optional parameters for the ApplicationGatewaysClient.UpdateTags @@ -1122,6 +1069,10 @@ func (client *ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourc // updateTagsCreateRequest creates the UpdateTags request. func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject, _ *ApplicationGatewaysClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1130,18 +1081,15 @@ func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Con return nil, errors.New("parameter applicationGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go index 262430e1adcb..9d34e257d93c 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go @@ -1,453 +1,163 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayDelete.json -func ExampleApplicationGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ApplicationGatewayBackendHealthGet.json +func ExampleApplicationGatewaysClient_BeginBackendHealth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginDelete(ctx, "rg1", "appgw", nil) + poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealth(ctx, "appgw", "appgw", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayGet.json -func ExampleApplicationGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().Get(ctx, "rg1", "appgw", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // res = armnetwork.ApplicationGatewaysClientBackendHealthResponse{ + // ApplicationGatewayBackendHealth: armnetwork.ApplicationGatewayBackendHealth{ + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendHealthPool{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ + // { + // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), + // }, + // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ + // { + // Address: to.Ptr("10.220.1.8"), + // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), + // }, // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // Name: to.Ptr("entraJWTValidationConfig1"), - // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ - // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), - // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFPool"), // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // WeightPerServer: to.Ptr[int32](40), - // }, + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ + // { + // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // }, - // WeightPerServer: to.Ptr[int32](60), + // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ + // { + // Address: to.Ptr("10.220.1.4"), + // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), // }, - // }}, - // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, + // { + // Address: to.Ptr("10.220.1.5"), + // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // EntraJWTValidationConfig: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // }, - // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), - // }, - // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), - // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - // }, - // TrustedClientCertificates: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, - // }, - // }}, - // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ + // }, + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayBackendHealthTest.json +func ExampleApplicationGatewaysClient_BeginBackendHealthOnDemand() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealthOnDemand(ctx, "rg1", "appgw", armnetwork.ApplicationGatewayOnDemandProbe{ + Path: to.Ptr("/"), + BackendAddressPool: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), + }, + BackendHTTPSettings: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), + }, + PickHostNameFromBackendHTTPSettings: to.Ptr(true), + Timeout: to.Ptr[int32](30), + Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + }, 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 poll 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 = armnetwork.ApplicationGatewaysClientBackendHealthOnDemandResponse{ + // ApplicationGatewayBackendHealthOnDemand: armnetwork.ApplicationGatewayBackendHealthOnDemand{ + // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), + // }, + // BackendHealthHTTPSettings: &armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ + // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), + // }, + // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("clientcert"), - // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), - // Data: to.Ptr("****"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ValidatedCertData: to.Ptr("****"), - // }, - // }}, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ + // Address: to.Ptr("10.220.1.4"), + // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), + // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // Name: to.Ptr("pathMap1"), - // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ - // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // PathRules: []*armnetwork.ApplicationGatewayPathRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), - // Name: to.Ptr("apiPaths"), - // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Paths: []*string{ - // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, + // Address: to.Ptr("10.220.1.5"), + // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayCreate.json +// Generated from example definition: 2025-07-01/ApplicationGatewayCreate.json func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewApplicationGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "appgw", armnetwork.ApplicationGateway{ - Location: to.Ptr("eastus"), Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("eastus"), Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ { @@ -459,12 +169,13 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { }, { IPAddress: to.Ptr("10.0.1.2"), - }}, + }, + }, }, }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), Name: to.Ptr("appgwpool1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ { @@ -472,9 +183,11 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { }, { IPAddress: to.Ptr("10.0.0.2"), - }}, + }, + }, }, - }}, + }, + }, BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ { Name: to.Ptr("appgwbhs"), @@ -484,7 +197,8 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { RequestTimeout: to.Ptr[int32](30), Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), }, - }}, + }, + }, EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ { Name: to.Ptr("entraJWTValidationConfig1"), @@ -493,16 +207,18 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), }, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ { Name: to.Ptr("appgwfip"), Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), }, }, - }}, + }, + }, FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ { Name: to.Ptr("appgwfp"), @@ -515,16 +231,18 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ Port: to.Ptr[int32](80), }, - }}, + }, + }, GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ { Name: to.Ptr("appgwipc"), Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet"), }, }, - }}, + }, + }, GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ EnableRequestBuffering: to.Ptr(true), EnableResponseBuffering: to.Ptr(true), @@ -534,17 +252,17 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Name: to.Ptr("appgwhl"), Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), }, FrontendPort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), }, RequireServerNameIndication: to.Ptr(false), SSLCertificate: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), }, SSLProfile: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), }, Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), }, @@ -553,37 +271,39 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Name: to.Ptr("appgwhttplistener"), Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), }, FrontendPort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), }, Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), }, - }}, + }, + }, RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ { Name: to.Ptr("appgwrule"), Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), }, BackendHTTPSettings: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), }, EntraJWTValidationConfig: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), }, HTTPListener: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), }, Priority: to.Ptr[int32](10), RewriteRuleSet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), }, RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), }, - }}, + }, + }, RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ { Name: to.Ptr("rewriteRuleSet1"), @@ -596,12 +316,14 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { { HeaderName: to.Ptr("X-Forwarded-For"), HeaderValue: to.Ptr("{var_add_x_forwarded_for_proxy}"), - }}, + }, + }, ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ { HeaderName: to.Ptr("Strict-Transport-Security"), HeaderValue: to.Ptr("max-age=31536000"), - }}, + }, + }, URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ ModifiedPath: to.Ptr("/abc"), }, @@ -612,11 +334,14 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Negate: to.Ptr(false), Pattern: to.Ptr("^Bearer"), Variable: to.Ptr("http_req_Authorization"), - }}, + }, + }, RuleSequence: to.Ptr[int32](102), - }}, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.ApplicationGatewaySKU{ Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardV2), Capacity: to.Ptr[int32](3), @@ -635,7 +360,8 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ KeyVaultSecretID: to.Ptr("https://kv/secret"), }, - }}, + }, + }, SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ { Name: to.Ptr("sslProfile1"), @@ -645,23 +371,27 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { }, SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, + to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + }, MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), }, TrustedClientCertificates: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + }, + }, }, - }}, + }, + }, TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ { Name: to.Ptr("clientcert"), Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ Data: to.Ptr("****"), }, - }}, + }, + }, TrustedRootCertificates: []*armnetwork.ApplicationGatewayTrustedRootCertificate{ { Name: to.Ptr("rootcert"), @@ -674,7 +404,8 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { Properties: &armnetwork.ApplicationGatewayTrustedRootCertificatePropertiesFormat{ KeyVaultSecretID: to.Ptr("https://kv/secret"), }, - }}, + }, + }, }, }, nil) if err != nil { @@ -682,435 +413,813 @@ func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.0.1.1"), - // }, - // { - // IPAddress: to.Ptr("10.0.1.2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.ApplicationGatewaysClientCreateOrUpdateResponse{ + // ApplicationGateway: armnetwork.ApplicationGateway{ + // Name: to.Ptr("appgw"), + // Type: to.Ptr("Microsoft.Network/applicationGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), + // Location: to.Ptr("southcentralus"), + // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ + // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.0.0.1"), + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // { + // Name: to.Ptr("appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.0.1.1"), + // }, + // { + // IPAddress: to.Ptr("10.0.1.2"), + // }, // }, - // { - // IPAddress: to.Ptr("10.0.0.2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // Name: to.Ptr("entraJWTValidationConfig1"), - // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ - // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), - // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // { + // Name: to.Ptr("appgwpool1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.0.0.1"), + // }, + // { + // IPAddress: to.Ptr("10.0.0.2"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ + // { + // Name: to.Ptr("appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestTimeout: to.Ptr[int32](30), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ + // { + // Name: to.Ptr("entraJWTValidationConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ + // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), + // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ + // { + // Name: to.Ptr("appgwfip"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // }, // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // }, + // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ + // { + // Name: to.Ptr("appgwfp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](443), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // }}, - // Listeners: []*armnetwork.ApplicationGatewayListener{ - // }, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // }, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ - // }, - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // { + // Name: to.Ptr("appgwfp80"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // }, + // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ + // { + // Name: to.Ptr("appgwipc"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), + // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, - // EntraJWTValidationConfig: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // }, + // }, + // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ + // EnableRequestBuffering: to.Ptr(true), + // EnableResponseBuffering: to.Ptr(true), + // }, + // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ + // { + // Name: to.Ptr("appgwhl"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequireServerNameIndication: to.Ptr(false), + // SSLCertificate: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // SSLProfile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // }, + // { + // Name: to.Ptr("appgwhttplistener"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // }, + // Listeners: []*armnetwork.ApplicationGatewayListener{ + // }, + // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ + // }, + // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), + // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // }, + // Probes: []*armnetwork.ApplicationGatewayProbe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ + // }, + // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ + // { + // Name: to.Ptr("appgwrule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // EntraJWTValidationConfig: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // }, + // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ + // { + // Name: to.Ptr("rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ + // { + // Name: to.Ptr("Set X-Forwarded-For"), + // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ + // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("X-Forwarded-For"), + // HeaderValue: to.Ptr("{var_remote-addr}"), + // }, + // }, + // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("Strict-Transport-Security"), + // HeaderValue: to.Ptr("max-age=31536000"), + // }, + // }, + // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ + // ModifiedPath: to.Ptr("/abc"), + // ModifiedQueryString: to.Ptr("x=y&a=b"), + // }, + // }, + // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), + // IgnoreCase: to.Ptr(true), + // Negate: to.Ptr(false), + // Pattern: to.Ptr("^Bearer"), + // Variable: to.Ptr("http_req_Authorization"), + // }, // }, + // RuleSequence: to.Ptr[int32](102), // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // RoutingRules: []*armnetwork.ApplicationGatewayRoutingRule{ - // }, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), + // }, + // }, // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientCertIssuerDN: to.Ptr(true), + // }, + // RoutingRules: []*armnetwork.ApplicationGatewayRoutingRule{ + // }, + // SKU: &armnetwork.ApplicationGatewaySKU{ + // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), + // Capacity: to.Ptr[int32](3), + // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), + // }, + // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // { + // Name: to.Ptr("sslcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicCertData: to.Ptr("*****"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, + // }, + // }, + // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ + // { + // Name: to.Ptr("sslProfile1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ + // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ + // VerifyClientCertIssuerDN: to.Ptr(true), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // }, // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), // }, // TrustedClientCertificates: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + // }, + // }, // }, - // }}, + // }, + // }, // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Name: to.Ptr("clientcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ // Data: to.Ptr("****"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayUpdateTags.json -func ExampleApplicationGatewaysClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ApplicationGatewayDelete.json +func ExampleApplicationGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationGatewaysClient().UpdateTags(ctx, "rg1", "AppGw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewApplicationGatewaysClient().BeginDelete(ctx, "rg1", "appgw", 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 poll 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.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("AppGw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), - // Name: to.Ptr("Pool01"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.10.10.1"), + // res = armnetwork.ApplicationGatewaysClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayGet.json +func ExampleApplicationGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationGatewaysClient().Get(ctx, "rg1", "appgw", 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 = armnetwork.ApplicationGatewaysClientGetResponse{ + // ApplicationGateway: armnetwork.ApplicationGateway{ + // Name: to.Ptr("appgw"), + // Type: to.Ptr("Microsoft.Network/applicationGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), + // Location: to.Ptr("southcentralus"), + // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ + // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ + // }, + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // { + // Name: to.Ptr("appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ // }, - // { - // IPAddress: to.Ptr("10.10.10.2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("appgwpool1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.0.0.1"), + // }, + // { + // IPAddress: to.Ptr("10.0.0.2"), + // }, // }, - // { - // IPAddress: to.Ptr("10.10.10.3"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), - // Name: to.Ptr("PoolSetting01"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // PickHostNameFromBackendAddress: to.Ptr(false), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ + // { + // Name: to.Ptr("appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestTimeout: to.Ptr[int32](30), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), - // Name: to.Ptr("FrontEndConfig01"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicIp1"), + // }, + // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ + // { + // Name: to.Ptr("entraJWTValidationConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ + // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), + // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), // }, // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), - // Name: to.Ptr("FrontEndPort01"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ + // { + // Name: to.Ptr("appgwfip"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // }, + // }, // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/gatewayIPConfigurations/GatewayIp01"), - // Name: to.Ptr("GatewayIp01"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet1"), + // }, + // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ + // { + // Name: to.Ptr("appgwfp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](443), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), - // Name: to.Ptr("listener1"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), + // { + // Name: to.Ptr("appgwfp80"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), + // }, + // }, + // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ + // { + // Name: to.Ptr("appgwipc"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), + // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ - // }, - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/requestRoutingRules/Rule01"), - // Name: to.Ptr("Rule01"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), + // }, + // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ + // EnableRequestBuffering: to.Ptr(true), + // EnableResponseBuffering: to.Ptr(true), + // }, + // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ + // { + // Name: to.Ptr("appgwhl"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequireServerNameIndication: to.Ptr(false), + // SSLCertificate: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // SSLProfile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), + // }, + // { + // Name: to.Ptr("appgwhttplistener"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), + // }, + // }, + // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ + // { + // Name: to.Ptr("ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ + // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), + // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // WeightPerServer: to.Ptr[int32](40), + // }, + // }, + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // }, + // WeightPerServer: to.Ptr[int32](60), + // }, + // }, + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardSmall), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // }, + // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), + // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // }, + // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ + // { + // Name: to.Ptr("privateLink1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ + // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ + // { + // Name: to.Ptr("natNicIpconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // }, + // }, + // { + // Name: to.Ptr("natNicIpconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // Probes: []*armnetwork.ApplicationGatewayProbe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ + // { + // Name: to.Ptr("appgwrule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // }, + // LoadDistributionPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // }, + // Priority: to.Ptr[int32](10), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), + // }, + // }, + // { + // Name: to.Ptr("appgwPathBasedRule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // EntraJWTValidationConfig: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // }, + // Priority: to.Ptr[int32](20), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), + // URLPathMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // }, + // }, + // }, + // }, + // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ + // { + // Name: to.Ptr("rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ + // { + // Name: to.Ptr("Set X-Forwarded-For"), + // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ + // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("X-Forwarded-For"), + // HeaderValue: to.Ptr("{var_remote-addr}"), + // }, + // }, + // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("Strict-Transport-Security"), + // HeaderValue: to.Ptr("max-age=31536000"), + // }, + // }, + // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ + // ModifiedPath: to.Ptr("/abc"), + // ModifiedQueryString: to.Ptr("x=y&a=b"), + // Reroute: to.Ptr(false), + // }, + // }, + // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ + // { + // IgnoreCase: to.Ptr(true), + // Negate: to.Ptr(false), + // Pattern: to.Ptr("^Bearer"), + // Variable: to.Ptr("http_req_Authorization"), + // }, + // }, + // RuleSequence: to.Ptr[int32](102), + // }, + // }, + // }, + // }, + // }, + // SKU: &armnetwork.ApplicationGatewaySKU{ + // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), + // Capacity: to.Ptr[int32](3), + // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), + // }, + // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // { + // Name: to.Ptr("sslcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicCertData: to.Ptr("*****"), + // }, + // }, + // }, + // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ + // { + // Name: to.Ptr("sslProfile1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ + // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ + // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), + // VerifyClientCertIssuerDN: to.Ptr(true), + // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // }, + // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), + // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), + // }, + // TrustedClientCertificates: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + // }, + // }, + // }, + // }, + // }, + // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ + // { + // Name: to.Ptr("clientcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ + // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), + // Data: to.Ptr("****"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ValidatedCertData: to.Ptr("****"), + // }, + // }, + // }, + // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ + // { + // Name: to.Ptr("pathMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ + // DefaultBackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // DefaultBackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // }, + // DefaultRewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // PathRules: []*armnetwork.ApplicationGatewayPathRule{ + // { + // Name: to.Ptr("apiPaths"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), + // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // LoadDistributionPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // }, + // Paths: []*string{ + // to.Ptr("/api"), + // to.Ptr("/v1/api"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, // }, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ + // }, + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json +func ExampleApplicationGatewaysClient_GetSSLPredefinedPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationGatewaysClient().GetSSLPredefinedPolicy(ctx, "AppGwSslPolicy20150501", 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 = armnetwork.ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{ + // ApplicationGatewaySSLPredefinedPolicy: armnetwork.ApplicationGatewaySSLPredefinedPolicy{ + // Name: to.Ptr("AppGwSslPolicy20150501"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), + // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA), + // }, + // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayList.json +// Generated from example definition: 2025-07-01/ApplicationGatewayList.json func ExampleApplicationGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1125,393 +1234,424 @@ func ExampleApplicationGatewaysClient_NewListPager() { _ = 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.ApplicationGatewayListResult = armnetwork.ApplicationGatewayListResult{ - // Value: []*armnetwork.ApplicationGateway{ - // { - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // page = armnetwork.ApplicationGatewaysClientListResponse{ + // ApplicationGatewayListResult: armnetwork.ApplicationGatewayListResult{ + // Value: []*armnetwork.ApplicationGateway{ + // { + // Name: to.Ptr("appgw"), + // Type: to.Ptr("Microsoft.Network/applicationGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), + // Location: to.Ptr("southcentralus"), + // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ + // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // { + // Name: to.Ptr("appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // Name: to.Ptr("entraJWTValidationConfig1"), - // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ - // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), - // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("appgwpool1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.0.0.1"), + // }, + // { + // IPAddress: to.Ptr("10.0.0.2"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ + // { + // Name: to.Ptr("appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestTimeout: to.Ptr[int32](30), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ + // { + // Name: to.Ptr("entraJWTValidationConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ + // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), + // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), // }, // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ + // { + // Name: to.Ptr("appgwfip"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // }, // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // }, + // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ + // { + // Name: to.Ptr("appgwfp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](443), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // { + // Name: to.Ptr("appgwfp80"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // }, + // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ + // { + // Name: to.Ptr("appgwipc"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), + // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ + // EnableRequestBuffering: to.Ptr(true), + // EnableResponseBuffering: to.Ptr(true), + // }, + // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ + // { + // Name: to.Ptr("appgwhl"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequireServerNameIndication: to.Ptr(false), + // SSLCertificate: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // SSLProfile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // { + // Name: to.Ptr("appgwhttplistener"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ + // { + // Name: to.Ptr("ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ + // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), + // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // WeightPerServer: to.Ptr[int32](40), // }, - // WeightPerServer: to.Ptr[int32](40), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // }, + // WeightPerServer: to.Ptr[int32](60), // }, - // WeightPerServer: to.Ptr[int32](60), // }, - // }}, + // }, + // }, // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), + // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // }, + // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ + // { + // Name: to.Ptr("privateLink1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ + // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ + // { + // Name: to.Ptr("natNicIpconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // { + // Name: to.Ptr("natNicIpconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // EntraJWTValidationConfig: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Probes: []*armnetwork.ApplicationGatewayProbe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ + // { + // Name: to.Ptr("appgwrule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // EntraJWTValidationConfig: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // }, + // LoadDistributionPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // }, + // Priority: to.Ptr[int32](10), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // }, + // { + // Name: to.Ptr("appgwPathBasedRule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // }, + // Priority: to.Ptr[int32](20), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), + // URLPathMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // }, // }, // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // }, + // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ + // { + // Name: to.Ptr("rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ + // { + // Name: to.Ptr("Set X-Forwarded-For"), + // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ + // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("X-Forwarded-For"), + // HeaderValue: to.Ptr("{var_remote-addr}"), + // }, + // }, + // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("Strict-Transport-Security"), + // HeaderValue: to.Ptr("max-age=31536000"), + // }, + // }, + // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ + // ModifiedPath: to.Ptr("/abc"), + // ModifiedQueryString: to.Ptr("x=y&a=b"), + // Reroute: to.Ptr(false), + // }, + // }, + // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), + // IgnoreCase: to.Ptr(true), + // Negate: to.Ptr(false), + // Pattern: to.Ptr("^Bearer"), + // Variable: to.Ptr("http_req_Authorization"), + // }, // }, + // RuleSequence: to.Ptr[int32](102), // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), + // }, + // }, // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), + // }, + // SKU: &armnetwork.ApplicationGatewaySKU{ + // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), + // Capacity: to.Ptr[int32](3), + // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), + // }, + // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // { + // Name: to.Ptr("sslcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicCertData: to.Ptr("*****"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, + // }, + // }, + // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ + // { + // Name: to.Ptr("sslProfile1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ + // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ + // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), + // VerifyClientCertIssuerDN: to.Ptr(true), + // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // }, // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), // }, // TrustedClientCertificates: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + // }, + // }, // }, - // }}, + // }, + // }, // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Name: to.Ptr("clientcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), // Data: to.Ptr("****"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ValidatedCertData: to.Ptr("****"), // }, - // }}, + // }, + // }, // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), // Name: to.Ptr("pathMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), // }, // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), // }, // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), // }, // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), // }, // PathRules: []*armnetwork.ApplicationGatewayPathRule{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), // Name: to.Ptr("apiPaths"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), // }, // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), // }, // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), // }, // Paths: []*string{ // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, + // to.Ptr("/v1/api"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // }, - // }}, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayListAll.json +// Generated from example definition: 2025-07-01/ApplicationGatewayListAll.json func ExampleApplicationGatewaysClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1526,574 +1666,424 @@ func ExampleApplicationGatewaysClient_NewListAllPager() { _ = 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.ApplicationGatewayListResult = armnetwork.ApplicationGatewayListResult{ - // Value: []*armnetwork.ApplicationGateway{ - // { - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // page = armnetwork.ApplicationGatewaysClientListAllResponse{ + // ApplicationGatewayListResult: armnetwork.ApplicationGatewayListResult{ + // Value: []*armnetwork.ApplicationGateway{ + // { + // Name: to.Ptr("appgw"), + // Type: to.Ptr("Microsoft.Network/applicationGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), + // Location: to.Ptr("southcentralus"), + // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ + // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // { + // Name: to.Ptr("appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // Name: to.Ptr("entraJWTValidationConfig1"), - // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ - // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), - // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("appgwpool1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.0.0.1"), + // }, + // { + // IPAddress: to.Ptr("10.0.0.2"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ + // { + // Name: to.Ptr("appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestTimeout: to.Ptr[int32](30), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // EntraJWTValidationConfigs: []*armnetwork.ApplicationGatewayEntraJWTValidationConfig{ + // { + // Name: to.Ptr("entraJWTValidationConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // Properties: &armnetwork.ApplicationGatewayEntraJWTValidationConfigPropertiesFormat{ + // ClientID: to.Ptr("37293f5a-97b3-451d-b786-f532d711c9ff"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TenantID: to.Ptr("70a036f6-8e4d-4615-bad6-149c02e7720d"), + // UnAuthorizedRequestAction: to.Ptr(armnetwork.ApplicationGatewayUnAuthorizedRequestActionDeny), // }, // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ + // { + // Name: to.Ptr("appgwfip"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), + // }, // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // }, + // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ + // { + // Name: to.Ptr("appgwfp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](443), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // { + // Name: to.Ptr("appgwfp80"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // }, + // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ + // { + // Name: to.Ptr("appgwipc"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), + // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ + // EnableRequestBuffering: to.Ptr(true), + // EnableResponseBuffering: to.Ptr(true), + // }, + // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ + // { + // Name: to.Ptr("appgwhl"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequireServerNameIndication: to.Ptr(false), + // SSLCertificate: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // }, + // SSLProfile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // }, + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // { + // Name: to.Ptr("appgwhttplistener"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ + // { + // Name: to.Ptr("ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ + // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), + // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // WeightPerServer: to.Ptr[int32](40), // }, - // WeightPerServer: to.Ptr[int32](40), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // { + // Name: to.Ptr("ld11"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), + // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), + // }, + // WeightPerServer: to.Ptr[int32](60), // }, - // WeightPerServer: to.Ptr[int32](60), // }, - // }}, + // }, + // }, // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, + // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), + // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ + // }, + // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ + // { + // Name: to.Ptr("privateLink1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ + // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ + // { + // Name: to.Ptr("natNicIpconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // { + // Name: to.Ptr("natNicIpconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), + // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // EntraJWTValidationConfig: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // Probes: []*armnetwork.ApplicationGatewayProbe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ + // { + // Name: to.Ptr("appgwrule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // }, + // EntraJWTValidationConfig: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/entraJWTValidationConfigs/entraJWTValidationConfig1"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), + // }, + // LoadDistributionPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // }, + // Priority: to.Ptr[int32](10), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // }, + // { + // Name: to.Ptr("appgwPathBasedRule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), + // }, + // Priority: to.Ptr[int32](20), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), + // URLPathMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), + // }, // }, // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // }, + // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ + // { + // Name: to.Ptr("rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ + // { + // Name: to.Ptr("Set X-Forwarded-For"), + // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ + // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("X-Forwarded-For"), + // HeaderValue: to.Ptr("{var_remote-addr}"), + // }, + // }, + // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ + // { + // HeaderName: to.Ptr("Strict-Transport-Security"), + // HeaderValue: to.Ptr("max-age=31536000"), + // }, + // }, + // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ + // ModifiedPath: to.Ptr("/abc"), + // ModifiedQueryString: to.Ptr("x=y&a=b"), + // Reroute: to.Ptr(false), + // }, + // }, + // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), + // IgnoreCase: to.Ptr(true), + // Negate: to.Ptr(false), + // Pattern: to.Ptr("^Bearer"), + // Variable: to.Ptr("http_req_Authorization"), + // }, // }, + // RuleSequence: to.Ptr[int32](102), // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), + // }, + // }, // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), + // }, + // SKU: &armnetwork.ApplicationGatewaySKU{ + // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), + // Capacity: to.Ptr[int32](3), + // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), + // }, + // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // { + // Name: to.Ptr("sslcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), + // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicCertData: to.Ptr("*****"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, + // }, + // }, + // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ + // { + // Name: to.Ptr("sslProfile1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), + // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ + // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ + // VerifyClientAuthMode: to.Ptr(armnetwork.ApplicationGatewayClientAuthVerificationModesStrict), + // VerifyClientCertIssuerDN: to.Ptr(true), + // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // }, // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), // }, // TrustedClientCertificates: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), + // }, + // }, // }, - // }}, + // }, + // }, // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Name: to.Ptr("clientcert"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), // Data: to.Ptr("****"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ValidatedCertData: to.Ptr("****"), // }, - // }}, + // }, + // }, // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), // Name: to.Ptr("pathMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), // }, // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), // }, // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), // }, // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), // }, // PathRules: []*armnetwork.ApplicationGatewayPathRule{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), // Name: to.Ptr("apiPaths"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), // }, // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), // }, // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), // }, // Paths: []*string{ // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, + // to.Ptr("/v1/api"), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RewriteRuleSet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), + // }, + // }, + // }, // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayStart.json -func ExampleApplicationGatewaysClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginStart(ctx, "rg1", "appgw", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayStop.json -func ExampleApplicationGatewaysClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginStop(ctx, "rg1", "appgw", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayBackendHealthGet.json -func ExampleApplicationGatewaysClient_BeginBackendHealth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealth(ctx, "appgw", "appgw", &armnetwork.ApplicationGatewaysClientBeginBackendHealthOptions{Expand: 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.ApplicationGatewayBackendHealth = armnetwork.ApplicationGatewayBackendHealth{ - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendHealthPool{ - // { - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - // }, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // { - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.8"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }}, - // }, - // { - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFPool"), - // }, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // { - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.4"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }, - // { - // Address: to.Ptr("10.220.1.5"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }}, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayBackendHealthTest.json -func ExampleApplicationGatewaysClient_BeginBackendHealthOnDemand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealthOnDemand(ctx, "rg1", "appgw", armnetwork.ApplicationGatewayOnDemandProbe{ - Path: to.Ptr("/"), - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - }, - BackendHTTPSettings: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - }, - PickHostNameFromBackendHTTPSettings: to.Ptr(true), - Timeout: to.Ptr[int32](30), - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - }, &armnetwork.ApplicationGatewaysClientBeginBackendHealthOnDemandOptions{Expand: 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.ApplicationGatewayBackendHealthOnDemand = armnetwork.ApplicationGatewayBackendHealthOnDemand{ - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - // }, - // BackendHealthHTTPSettings: &armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.4"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }, - // { - // Address: to.Ptr("10.220.1.5"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableServerVariablesGet.json -func ExampleApplicationGatewaysClient_ListAvailableServerVariables() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableServerVariables(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } } - // 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.StringArray = []*string{ - // to.Ptr("request_query")} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableRequestHeadersGet.json +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableRequestHeadersGet.json func ExampleApplicationGatewaysClient_ListAvailableRequestHeaders() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("72f988bf-86f1-41af-91ab-2d7cd011db47", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2104,18 +2094,18 @@ func ExampleApplicationGatewaysClient_ListAvailableRequestHeaders() { // 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.StringArray = []*string{ - // to.Ptr("Accept-Charset")} + // res = armnetwork.ApplicationGatewaysClientListAvailableRequestHeadersResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableResponseHeadersGet.json +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableResponseHeadersGet.json func ExampleApplicationGatewaysClient_ListAvailableResponseHeaders() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("72f988bf-86f1-41af-91ab-2d7cd011db47", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2126,68 +2116,21 @@ func ExampleApplicationGatewaysClient_ListAvailableResponseHeaders() { // 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.StringArray = []*string{ - // to.Ptr("Access-Control-Allow-Origin")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableWafRuleSetsGet.json -func ExampleApplicationGatewaysClient_ListAvailableWafRuleSets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableWafRuleSets(ctx, 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.ApplicationGatewayAvailableWafRuleSetsResult = armnetwork.ApplicationGatewayAvailableWafRuleSetsResult{ - // Value: []*armnetwork.ApplicationGatewayFirewallRuleSet{ - // { - // Name: to.Ptr("OWASP_3.0"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayAvailableWafRuleSets"), - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets/"), - // Properties: &armnetwork.ApplicationGatewayFirewallRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Multipart Request Body Strict Validation."), - // RuleID: to.Ptr[int32](200003), - // RuleIDString: to.Ptr("200003"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesDisabled), - // }, - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.0"), - // }, - // }}, + // res = armnetwork.ApplicationGatewaysClientListAvailableResponseHeadersResponse{ + // StringArray: []*string{ + // to.Ptr("Access-Control-Allow-Origin"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableSslOptionsGet.json +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableSslOptionsGet.json func ExampleApplicationGatewaysClient_ListAvailableSSLOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2198,67 +2141,72 @@ func ExampleApplicationGatewaysClient_ListAvailableSSLOptions() { // 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.ApplicationGatewayAvailableSSLOptions = armnetwork.ApplicationGatewayAvailableSSLOptions{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/ApplicationGatewayAvailableSslOptions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default"), - // Properties: &armnetwork.ApplicationGatewayAvailableSSLOptionsPropertiesFormat{ - // AvailableCipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, + // res = armnetwork.ApplicationGatewaysClientListAvailableSSLOptionsResponse{ + // ApplicationGatewayAvailableSSLOptions: armnetwork.ApplicationGatewayAvailableSSLOptions{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/ApplicationGatewayAvailableSslOptions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default"), + // Properties: &armnetwork.ApplicationGatewayAvailableSSLOptionsPropertiesFormat{ + // AvailableCipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA), + // }, // AvailableProtocols: []*armnetwork.ApplicationGatewaySSLProtocol{ // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12)}, - // DefaultPolicy: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501), - // PredefinedPolicies: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), - // }}, + // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12), + // }, + // DefaultPolicy: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501), + // PredefinedPolicies: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json func ExampleApplicationGatewaysClient_NewListAvailableSSLPredefinedPoliciesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2273,47 +2221,49 @@ func ExampleApplicationGatewaysClient_NewListAvailableSSLPredefinedPoliciesPager _ = 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.ApplicationGatewayAvailableSSLPredefinedPolicies = armnetwork.ApplicationGatewayAvailableSSLPredefinedPolicies{ - // Value: []*armnetwork.ApplicationGatewaySSLPredefinedPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // Name: to.Ptr("AppGwSslPolicy20150501"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, + // page = armnetwork.ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{ + // ApplicationGatewayAvailableSSLPredefinedPolicies: armnetwork.ApplicationGatewayAvailableSSLPredefinedPolicies{ + // Value: []*armnetwork.ApplicationGatewaySSLPredefinedPolicy{ + // { + // Name: to.Ptr("AppGwSslPolicy20150501"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), + // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA), + // }, // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), // }, // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), // Name: to.Ptr("AppGwSslPolicy20170401"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), @@ -2331,90 +2281,332 @@ func ExampleApplicationGatewaysClient_NewListAvailableSSLPredefinedPoliciesPager // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), // }, + // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), - // Name: to.Ptr("AppGwSslPolicy20170401S"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12), - // }, - // }}, - // } + // }, + // { + // Name: to.Ptr("AppGwSslPolicy20170401S"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), + // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ + // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), + // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), + // }, + // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json -func ExampleApplicationGatewaysClient_GetSSLPredefinedPolicy() { +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableServerVariablesGet.json +func ExampleApplicationGatewaysClient_ListAvailableServerVariables() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("72f988bf-86f1-41af-91ab-2d7cd011db47", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationGatewaysClient().GetSSLPredefinedPolicy(ctx, "AppGwSslPolicy20150501", nil) + res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableServerVariables(ctx, 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.ApplicationGatewaySSLPredefinedPolicy = armnetwork.ApplicationGatewaySSLPredefinedPolicy{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // Name: to.Ptr("AppGwSslPolicy20150501"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), + // res = armnetwork.ApplicationGatewaysClientListAvailableServerVariablesResponse{ + // StringArray: []*string{ + // to.Ptr("request_query"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayAvailableWafRuleSetsGet.json +func ExampleApplicationGatewaysClient_ListAvailableWafRuleSets() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableWafRuleSets(ctx, 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 = armnetwork.ApplicationGatewaysClientListAvailableWafRuleSetsResponse{ + // ApplicationGatewayAvailableWafRuleSetsResult: armnetwork.ApplicationGatewayAvailableWafRuleSetsResult{ + // Value: []*armnetwork.ApplicationGatewayFirewallRuleSet{ + // { + // Name: to.Ptr("OWASP_3.0"), + // Type: to.Ptr("Microsoft.Network/applicationGatewayAvailableWafRuleSets"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets/OWASP_3.0"), + // Properties: &armnetwork.ApplicationGatewayFirewallRuleSetPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ + // { + // Description: to.Ptr(""), + // RuleGroupName: to.Ptr("General"), + // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ + // { + // Description: to.Ptr("Multipart Request Body Strict Validation."), + // RuleID: to.Ptr[int32](200003), + // RuleIDString: to.Ptr("200003"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesDisabled), + // }, + // { + // Description: to.Ptr("Possible Multipart Unmatched Boundary."), + // RuleID: to.Ptr[int32](200004), + // RuleIDString: to.Ptr("200004"), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.0"), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayStart.json +func ExampleApplicationGatewaysClient_BeginStart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationGatewaysClient().BeginStart(ctx, "rg1", "appgw", 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 poll 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 = armnetwork.ApplicationGatewaysClientStartResponse{ + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayStop.json +func ExampleApplicationGatewaysClient_BeginStop() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationGatewaysClient().BeginStop(ctx, "rg1", "appgw", 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 poll 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 = armnetwork.ApplicationGatewaysClientStopResponse{ + // } +} + +// Generated from example definition: 2025-07-01/ApplicationGatewayUpdateTags.json +func ExampleApplicationGatewaysClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationGatewaysClient().UpdateTags(ctx, "rg1", "AppGw", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ApplicationGatewaysClientUpdateTagsResponse{ + // ApplicationGateway: armnetwork.ApplicationGateway{ + // Name: to.Ptr("AppGw"), + // Type: to.Ptr("Microsoft.Network/applicationGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ + // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ + // }, + // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ + // { + // Name: to.Ptr("Pool01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), + // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ + // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ + // { + // IPAddress: to.Ptr("10.10.10.1"), + // }, + // { + // IPAddress: to.Ptr("10.10.10.2"), + // }, + // { + // IPAddress: to.Ptr("10.10.10.3"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ + // { + // Name: to.Ptr("PoolSetting01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), + // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), + // PickHostNameFromBackendAddress: to.Ptr(false), + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestTimeout: to.Ptr[int32](30), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ + // { + // Name: to.Ptr("FrontEndConfig01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), + // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicIp1"), + // }, + // }, + // }, + // }, + // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ + // { + // Name: to.Ptr("FrontEndPort01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), + // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ + // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ + // { + // Name: to.Ptr("GatewayIp01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/gatewayIPConfigurations/GatewayIp01"), + // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet1"), + // }, + // }, + // }, + // }, + // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ + // { + // Name: to.Ptr("listener1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), + // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), + // }, + // FrontendPort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequireServerNameIndication: to.Ptr(false), + // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), + // }, + // }, + // }, + // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), + // Probes: []*armnetwork.ApplicationGatewayProbe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ + // }, + // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ + // { + // Name: to.Ptr("Rule01"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/requestRoutingRules/Rule01"), + // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), + // }, + // BackendHTTPSettings: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), + // }, + // HTTPListener: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), + // }, + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.ApplicationGatewaySKU{ + // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardSmall), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), + // }, + // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ + // }, + // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), // }, - // } + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go index a6c431ebfe90..b488b946fb50 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ApplicationGatewayWafDynamicManifestsClient contains the methods for the ApplicationGatewayWafDynamicManifests group. // Don't use this type directly, use NewApplicationGatewayWafDynamicManifestsClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationGatewayWafDynamicManifestsClient struct { internal *arm.Client subscriptionID string } // NewApplicationGatewayWafDynamicManifestsClient creates a new instance of ApplicationGatewayWafDynamicManifestsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsClient, error) { @@ -42,9 +42,7 @@ func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string, crede } // NewGetPager - Gets the regional application gateway waf manifest. -// -// Generated from API version 2025-05-01 -// - location - The region where the nrp are located at. +// - location - The location for which the WAF dynamic manifest is requested. // - options - ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager // method. func (client *ApplicationGatewayWafDynamicManifestsClient) NewGetPager(location string, options *ApplicationGatewayWafDynamicManifestsClientGetOptions) *runtime.Pager[ApplicationGatewayWafDynamicManifestsClientGetResponse] { @@ -73,21 +71,21 @@ func (client *ApplicationGatewayWafDynamicManifestsClient) NewGetPager(location // getCreateRequest creates the Get request. func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx context.Context, location string, _ *ApplicationGatewayWafDynamicManifestsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go index a5e9e1e116ce..70d9666c6e2c 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GetApplicationGatewayWafDynamicManifests.json +// Generated from example definition: 2025-07-01/GetApplicationGatewayWafDynamicManifests.json func ExampleApplicationGatewayWafDynamicManifestsClient_NewGetPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,54 +33,61 @@ func ExampleApplicationGatewayWafDynamicManifestsClient_NewGetPager() { _ = 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.ApplicationGatewayWafDynamicManifestResultList = armnetwork.ApplicationGatewayWafDynamicManifestResultList{ - // Value: []*armnetwork.ApplicationGatewayWafDynamicManifestResult{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), - // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ - // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ - // { - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Failed to Parse Request Body."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200002), - // RuleIDString: to.Ptr("200002"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Multipart Request Body Strict Validation."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200003), - // RuleIDString: to.Ptr("200003"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // page = armnetwork.ApplicationGatewayWafDynamicManifestsClientGetResponse{ + // ApplicationGatewayWafDynamicManifestResultList: armnetwork.ApplicationGatewayWafDynamicManifestResultList{ + // Value: []*armnetwork.ApplicationGatewayWafDynamicManifestResult{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), + // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ + // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ + // { + // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ + // { + // Description: to.Ptr(""), + // RuleGroupName: to.Ptr("General"), + // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ + // { + // Description: to.Ptr("Failed to Parse Request Body."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200002), + // RuleIDString: to.Ptr("200002"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, + // { + // Description: to.Ptr("Multipart Request Body Strict Validation."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200003), + // RuleIDString: to.Ptr("200003"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, + // { + // Description: to.Ptr("Possible Multipart Unmatched Boundary."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200004), + // RuleIDString: to.Ptr("200004"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, // }, - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), - // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ - // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2)}, - // }}, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), + // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ + // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2), + // }, + // }, + // }, // DefaultRuleSet: &armnetwork.DefaultRuleSetPropertyFormat{ // RuleSetType: to.Ptr("OWASP"), // RuleSetVersion: to.Ptr("3.2"), // }, // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go index 500361bdefe2..371821911a5b 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go index 0847a0e4b18d..df7dad63d53c 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ApplicationGatewayWafDynamicManifestsDefaultClient contains the methods for the ApplicationGatewayWafDynamicManifestsDefault // group. // Don't use this type directly, use NewApplicationGatewayWafDynamicManifestsDefaultClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationGatewayWafDynamicManifestsDefaultClient struct { internal *arm.Client subscriptionID string } // NewApplicationGatewayWafDynamicManifestsDefaultClient creates a new instance of ApplicationGatewayWafDynamicManifestsDefaultClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsDefaultClient, error) { @@ -44,9 +44,7 @@ func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string // Get - Gets the regional application gateway waf manifest. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The region where the nrp are located at. +// - location - The location for which the WAF dynamic manifest is requested. // - options - ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsDefaultClient.Get // method. func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse, error) { @@ -74,21 +72,21 @@ func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx contex // getCreateRequest creates the Get request. func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getCreateRequest(ctx context.Context, location string, _ *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go index a7d3f7b87cd3..2da2c6d79ab7 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GetApplicationGatewayWafDynamicManifestsDefault.json +// Generated from example definition: 2025-07-01/GetApplicationGatewayWafDynamicManifestsDefault.json func ExampleApplicationGatewayWafDynamicManifestsDefaultClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,50 +29,56 @@ func ExampleApplicationGatewayWafDynamicManifestsDefaultClient_Get() { // 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.ApplicationGatewayWafDynamicManifestResult = armnetwork.ApplicationGatewayWafDynamicManifestResult{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), - // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ - // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ - // { - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Failed to Parse Request Body."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200002), - // RuleIDString: to.Ptr("200002"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Multipart Request Body Strict Validation."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200003), - // RuleIDString: to.Ptr("200003"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // res = armnetwork.ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{ + // ApplicationGatewayWafDynamicManifestResult: armnetwork.ApplicationGatewayWafDynamicManifestResult{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), + // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ + // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ + // { + // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ + // { + // Description: to.Ptr(""), + // RuleGroupName: to.Ptr("General"), + // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ + // { + // Description: to.Ptr("Failed to Parse Request Body."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200002), + // RuleIDString: to.Ptr("200002"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, + // { + // Description: to.Ptr("Multipart Request Body Strict Validation."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200003), + // RuleIDString: to.Ptr("200003"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, + // { + // Description: to.Ptr("Possible Multipart Unmatched Boundary."), + // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), + // RuleID: to.Ptr[int32](200004), + // RuleIDString: to.Ptr("200004"), + // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), + // }, // }, - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), - // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ - // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2)}, - // }}, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), + // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ + // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2), + // }, + // }, + // }, // DefaultRuleSet: &armnetwork.DefaultRuleSetPropertyFormat{ // RuleSetType: to.Ptr("OWASP"), // RuleSetVersion: to.Ptr("3.2"), // }, // }, - // } + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go index 825c55d832fa..76d36356ff8f 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go index 4beb111c22af..5a5c215282b4 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ApplicationSecurityGroupsClient contains the methods for the ApplicationSecurityGroups group. // Don't use this type directly, use NewApplicationSecurityGroupsClient() instead. +// +// Generated from API version 2025-07-01 type ApplicationSecurityGroupsClient struct { internal *arm.Client subscriptionID string } // NewApplicationSecurityGroupsClient creates a new instance of ApplicationSecurityGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationSecurityGroupsClient, error) { @@ -43,9 +43,7 @@ func NewApplicationSecurityGroupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates an application security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to the create or update ApplicationSecurityGroup operation. // - options - ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *ApplicationSecurityGroupsClient) BeginCreateOrUpdate(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationSecurityGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ApplicationSecurityGroupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates an application security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationSecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdate(ctx context.Contex // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, _ *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *ApplicationSecurityGroupsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationSecurityGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *ApplicationSecurityGroupsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Conte // deleteCreateRequest creates the Delete request. func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, _ *ApplicationSecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get // method. @@ -232,6 +220,10 @@ func (client *ApplicationSecurityGroupsClient) Get(ctx context.Context, resource // getCreateRequest creates the Get request. func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, _ *ApplicationSecurityGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +232,13 @@ func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Cont return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,9 +253,7 @@ func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Resp } // NewListPager - Gets all the application security groups in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager // method. func (client *ApplicationSecurityGroupsClient) NewListPager(resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) *runtime.Pager[ApplicationSecurityGroupsClientListResponse] { @@ -296,21 +282,21 @@ func (client *ApplicationSecurityGroupsClient) NewListPager(resourceGroupName st // listCreateRequest creates the List request. func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *ApplicationSecurityGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -325,8 +311,6 @@ func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Res } // NewListAllPager - Gets all application security groups in a subscription. -// -// Generated from API version 2025-05-01 // - options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager // method. func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { @@ -364,8 +348,8 @@ func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,9 +365,7 @@ func (client *ApplicationSecurityGroupsClient) listAllHandleResponse(resp *http. // UpdateTags - Updates an application security group's tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to update application security group tags. // - options - ApplicationSecurityGroupsClientUpdateTagsOptions contains the optional parameters for the ApplicationSecurityGroupsClient.UpdateTags @@ -413,6 +395,10 @@ func (client *ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, r // updateTagsCreateRequest creates the UpdateTags request. func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject, _ *ApplicationSecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -421,18 +407,15 @@ func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx conte return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go index 070ea6ed1ee7..5ae7734c140f 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go @@ -1,159 +1,126 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupDelete.json -func ExampleApplicationSecurityGroupsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupCreate.json +func ExampleApplicationSecurityGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginDelete(ctx, "rg1", "test-asg", nil) + poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "test-asg", armnetwork.ApplicationSecurityGroup{ + Location: to.Ptr("westus"), + Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{}, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupGet.json -func ExampleApplicationSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationSecurityGroupsClient().Get(ctx, "rg1", "test-asg", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // res = armnetwork.ApplicationSecurityGroupsClientCreateOrUpdateResponse{ + // ApplicationSecurityGroup: armnetwork.ApplicationSecurityGroup{ + // Name: to.Ptr("test-asg"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupCreate.json -func ExampleApplicationSecurityGroupsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupDelete.json +func ExampleApplicationSecurityGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "test-asg", armnetwork.ApplicationSecurityGroup{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{}, - }, nil) + poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginDelete(ctx, "rg1", "test-asg", 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) + log.Fatalf("failed to poll 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.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, + // res = armnetwork.ApplicationSecurityGroupsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupUpdateTags.json -func ExampleApplicationSecurityGroupsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupGet.json +func ExampleApplicationSecurityGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationSecurityGroupsClient().UpdateTags(ctx, "rg1", "test-asg", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewApplicationSecurityGroupsClient().Get(ctx, "rg1", "test-asg", 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.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // res = armnetwork.ApplicationSecurityGroupsClientGetResponse{ + // ApplicationSecurityGroup: armnetwork.ApplicationSecurityGroup{ + // Name: to.Ptr("test-asg"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupListAll.json -func ExampleApplicationSecurityGroupsClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupList.json +func ExampleApplicationSecurityGroupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewApplicationSecurityGroupsClient().NewListAllPager(nil) + pager := clientFactory.NewApplicationSecurityGroupsClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -164,44 +131,47 @@ func ExampleApplicationSecurityGroupsClient_NewListAllPager() { _ = 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.ApplicationSecurityGroupListResult = armnetwork.ApplicationSecurityGroupListResult{ - // Value: []*armnetwork.ApplicationSecurityGroup{ - // { - // Name: to.Ptr("asg1"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // page = armnetwork.ApplicationSecurityGroupsClientListResponse{ + // ApplicationSecurityGroupListResult: armnetwork.ApplicationSecurityGroupListResult{ + // Value: []*armnetwork.ApplicationSecurityGroup{ + // { + // Name: to.Ptr("asg1"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, - // }, - // { - // Name: to.Ptr("asg2"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // { + // Name: to.Ptr("asg2"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ApplicationSecurityGroupList.json -func ExampleApplicationSecurityGroupsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupListAll.json +func ExampleApplicationSecurityGroupsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewApplicationSecurityGroupsClient().NewListPager("rg1", nil) + pager := clientFactory.NewApplicationSecurityGroupsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -212,28 +182,72 @@ func ExampleApplicationSecurityGroupsClient_NewListPager() { _ = 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.ApplicationSecurityGroupListResult = armnetwork.ApplicationSecurityGroupListResult{ - // Value: []*armnetwork.ApplicationSecurityGroup{ - // { - // Name: to.Ptr("asg1"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // page = armnetwork.ApplicationSecurityGroupsClientListAllResponse{ + // ApplicationSecurityGroupListResult: armnetwork.ApplicationSecurityGroupListResult{ + // Value: []*armnetwork.ApplicationSecurityGroup{ + // { + // Name: to.Ptr("asg1"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, - // }, - // { - // Name: to.Ptr("asg2"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // { + // Name: to.Ptr("asg2"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/ApplicationSecurityGroupUpdateTags.json +func ExampleApplicationSecurityGroupsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationSecurityGroupsClient().UpdateTags(ctx, "rg1", "test-asg", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ApplicationSecurityGroupsClientUpdateTagsResponse{ + // ApplicationSecurityGroup: armnetwork.ApplicationSecurityGroup{ + // Name: to.Ptr("test-asg"), + // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/autorest.md b/sdk/resourcemanager/network/armnetwork/autorest.md deleted file mode 100644 index e961af6925b1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 9.0.0 -tag: package-2025-05-01 -``` diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go index 867a99b4d47b..4ccc85cfb918 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AvailableDelegationsClient contains the methods for the AvailableDelegations group. // Don't use this type directly, use NewAvailableDelegationsClient() instead. +// +// Generated from API version 2025-07-01 type AvailableDelegationsClient struct { internal *arm.Client subscriptionID string } // NewAvailableDelegationsClient creates a new instance of AvailableDelegationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAvailableDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableDelegationsClient, error) { @@ -42,9 +42,7 @@ func NewAvailableDelegationsClient(subscriptionID string, credential azcore.Toke } // NewListPager - Gets all of the available subnet delegations for this subscription in this region. -// -// Generated from API version 2025-05-01 -// - location - The location of the subnet. +// - location - The location name. // - options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager // method. func (client *AvailableDelegationsClient) NewListPager(location string, options *AvailableDelegationsClientListOptions) *runtime.Pager[AvailableDelegationsClientListResponse] { @@ -73,21 +71,21 @@ func (client *AvailableDelegationsClient) NewListPager(location string, options // listCreateRequest creates the List request. func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, location string, _ *AvailableDelegationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go index aa56c3a8c92a..a51bae4b1680 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailableDelegationsSubscriptionGet.json +// Generated from example definition: 2025-07-01/AvailableDelegationsSubscriptionGet.json func ExampleAvailableDelegationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,16 +33,20 @@ func ExampleAvailableDelegationsClient_NewListPager() { _ = 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.AvailableDelegationsResult = armnetwork.AvailableDelegationsResult{ - // Value: []*armnetwork.AvailableDelegation{ - // { - // Name: to.Ptr("Microsoft.Provider.resourceType"), - // Type: to.Ptr("Microsoft.Network/availableDelegations"), - // Actions: []*string{ - // to.Ptr("Microsoft.Network/resource/action")}, - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), + // page = armnetwork.AvailableDelegationsClientListResponse{ + // AvailableDelegationsResult: armnetwork.AvailableDelegationsResult{ + // Value: []*armnetwork.AvailableDelegation{ + // { + // Name: to.Ptr("Microsoft.Provider.resourceType"), + // Type: to.Ptr("Microsoft.Network/availableDelegations"), + // Actions: []*string{ + // to.Ptr("Microsoft.Network/resource/action"), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go index ea99e1deff49..2682f25e27d1 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go index 5d9bc766d7b4..0d2bcf269cfe 100644 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AvailableEndpointServicesClient contains the methods for the AvailableEndpointServices group. // Don't use this type directly, use NewAvailableEndpointServicesClient() instead. +// +// Generated from API version 2025-07-01 type AvailableEndpointServicesClient struct { internal *arm.Client subscriptionID string } // NewAvailableEndpointServicesClient creates a new instance of AvailableEndpointServicesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableEndpointServicesClient, error) { @@ -42,9 +42,7 @@ func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore } // NewListPager - List what values of endpoint services are available for use. -// -// Generated from API version 2025-05-01 -// - location - The location to check available endpoint services. +// - location - The location name. // - options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager // method. func (client *AvailableEndpointServicesClient) NewListPager(location string, options *AvailableEndpointServicesClientListOptions) *runtime.Pager[AvailableEndpointServicesClientListResponse] { @@ -73,21 +71,21 @@ func (client *AvailableEndpointServicesClient) NewListPager(location string, opt // listCreateRequest creates the List request. func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Context, location string, _ *AvailableEndpointServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go index 750b40c9262f..f3e6741c4cd2 100644 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/EndpointServicesList.json +// Generated from example definition: 2025-07-01/EndpointServicesList.json func ExampleAvailableEndpointServicesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,23 +33,26 @@ func ExampleAvailableEndpointServicesClient_NewListPager() { _ = 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.EndpointServicesListResult = armnetwork.EndpointServicesListResult{ - // Value: []*armnetwork.EndpointServiceResult{ - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Storage"), - // Name: to.Ptr("Microsoft.Storage"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Sql"), - // Name: to.Ptr("Microsoft.Sql"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), + // page = armnetwork.AvailableEndpointServicesClientListResponse{ + // EndpointServicesListResult: armnetwork.EndpointServicesListResult{ + // Value: []*armnetwork.EndpointServiceResult{ + // { + // Name: to.Ptr("Microsoft.Storage"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Storage"), + // }, + // { + // Name: to.Ptr("Microsoft.Sql"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Sql"), + // }, + // { + // Name: to.Ptr("Microsoft.AzureActiveDirectory"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.AzureActiveDirectory"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.AzureActiveDirectory"), - // Name: to.Ptr("Microsoft.AzureActiveDirectory"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), - // }}, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go index 634d546bfea6..a109620740f5 100644 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AvailablePrivateEndpointTypesClient contains the methods for the AvailablePrivateEndpointTypes group. // Don't use this type directly, use NewAvailablePrivateEndpointTypesClient() instead. +// +// Generated from API version 2025-07-01 type AvailablePrivateEndpointTypesClient struct { internal *arm.Client subscriptionID string } // NewAvailablePrivateEndpointTypesClient creates a new instance of AvailablePrivateEndpointTypesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAvailablePrivateEndpointTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailablePrivateEndpointTypesClient, error) { @@ -43,8 +43,6 @@ func NewAvailablePrivateEndpointTypesClient(subscriptionID string, credential az // NewListPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this // region. -// -// Generated from API version 2025-05-01 // - location - The location of the domain name. // - options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager // method. @@ -74,21 +72,21 @@ func (client *AvailablePrivateEndpointTypesClient) NewListPager(location string, // listCreateRequest creates the List request. func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context.Context, location string, _ *AvailablePrivateEndpointTypesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -104,8 +102,6 @@ func (client *AvailablePrivateEndpointTypesClient) listHandleResponse(resp *http // NewListByResourceGroupPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription // in this region. -// -// Generated from API version 2025-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager @@ -136,6 +132,10 @@ func (client *AvailablePrivateEndpointTypesClient) NewListByResourceGroupPager(l // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, _ *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -144,17 +144,13 @@ func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequ return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go index 525d3aa68bff..12bda885b634 100644 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailablePrivateEndpointTypesGet.json +// Generated from example definition: 2025-07-01/AvailablePrivateEndpointTypesGet.json func ExampleAvailablePrivateEndpointTypesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,25 +33,28 @@ func ExampleAvailablePrivateEndpointTypesClient_NewListPager() { _ = 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.AvailablePrivateEndpointTypesResult = armnetwork.AvailablePrivateEndpointTypesResult{ - // Value: []*armnetwork.AvailablePrivateEndpointType{ - // { - // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), - // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, + // page = armnetwork.AvailablePrivateEndpointTypesClientListResponse{ + // AvailablePrivateEndpointTypesResult: armnetwork.AvailablePrivateEndpointTypesResult{ + // Value: []*armnetwork.AvailablePrivateEndpointType{ + // { + // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), + // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), + // }, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailablePrivateEndpointTypesResourceGroupGet.json +// Generated from example definition: 2025-07-01/AvailablePrivateEndpointTypesResourceGroupGet.json func ExampleAvailablePrivateEndpointTypesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -69,13 +69,16 @@ func ExampleAvailablePrivateEndpointTypesClient_NewListByResourceGroupPager() { _ = 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.AvailablePrivateEndpointTypesResult = armnetwork.AvailablePrivateEndpointTypesResult{ - // Value: []*armnetwork.AvailablePrivateEndpointType{ - // { - // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), - // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, + // page = armnetwork.AvailablePrivateEndpointTypesClientListByResourceGroupResponse{ + // AvailablePrivateEndpointTypesResult: armnetwork.AvailablePrivateEndpointTypesResult{ + // Value: []*armnetwork.AvailablePrivateEndpointType{ + // { + // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), + // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go index 17e363031bd6..5c7f4bc8c937 100644 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AvailableResourceGroupDelegationsClient contains the methods for the AvailableResourceGroupDelegations group. // Don't use this type directly, use NewAvailableResourceGroupDelegationsClient() instead. +// +// Generated from API version 2025-07-01 type AvailableResourceGroupDelegationsClient struct { internal *arm.Client subscriptionID string } // NewAvailableResourceGroupDelegationsClient creates a new instance of AvailableResourceGroupDelegationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableResourceGroupDelegationsClient, error) { @@ -42,8 +42,6 @@ func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credentia } // NewListPager - Gets all of the available subnet delegations for this resource group in this region. -// -// Generated from API version 2025-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.NewListPager @@ -74,6 +72,10 @@ func (client *AvailableResourceGroupDelegationsClient) NewListPager(location str // listCreateRequest creates the List request. func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx context.Context, location string, resourceGroupName string, _ *AvailableResourceGroupDelegationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -82,17 +84,13 @@ func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx con return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go index 76a5eb713932..ec057daef8fa 100644 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailableDelegationsResourceGroupGet.json +// Generated from example definition: 2025-07-01/AvailableDelegationsResourceGroupGet.json func ExampleAvailableResourceGroupDelegationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,16 +33,20 @@ func ExampleAvailableResourceGroupDelegationsClient_NewListPager() { _ = 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.AvailableDelegationsResult = armnetwork.AvailableDelegationsResult{ - // Value: []*armnetwork.AvailableDelegation{ - // { - // Name: to.Ptr("Microsoft.Provider.resourceType"), - // Type: to.Ptr("Microsoft.Network/availableDelegations"), - // Actions: []*string{ - // to.Ptr("Microsoft.Network/resource/action")}, - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), + // page = armnetwork.AvailableResourceGroupDelegationsClientListResponse{ + // AvailableDelegationsResult: armnetwork.AvailableDelegationsResult{ + // Value: []*armnetwork.AvailableDelegation{ + // { + // Name: to.Ptr("Microsoft.Provider.resourceType"), + // Type: to.Ptr("Microsoft.Network/availableDelegations"), + // Actions: []*string{ + // to.Ptr("Microsoft.Network/resource/action"), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go index f01b5e6b6738..ca0b21cbf4cf 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AvailableServiceAliasesClient contains the methods for the AvailableServiceAliases group. // Don't use this type directly, use NewAvailableServiceAliasesClient() instead. +// +// Generated from API version 2025-07-01 type AvailableServiceAliasesClient struct { internal *arm.Client subscriptionID string } // NewAvailableServiceAliasesClient creates a new instance of AvailableServiceAliasesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableServiceAliasesClient, error) { @@ -42,9 +42,7 @@ func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.T } // NewListPager - Gets all available service aliases for this subscription in this region. -// -// Generated from API version 2025-05-01 -// - location - The location. +// - location - The location name. // - options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager // method. func (client *AvailableServiceAliasesClient) NewListPager(location string, options *AvailableServiceAliasesClientListOptions) *runtime.Pager[AvailableServiceAliasesClientListResponse] { @@ -73,21 +71,21 @@ func (client *AvailableServiceAliasesClient) NewListPager(location string, optio // listCreateRequest creates the List request. func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Context, location string, _ *AvailableServiceAliasesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -102,10 +100,8 @@ func (client *AvailableServiceAliasesClient) listHandleResponse(resp *http.Respo } // NewListByResourceGroupPager - Gets all available service aliases for this resource group in this region. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - location - The location. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The location name. // - options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager // method. func (client *AvailableServiceAliasesClient) NewListByResourceGroupPager(resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) *runtime.Pager[AvailableServiceAliasesClientListByResourceGroupResponse] { @@ -134,6 +130,10 @@ func (client *AvailableServiceAliasesClient) NewListByResourceGroupPager(resourc // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, _ *AvailableServiceAliasesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -142,17 +142,13 @@ func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ct return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go index 7d481d324c3c..6141063ddbbe 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailableServiceAliasesList.json +// Generated from example definition: 2025-07-01/AvailableServiceAliasesList.json func ExampleAvailableServiceAliasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,32 +33,35 @@ func ExampleAvailableServiceAliasesClient_NewListPager() { _ = 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.AvailableServiceAliasesResult = armnetwork.AvailableServiceAliasesResult{ - // Value: []*armnetwork.AvailableServiceAlias{ - // { - // Name: to.Ptr("servicesAzure"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), - // ResourceName: to.Ptr("/services/Azure"), + // page = armnetwork.AvailableServiceAliasesClientListResponse{ + // AvailableServiceAliasesResult: armnetwork.AvailableServiceAliasesResult{ + // Value: []*armnetwork.AvailableServiceAlias{ + // { + // Name: to.Ptr("servicesAzure"), + // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), + // ResourceName: to.Ptr("/services/Azure"), + // }, + // { + // Name: to.Ptr("servicesAzureManagedInstance"), + // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), + // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), + // }, // }, - // { - // Name: to.Ptr("servicesAzureManagedInstance"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), - // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), - // }}, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AvailableServiceAliasesListByResourceGroup.json +// Generated from example definition: 2025-07-01/AvailableServiceAliasesListByResourceGroup.json func ExampleAvailableServiceAliasesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -76,20 +76,23 @@ func ExampleAvailableServiceAliasesClient_NewListByResourceGroupPager() { _ = 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.AvailableServiceAliasesResult = armnetwork.AvailableServiceAliasesResult{ - // Value: []*armnetwork.AvailableServiceAlias{ - // { - // Name: to.Ptr("servicesAzure"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), - // ResourceName: to.Ptr("/services/Azure"), + // page = armnetwork.AvailableServiceAliasesClientListByResourceGroupResponse{ + // AvailableServiceAliasesResult: armnetwork.AvailableServiceAliasesResult{ + // Value: []*armnetwork.AvailableServiceAlias{ + // { + // Name: to.Ptr("servicesAzure"), + // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), + // ResourceName: to.Ptr("/services/Azure"), + // }, + // { + // Name: to.Ptr("servicesAzureManagedInstance"), + // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), + // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), + // }, // }, - // { - // Name: to.Ptr("servicesAzureManagedInstance"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), - // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), - // }}, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go index 317a4e8af38b..50112d062194 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go index 3f0b8a8ae448..86716ade989a 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go index b22663624ddc..241db668095e 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // AzureFirewallFqdnTagsClient contains the methods for the AzureFirewallFqdnTags group. // Don't use this type directly, use NewAzureFirewallFqdnTagsClient() instead. +// +// Generated from API version 2025-07-01 type AzureFirewallFqdnTagsClient struct { internal *arm.Client subscriptionID string } // NewAzureFirewallFqdnTagsClient creates a new instance of AzureFirewallFqdnTagsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallFqdnTagsClient, error) { @@ -42,8 +42,6 @@ func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.Tok } // NewListAllPager - Gets all the Azure Firewall FQDN Tags in a subscription. -// -// Generated from API version 2025-05-01 // - options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager // method. func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { @@ -81,8 +79,8 @@ func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go index cf7db3cbd0e6..ab1248bc4037 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallFqdnTagsListBySubscription.json +// Generated from example definition: 2025-07-01/AzureFirewallFqdnTagsListBySubscription.json func ExampleAzureFirewallFqdnTagsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,22 +33,25 @@ func ExampleAzureFirewallFqdnTagsClient_NewListAllPager() { _ = 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.AzureFirewallFqdnTagListResult = armnetwork.AzureFirewallFqdnTagListResult{ - // Value: []*armnetwork.AzureFirewallFqdnTag{ - // { - // Name: to.Ptr("azfwfqdntag"), - // Type: to.Ptr("Microsoft.Network/azureFirewallFqdnTags"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewallFqdnTags/azfwfqdntag"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallFqdnTagPropertiesFormat{ - // FqdnTagName: to.Ptr("azfwfqdntag"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.AzureFirewallFqdnTagsClientListAllResponse{ + // AzureFirewallFqdnTagListResult: armnetwork.AzureFirewallFqdnTagListResult{ + // Value: []*armnetwork.AzureFirewallFqdnTag{ + // { + // Name: to.Ptr("azfwfqdntag"), + // Type: to.Ptr("Microsoft.Network/azureFirewallFqdnTags"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewallFqdnTags/azfwfqdntag"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallFqdnTagPropertiesFormat{ + // FqdnTagName: to.Ptr("azfwfqdntag"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go index 0e299787d8b9..0eab597ad318 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -14,19 +13,21 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) // AzureFirewallsClient contains the methods for the AzureFirewalls group. // Don't use this type directly, use NewAzureFirewallsClient() instead. +// +// Generated from API version 2025-07-01 type AzureFirewallsClient struct { internal *arm.Client subscriptionID string } // NewAzureFirewallsClient creates a new instance of AzureFirewallsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewAzureFirewallsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallsClient, error) { @@ -43,9 +44,7 @@ func NewAzureFirewallsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to the create or update Azure Firewall operation. // - options - AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate @@ -57,8 +56,7 @@ func (client *AzureFirewallsClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +68,6 @@ func (client *AzureFirewallsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginCreateOrUpdate" @@ -94,8 +90,12 @@ func (client *AzureFirewallsClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, _ *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +104,18 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + if options != nil && options.CreateAfcControlPlane != nil { + reqQP.Set("createAfcControlPlane", strconv.FormatBool(*options.CreateAfcControlPlane)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +124,7 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete // method. @@ -137,8 +135,7 @@ func (client *AzureFirewallsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +147,6 @@ func (client *AzureFirewallsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginDelete" @@ -176,6 +171,10 @@ func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, _ *AzureFirewallsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +183,19 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. func (client *AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientGetOptions) (AzureFirewallsClientGetResponse, error) { @@ -231,6 +223,10 @@ func (client *AzureFirewallsClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, _ *AzureFirewallsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +235,13 @@ func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,9 +256,7 @@ func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (Azur } // NewListPager - Lists all Azure Firewalls in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.NewListPager method. func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, options *AzureFirewallsClientListOptions) *runtime.Pager[AzureFirewallsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AzureFirewallsClientListResponse]{ @@ -294,21 +284,21 @@ func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, optio // listCreateRequest creates the List request. func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *AzureFirewallsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -323,8 +313,6 @@ func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (Azu } // NewListAllPager - Gets all the Azure Firewalls in a subscription. -// -// Generated from API version 2025-05-01 // - options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager // method. func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { @@ -362,8 +350,8 @@ func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -379,10 +367,8 @@ func (client *AzureFirewallsClient) listAllHandleResponse(resp *http.Response) ( // BeginListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - azureFirewallName - The name of the azure firewall. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes // method. func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*runtime.Poller[AzureFirewallsClientListLearnedPrefixesResponse], error) { @@ -392,8 +378,7 @@ func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientListLearnedPrefixesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -405,8 +390,6 @@ func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context // ListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginListLearnedPrefixes" @@ -431,6 +414,10 @@ func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, res // listLearnedPrefixesCreateRequest creates the ListLearnedPrefixes request. func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, _ *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -439,26 +426,20 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginPacketCapture - Runs a packet capture on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to run packet capture on azure firewall. // - options - AzureFirewallsClientBeginPacketCaptureOptions contains the optional parameters for the AzureFirewallsClient.BeginPacketCapture @@ -470,8 +451,7 @@ func (client *AzureFirewallsClient) BeginPacketCapture(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -483,8 +463,6 @@ func (client *AzureFirewallsClient) BeginPacketCapture(ctx context.Context, reso // PacketCapture - Runs a packet capture on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) packetCapture(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters FirewallPacketCaptureParameters, options *AzureFirewallsClientBeginPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginPacketCapture" @@ -509,6 +487,10 @@ func (client *AzureFirewallsClient) packetCapture(ctx context.Context, resourceG // packetCaptureCreateRequest creates the PacketCapture request. func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters FirewallPacketCaptureParameters, _ *AzureFirewallsClientBeginPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -517,18 +499,14 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -537,10 +515,8 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte // BeginPacketCaptureOperation - Runs a packet capture operation on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - azureFirewallName - The name of the azure firewall. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to run packet capture on azure firewall. // - options - AzureFirewallsClientBeginPacketCaptureOperationOptions contains the optional parameters for the AzureFirewallsClient.BeginPacketCaptureOperation // method. @@ -551,8 +527,7 @@ func (client *AzureFirewallsClient) BeginPacketCaptureOperation(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientPacketCaptureOperationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -564,8 +539,6 @@ func (client *AzureFirewallsClient) BeginPacketCaptureOperation(ctx context.Cont // PacketCaptureOperation - Runs a packet capture operation on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) packetCaptureOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters FirewallPacketCaptureParameters, options *AzureFirewallsClientBeginPacketCaptureOperationOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginPacketCaptureOperation" @@ -590,6 +563,10 @@ func (client *AzureFirewallsClient) packetCaptureOperation(ctx context.Context, // packetCaptureOperationCreateRequest creates the PacketCaptureOperation request. func (client *AzureFirewallsClient) packetCaptureOperationCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters FirewallPacketCaptureParameters, _ *AzureFirewallsClientBeginPacketCaptureOperationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCaptureOperation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -598,18 +575,15 @@ func (client *AzureFirewallsClient) packetCaptureOperationCreateRequest(ctx cont return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -618,9 +592,7 @@ func (client *AzureFirewallsClient) packetCaptureOperationCreateRequest(ctx cont // BeginUpdateTags - Updates tags of an Azure Firewall resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to update azure firewall tags. // - options - AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags @@ -632,8 +604,7 @@ func (client *AzureFirewallsClient) BeginUpdateTags(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -645,8 +616,6 @@ func (client *AzureFirewallsClient) BeginUpdateTags(ctx context.Context, resourc // UpdateTags - Updates tags of an Azure Firewall resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *AzureFirewallsClient) updateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginUpdateTags" @@ -671,6 +640,10 @@ func (client *AzureFirewallsClient) updateTags(ctx context.Context, resourceGrou // updateTagsCreateRequest creates the UpdateTags request. func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, _ *AzureFirewallsClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -679,18 +652,15 @@ func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, return nil, errors.New("parameter azureFirewallName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go index 59421e9593b6..3e631f654f7e 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go @@ -1,915 +1,35 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallDelete.json -func ExampleAzureFirewallsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginDelete(ctx, "rg1", "azurefirewall", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallGet.json -func ExampleAzureFirewallsClient_Get_getAzureFirewall() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // AutoscaleConfiguration: &armnetwork.AzureFirewallAutoscaleConfiguration{ - // MaxCapacity: to.Ptr[int32](15), - // MinCapacity: to.Ptr[int32](10), - // }, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallGetWithAdditionalProperties.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithAdditionalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallGetWithIpGroups.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // { - // ChangeNumber: to.Ptr("5"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // }, - // { - // ChangeNumber: to.Ptr("4"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups2"), - // }, - // { - // ChangeNumber: to.Ptr("1"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups3"), - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups3")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallGetWithZones.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallGetWithMgmtSubnet.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithManagementSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - // }, - // }, - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPut.json +// Generated from example definition: 2025-07-01/AzureFirewallPut.json func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.AzureFirewallPropertiesFormat{ ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Name: to.Ptr("apprulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -923,31 +43,37 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, + }, + }, SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, + to.Ptr("www.test.com"), + }, + }, + }, }, - }}, + }, + }, IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ { Name: to.Ptr("azureFirewallIpConfiguration"), Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), }, }, - }}, + }, + }, NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Name: to.Ptr("natrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ Action: &armnetwork.AzureFirewallNatRCAction{ Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), @@ -958,13 +84,17 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { Name: to.Ptr("DNAT-HTTPS-traffic"), Description: to.Ptr("D-NAT all outbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("443")}, + to.Ptr("443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedAddress: to.Ptr("1.2.3.5"), TranslatedPort: to.Ptr("8443"), }, @@ -972,22 +102,28 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), Description: to.Ptr("D-NAT all inbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("80")}, + to.Ptr("80"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedFqdn: to.Ptr("internalhttpserver"), TranslatedPort: to.Ptr("880"), - }}, + }, + }, }, - }}, + }, + }, NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Name: to.Ptr("netrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -998,37 +134,50 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { Name: to.Ptr("L4-traffic"), Description: to.Ptr("Block traffic based on source IPs and ports"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, + to.Ptr("10.1.4.12-10.1.4.255"), + }, }, { Name: to.Ptr("L4-traffic-with-FQDN"), Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, + to.Ptr("www.amazon.com"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, + to.Ptr("10.2.4.12-10.2.4.255"), + }, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.AzureFirewallSKU{ Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), }, ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, Zones: []*string{}, }, nil) if err != nil { @@ -1036,183 +185,298 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), // }, // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPutWithAdditionalProperties.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAdditionalProperties() { +// Generated from example definition: 2025-07-01/AzureFirewallPutInHub.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallInVirtualHub() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ Location: to.Ptr("West US"), + Properties: &armnetwork.AzureFirewallPropertiesFormat{ + FirewallPolicy: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), + }, + HubIPAddresses: &armnetwork.HubIPAddresses{ + PublicIPs: &armnetwork.HubPublicIPAddresses{ + Addresses: []*armnetwork.AzureFirewallPublicIPAddress{}, + Count: to.Ptr[int32](1), + }, + }, + SKU: &armnetwork.AzureFirewallSKU{ + Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), + Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + }, + ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + VirtualHub: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + }, + }, Tags: map[string]*string{ "key1": to.Ptr("value1"), }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - AdditionalProperties: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - Name: to.Ptr("apprulecoll"), + Zones: []*string{}, + }, 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 poll 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 = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // FirewallPolicy: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), + // }, + // HubIPAddresses: &armnetwork.HubIPAddresses{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // PublicIPs: &armnetwork.HubPublicIPAddresses{ + // Addresses: []*armnetwork.AzureFirewallPublicIPAddress{ + // { + // Address: to.Ptr("13.73.240.12"), + // }, + // }, + // Count: to.Ptr[int32](1), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallPutWithAdditionalProperties.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAdditionalProperties() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ + Location: to.Ptr("West US"), + Properties: &armnetwork.AzureFirewallPropertiesFormat{ + AdditionalProperties: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + { + Name: to.Ptr("apprulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1226,32 +490,37 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAddi { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, + }, + }, SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, + to.Ptr("www.test.com"), + }, + }, + }, }, - }}, + }, + }, IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ { Name: to.Ptr("azureFirewallIpConfiguration"), Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), }, }, - }}, - IPGroups: []*armnetwork.AzureFirewallIPGroups{}, + }, + }, NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Name: to.Ptr("natrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ Action: &armnetwork.AzureFirewallNatRCAction{ Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), @@ -1262,13 +531,17 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAddi Name: to.Ptr("DNAT-HTTPS-traffic"), Description: to.Ptr("D-NAT all outbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("443")}, + to.Ptr("443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedAddress: to.Ptr("1.2.3.5"), TranslatedPort: to.Ptr("8443"), }, @@ -1276,22 +549,28 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAddi Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), Description: to.Ptr("D-NAT all inbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("80")}, + to.Ptr("80"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedFqdn: to.Ptr("internalhttpserver"), TranslatedPort: to.Ptr("880"), - }}, + }, + }, }, - }}, + }, + }, NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Name: to.Ptr("netrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1302,37 +581,50 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAddi Name: to.Ptr("L4-traffic"), Description: to.Ptr("Block traffic based on source IPs and ports"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, + to.Ptr("10.1.4.12-10.1.4.255"), + }, }, { Name: to.Ptr("L4-traffic-with-FQDN"), Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, + to.Ptr("www.amazon.com"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, + to.Ptr("10.2.4.12-10.2.4.255"), + }, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.AzureFirewallSKU{ Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), }, ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, Zones: []*string{}, }, nil) if err != nil { @@ -1340,179 +632,297 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAddi } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), // }, // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPutWithIpGroups.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGroups() { +// Generated from example definition: 2025-07-01/AzureFirewallPutWithAfcConfiguration.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAfcControlPlane() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ Location: to.Ptr("West US"), + Properties: &armnetwork.AzureFirewallPropertiesFormat{ + IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + { + Name: to.Ptr("azureFirewallIpConfiguration"), + Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + }, + Subnet: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + }, + }, + }, + }, + SKU: &armnetwork.AzureFirewallSKU{ + Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + }, + ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + }, Tags: map[string]*string{ "key1": to.Ptr("value1"), }, + Zones: []*string{}, + }, &armnetwork.AzureFirewallsClientBeginCreateOrUpdateOptions{ + CreateAfcControlPlane: to.Ptr(true)}) + 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 poll 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 = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // AfcConfiguration: &armnetwork.AfcConfiguration{ + // ServiceEndpoint: to.Ptr("5e73bbe79102451d968d1cac9b5dbd41.afc.azure.com"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallPutWithIpGroups.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIPGroups() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ + Location: to.Ptr("West US"), Properties: &armnetwork.AzureFirewallPropertiesFormat{ ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Name: to.Ptr("apprulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1526,31 +936,37 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGr { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, + }, + }, SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, + to.Ptr("www.test.com"), + }, + }, + }, }, - }}, + }, + }, IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ { Name: to.Ptr("azureFirewallIpConfiguration"), Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), }, }, - }}, + }, + }, NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Name: to.Ptr("natrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ Action: &armnetwork.AzureFirewallNatRCAction{ Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), @@ -1561,13 +977,17 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGr Name: to.Ptr("DNAT-HTTPS-traffic"), Description: to.Ptr("D-NAT all outbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("443")}, + to.Ptr("443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedAddress: to.Ptr("1.2.3.5"), TranslatedPort: to.Ptr("8443"), }, @@ -1575,22 +995,28 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGr Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), Description: to.Ptr("D-NAT all inbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("80")}, + to.Ptr("80"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedFqdn: to.Ptr("internalhttpserver"), TranslatedPort: to.Ptr("880"), - }}, + }, + }, }, - }}, + }, + }, NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Name: to.Ptr("netrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1601,37 +1027,50 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGr Name: to.Ptr("L4-traffic"), Description: to.Ptr("Block traffic based on source IPs and ports"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, + to.Ptr("10.1.4.12-10.1.4.255"), + }, }, { Name: to.Ptr("L4-traffic-with-FQDN"), Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, + to.Ptr("www.amazon.com"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, + to.Ptr("10.2.4.12-10.2.4.255"), + }, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.AzureFirewallSKU{ Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), }, ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, Zones: []*string{}, }, nil) if err != nil { @@ -1639,177 +1078,202 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGr } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), // }, // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPutWithZones.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZones() { +// Generated from example definition: 2025-07-01/AzureFirewallPutWithMgmtSubnet.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithManagementSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US 2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, + Location: to.Ptr("West US"), Properties: &armnetwork.AzureFirewallPropertiesFormat{ ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Name: to.Ptr("apprulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1823,31 +1287,48 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZone { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, + }, + }, SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, + to.Ptr("www.test.com"), + }, + }, + }, }, - }}, + }, + }, IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ { Name: to.Ptr("azureFirewallIpConfiguration"), Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), }, }, - }}, + }, + }, + ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ + Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + }, + Subnet: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + }, + }, + }, NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Name: to.Ptr("natrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ Action: &armnetwork.AzureFirewallNatRCAction{ Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), @@ -1858,13 +1339,17 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZone Name: to.Ptr("DNAT-HTTPS-traffic"), Description: to.Ptr("D-NAT all outbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("443")}, + to.Ptr("443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedAddress: to.Ptr("1.2.3.5"), TranslatedPort: to.Ptr("8443"), }, @@ -1872,22 +1357,28 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZone Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), Description: to.Ptr("D-NAT all inbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("80")}, + to.Ptr("80"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedFqdn: to.Ptr("internalhttpserver"), TranslatedPort: to.Ptr("880"), - }}, + }, + }, }, - }}, + }, + }, NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Name: to.Ptr("netrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -1898,222 +1389,253 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZone Name: to.Ptr("L4-traffic"), Description: to.Ptr("Block traffic based on source IPs and ports"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, + to.Ptr("10.1.4.12-10.1.4.255"), + }, }, { Name: to.Ptr("L4-traffic-with-FQDN"), Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, + to.Ptr("www.amazon.com"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, + to.Ptr("10.2.4.12-10.2.4.255"), + }, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.AzureFirewallSKU{ Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), }, ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + Zones: []*string{}, }, 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) + log.Fatalf("failed to poll 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), // }, // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPutWithMgmtSubnet.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithManagementSubnet() { +// Generated from example definition: 2025-07-01/AzureFirewallPutWithZones.json +func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, + Location: to.Ptr("West US 2"), Properties: &armnetwork.AzureFirewallPropertiesFormat{ ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Name: to.Ptr("apprulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -2127,42 +1649,37 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithMana { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, + }, + }, SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, + to.Ptr("www.test.com"), + }, + }, + }, }, - }}, + }, + }, IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ { Name: to.Ptr("azureFirewallIpConfiguration"), Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), }, }, - }}, - ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - }, }, }, NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Name: to.Ptr("natrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ Action: &armnetwork.AzureFirewallNatRCAction{ Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), @@ -2173,13 +1690,17 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithMana Name: to.Ptr("DNAT-HTTPS-traffic"), Description: to.Ptr("D-NAT all outbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("443")}, + to.Ptr("443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedAddress: to.Ptr("1.2.3.5"), TranslatedPort: to.Ptr("8443"), }, @@ -2187,22 +1708,28 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithMana Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), Description: to.Ptr("D-NAT all inbound web traffic for inspection"), DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, DestinationPorts: []*string{ - to.Ptr("80")}, + to.Ptr("80"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, TranslatedFqdn: to.Ptr("internalhttpserver"), TranslatedPort: to.Ptr("880"), - }}, + }, + }, }, - }}, + }, + }, NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Name: to.Ptr("netrulecoll"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ Action: &armnetwork.AzureFirewallRCAction{ Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), @@ -2213,332 +1740,1335 @@ func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithMana Name: to.Ptr("L4-traffic"), Description: to.Ptr("Block traffic based on source IPs and ports"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, + to.Ptr("10.1.4.12-10.1.4.255"), + }, }, { Name: to.Ptr("L4-traffic-with-FQDN"), Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, + to.Ptr("www.amazon.com"), + }, DestinationPorts: []*string{ to.Ptr("443-444"), - to.Ptr("8443")}, + to.Ptr("8443"), + }, Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, + to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + }, SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, + to.Ptr("10.2.4.12-10.2.4.255"), + }, + }, + }, }, - }}, + }, + }, SKU: &armnetwork.AzureFirewallSKU{ Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), }, ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), }, - Zones: []*string{}, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + Zones: []*string{ + to.Ptr("1"), + to.Ptr("2"), + to.Ptr("3"), + }, }, 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) + log.Fatalf("failed to poll 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 = armnetwork.AzureFirewallsClientCreateOrUpdateResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US 2"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, + // }, + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallDelete.json +func ExampleAzureFirewallsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAzureFirewallsClient().BeginDelete(ctx, "rg1", "azurefirewall", 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 poll 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 = armnetwork.AzureFirewallsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallGet.json +func ExampleAzureFirewallsClient_Get_getAzureFirewall() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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 = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // AutoscaleConfiguration: &armnetwork.AzureFirewallAutoscaleConfiguration{ + // MaxCapacity: to.Ptr[int32](15), + // MinCapacity: to.Ptr[int32](10), + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, + // }, + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallGetWithAdditionalProperties.json +func ExampleAzureFirewallsClient_Get_getAzureFirewallWithAdditionalProperties() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), + // res = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, + // }, + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallGetWithAfcConfiguration.json +func ExampleAzureFirewallsClient_Get_getAzureFirewallWithAfcControlPlane() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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 = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // AfcConfiguration: &armnetwork.AfcConfiguration{ + // ServiceEndpoint: to.Ptr("5e73bbe79102451d968d1cac9b5dbd41.afc.azure.com"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallGetWithIpGroups.json +func ExampleAzureFirewallsClient_Get_getAzureFirewallWithIPGroups() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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 = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // { + // ChangeNumber: to.Ptr("5"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // }, + // { + // ChangeNumber: to.Ptr("4"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups2"), + // }, + // { + // ChangeNumber: to.Ptr("1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups3"), + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), // }, // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups2"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups3"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPutInHub.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallInVirtualHub() { +// Generated from example definition: 2025-07-01/AzureFirewallGetWithMgmtSubnet.json +func ExampleAzureFirewallsClient_Get_getAzureFirewallWithManagementSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - FirewallPolicy: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), - }, - HubIPAddresses: &armnetwork.HubIPAddresses{ - PublicIPs: &armnetwork.HubPublicIPAddresses{ - Addresses: []*armnetwork.AzureFirewallPublicIPAddress{}, - Count: to.Ptr[int32](1), - }, - }, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - Zones: []*string{}, - }, nil) + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // FirewallPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), - // }, - // HubIPAddresses: &armnetwork.HubIPAddresses{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // PublicIPs: &armnetwork.HubPublicIPAddresses{ - // Addresses: []*armnetwork.AzureFirewallPublicIPAddress{ - // { - // Address: to.Ptr("13.73.240.12"), - // }}, - // Count: to.Ptr[int32](1), + // res = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ + // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + // }, + // }, // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, + // }, + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // Zones: []*string{ // }, // }, - // Zones: []*string{ - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallUpdateTags.json -func ExampleAzureFirewallsClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/AzureFirewallGetWithZones.json +func ExampleAzureFirewallsClient_Get_getAzureFirewallWithZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAzureFirewallsClient().BeginUpdateTags(ctx, "azfwtest", "fw1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", 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.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("fw1"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/azfwtest/providers/Microsoft.Network/azureFirewalls/fw1"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // res = armnetwork.AzureFirewallsClientGetResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US 2"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, + // }, + // }, + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, + // }, + // }, + // }, + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: &armnetwork.AzureFirewallSKU{ + // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), + // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallListByResourceGroup.json +// Generated from example definition: 2025-07-01/AzureFirewallListByResourceGroup.json func ExampleAzureFirewallsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2553,177 +3083,206 @@ func ExampleAzureFirewallsClient_NewListPager() { _ = 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.AzureFirewallListResult = armnetwork.AzureFirewallListResult{ - // Value: []*armnetwork.AzureFirewall{ - // { - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, + // page = armnetwork.AzureFirewallsClientListResponse{ + // AzureFirewallListResult: armnetwork.AzureFirewallListResult{ + // Value: []*armnetwork.AzureFirewall{ + // { + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, // }, // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, // }, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), // }, // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ + // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, // }, // }, // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallListBySubscription.json +// Generated from example definition: 2025-07-01/AzureFirewallListBySubscription.json func ExampleAzureFirewallsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2738,177 +3297,206 @@ func ExampleAzureFirewallsClient_NewListAllPager() { _ = 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.AzureFirewallListResult = armnetwork.AzureFirewallListResult{ - // Value: []*armnetwork.AzureFirewall{ - // { - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, + // page = armnetwork.AzureFirewallsClientListAllResponse{ + // AzureFirewallListResult: armnetwork.AzureFirewallListResult{ + // Value: []*armnetwork.AzureFirewall{ + // { + // Name: to.Ptr("azurefirewall"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // AdditionalProperties: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ + // { + // Name: to.Ptr("apprulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), + // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // Priority: to.Ptr[int32](110), + // Rules: []*armnetwork.AzureFirewallApplicationRule{ + // { + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), + // }, + // }, + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // TargetFqdns: []*string{ + // to.Ptr("www.test.com"), + // }, // }, // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, // }, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + // }, + // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ + // { + // Name: to.Ptr("azureFirewallIpConfiguration"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallIpConfiguration"), // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.0.0"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), // }, // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), + // }, + // }, + // }, + // }, + // IPGroups: []*armnetwork.AzureFirewallIPGroups{ + // }, + // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ + // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/ipConfigurations/azureFirewallMgmtIpConfiguration"), + // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), + // }, + // }, + // }, + // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ + // { + // Name: to.Ptr("natrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), + // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ + // Action: &armnetwork.AzureFirewallNatRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNatRule{ + // { + // Name: to.Ptr("DNAT-HTTPS-traffic"), + // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedAddress: to.Ptr("1.2.3.5"), + // TranslatedPort: to.Ptr("8443"), + // }, + // { + // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), + // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), + // DestinationAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("80"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("*"), + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("880"), + // }, // }, // }, // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), + // }, + // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ + // { + // Name: to.Ptr("netrulecoll"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), + // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ + // Action: &armnetwork.AzureFirewallRCAction{ + // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), + // }, + // Priority: to.Ptr[int32](112), + // Rules: []*armnetwork.AzureFirewallNetworkRule{ + // { + // Name: to.Ptr("L4-traffic"), + // Description: to.Ptr("Block traffic based on source IPs and ports"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("192.168.1.1-192.168.1.12"), + // to.Ptr("10.1.4.12-10.1.4.255"), + // }, + // }, + // { + // Name: to.Ptr("L4-traffic-with-FQDN"), + // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), + // DestinationFqdns: []*string{ + // to.Ptr("www.amazon.com"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("443-444"), + // to.Ptr("8443"), + // }, + // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ + // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP), + // }, + // SourceAddresses: []*string{ + // to.Ptr("10.2.4.12-10.2.4.255"), + // }, // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallListLearnedIPPrefixes.json +// Generated from example definition: 2025-07-01/AzureFirewallListLearnedIPPrefixes.json func ExampleAzureFirewallsClient_BeginListLearnedPrefixes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2918,26 +3506,29 @@ func ExampleAzureFirewallsClient_BeginListLearnedPrefixes() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.IPPrefixesList = armnetwork.IPPrefixesList{ - // IPPrefixes: []*string{ - // to.Ptr("10.101.0.0/16"), - // to.Ptr("10.102.0.0/16")}, - // } + // res = armnetwork.AzureFirewallsClientListLearnedPrefixesResponse{ + // IPPrefixesList: armnetwork.IPPrefixesList{ + // IPPrefixes: []*string{ + // to.Ptr("10.101.0.0/16"), + // to.Ptr("10.102.0.0/16"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPacketCapture.json +// Generated from example definition: 2025-07-01/AzureFirewallPacketCapture.json func ExampleAzureFirewallsClient_BeginPacketCapture() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2947,29 +3538,37 @@ func ExampleAzureFirewallsClient_BeginPacketCapture() { Filters: []*armnetwork.AzureFirewallPacketCaptureRule{ { DestinationPorts: []*string{ - to.Ptr("4500")}, + to.Ptr("4500"), + }, Destinations: []*string{ - to.Ptr("20.1.2.0")}, + to.Ptr("20.1.2.0"), + }, Sources: []*string{ - to.Ptr("20.1.1.0")}, + to.Ptr("20.1.1.0"), + }, }, { DestinationPorts: []*string{ to.Ptr("123"), - to.Ptr("80")}, + to.Ptr("80"), + }, Destinations: []*string{ - to.Ptr("10.1.2.0")}, + to.Ptr("10.1.2.0"), + }, Sources: []*string{ to.Ptr("10.1.1.0"), - to.Ptr("10.1.1.1")}, - }}, + to.Ptr("10.1.1.1"), + }, + }, + }, Flags: []*armnetwork.AzureFirewallPacketCaptureFlags{ { Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeSyn), }, { Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeFin), - }}, + }, + }, NumberOfPacketsToCapture: to.Ptr[int32](5000), SasURL: to.Ptr("someSASURL"), Protocol: to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolAny), @@ -2979,18 +3578,18 @@ func ExampleAzureFirewallsClient_BeginPacketCapture() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureFirewallPacketCaptureOperation.json +// Generated from example definition: 2025-07-01/AzureFirewallPacketCaptureOperation.json func ExampleAzureFirewallsClient_BeginPacketCaptureOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -3000,29 +3599,37 @@ func ExampleAzureFirewallsClient_BeginPacketCaptureOperation() { Filters: []*armnetwork.AzureFirewallPacketCaptureRule{ { DestinationPorts: []*string{ - to.Ptr("4500")}, + to.Ptr("4500"), + }, Destinations: []*string{ - to.Ptr("20.1.2.0")}, + to.Ptr("20.1.2.0"), + }, Sources: []*string{ - to.Ptr("20.1.1.0")}, + to.Ptr("20.1.1.0"), + }, }, { DestinationPorts: []*string{ to.Ptr("123"), - to.Ptr("80")}, + to.Ptr("80"), + }, Destinations: []*string{ - to.Ptr("10.1.2.0")}, + to.Ptr("10.1.2.0"), + }, Sources: []*string{ to.Ptr("10.1.1.0"), - to.Ptr("10.1.1.1")}, - }}, + to.Ptr("10.1.1.1"), + }, + }, + }, Flags: []*armnetwork.AzureFirewallPacketCaptureFlags{ { Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeSyn), }, { Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeFin), - }}, + }, + }, NumberOfPacketsToCapture: to.Ptr[int32](5000), Operation: to.Ptr(armnetwork.AzureFirewallPacketCaptureOperationTypeStatus), SasURL: to.Ptr("someSASURL"), @@ -3033,13 +3640,60 @@ func ExampleAzureFirewallsClient_BeginPacketCaptureOperation() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.AzureFirewallsClientPacketCaptureOperationResponse{ + // AzureFirewallPacketCaptureResponse: armnetwork.AzureFirewallPacketCaptureResponse{ + // Message: to.Ptr("Packet capture in progress. Please wait till it is finished or stop the current capture before starting another."), + // StatusCode: to.Ptr(armnetwork.AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureInProgress), + // }, + // } +} + +// Generated from example definition: 2025-07-01/AzureFirewallUpdateTags.json +func ExampleAzureFirewallsClient_BeginUpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAzureFirewallsClient().BeginUpdateTags(ctx, "azfwtest", "fw1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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 poll 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.AzureFirewallPacketCaptureResponse = armnetwork.AzureFirewallPacketCaptureResponse{ - // Message: to.Ptr("Packet capture in progress. Please wait till it is finished or stop the current capture before starting another."), - // StatusCode: to.Ptr(armnetwork.AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureInProgress), + // res = armnetwork.AzureFirewallsClientUpdateTagsResponse{ + // AzureFirewall: armnetwork.AzureFirewall{ + // Name: to.Ptr("fw1"), + // Type: to.Ptr("Microsoft.Network/azureFirewalls"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azfwtest/providers/Microsoft.Network/azureFirewalls/fw1"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.AzureFirewallPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go index 0724ef2b104f..3e094aa5c97a 100644 --- a/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go b/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go index 83799976ec0c..c01153a0f72f 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go index e3e27f757d02..ce0139f15e3e 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // BastionHostsClient contains the methods for the BastionHosts group. // Don't use this type directly, use NewBastionHostsClient() instead. +// +// Generated from API version 2025-07-01 type BastionHostsClient struct { internal *arm.Client subscriptionID string } // NewBastionHostsClient creates a new instance of BastionHostsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BastionHostsClient, error) { @@ -43,9 +43,7 @@ func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to the create or update Bastion Host operation. // - options - BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGr // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, _ *BastionHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceG // deleteCreateRequest creates the Delete request. func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, _ *BastionHostsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. func (client *BastionHostsClient) Get(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientGetOptions) (BastionHostsClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *BastionHostsClient) Get(ctx context.Context, resourceGroupName str // getCreateRequest creates the Get request. func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, _ *BastionHostsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resource return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,8 +252,6 @@ func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (Bastio } // NewListPager - Lists all Bastion Hosts in a subscription. -// -// Generated from API version 2025-05-01 // - options - BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.NewListPager method. func (client *BastionHostsClient) NewListPager(options *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListResponse]{ @@ -302,8 +288,8 @@ func (client *BastionHostsClient) listCreateRequest(ctx context.Context, _ *Bast return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -318,9 +304,7 @@ func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (Basti } // NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager // method. func (client *BastionHostsClient) NewListByResourceGroupPager(resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) *runtime.Pager[BastionHostsClientListByResourceGroupResponse] { @@ -349,21 +333,21 @@ func (client *BastionHostsClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *BastionHostsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -379,9 +363,7 @@ func (client *BastionHostsClient) listByResourceGroupHandleResponse(resp *http.R // BeginUpdateTags - Updates Tags for BastionHost resource // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to update BastionHost tags. // - options - BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags @@ -393,8 +375,7 @@ func (client *BastionHostsClient) BeginUpdateTags(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -406,8 +387,6 @@ func (client *BastionHostsClient) BeginUpdateTags(ctx context.Context, resourceG // UpdateTags - Updates Tags for BastionHost resource // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *BastionHostsClient) updateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginUpdateTags" @@ -449,9 +428,10 @@ func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go index ce9a10e10f93..381077b37d56 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go @@ -1,668 +1,632 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostDelete.json -func ExampleBastionHostsClient_BeginDelete_deleteBastionHost() { +// Generated from example definition: 2025-07-01/BastionHostDeveloperPut.json +func ExampleBastionHostsClient_BeginCreateOrUpdate_createDeveloperBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg1", "bastionhosttenant", nil) + poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg2", "bastionhostdeveloper", armnetwork.BastionHost{ + Properties: &armnetwork.BastionHostPropertiesFormat{ + IPConfigurations: []*armnetwork.BastionHostIPConfiguration{}, + NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ + IPRules: []*armnetwork.IPRule{ + { + AddressPrefix: to.Ptr("1.1.1.1/16"), + }, + }, + }, + VirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.BastionHostsClientCreateOrUpdateResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhostdeveloper"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // }, + // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ + // IPRules: []*armnetwork.IPRule{ + // { + // AddressPrefix: to.Ptr("1.1.1.1/16"), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostDeveloperDelete.json -func ExampleBastionHostsClient_BeginDelete_deleteDeveloperBastionHost() { +// Generated from example definition: 2025-07-01/BastionHostPut.json +func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg2", "bastionhostdeveloper", nil) + poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ + Properties: &armnetwork.BastionHostPropertiesFormat{ + IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + { + Name: to.Ptr("bastionHostIpConfiguration"), + Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + }, + Subnet: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + }, + }, + }, + }, + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostGet.json -func ExampleBastionHostsClient_Get_getBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant'", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhost'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientCreateOrUpdateResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhost"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostGetWithPrivateOnly.json -func ExampleBastionHostsClient_Get_getBastionHostWithPrivateOnly() { +// Generated from example definition: 2025-07-01/BastionHostPutWithPrivateOnly.json +func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithPrivateOnly() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", nil) + poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ + Properties: &armnetwork.BastionHostPropertiesFormat{ + EnablePrivateOnlyBastion: to.Ptr(true), + IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + { + Name: to.Ptr("bastionHostIpConfiguration"), + Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + Subnet: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + }, + }, + }, + }, + }, + }, 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 poll 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientCreateOrUpdateResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(true), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostGetWithZones.json -func ExampleBastionHostsClient_Get_getBastionHostWithZones() { +// Generated from example definition: 2025-07-01/BastionHostPutWithZones.json +func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", nil) + poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ + Properties: &armnetwork.BastionHostPropertiesFormat{ + IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + { + Name: to.Ptr("bastionHostIpConfiguration"), + Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + }, + Subnet: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + }, + }, + }, + }, + }, + }, 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 poll 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientCreateOrUpdateResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhost"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostDeveloperGet.json -func ExampleBastionHostsClient_Get_getDeveloperBastionHost() { +// Generated from example definition: 2025-07-01/BastionHostDelete.json +func ExampleBastionHostsClient_BeginDelete_deleteBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhostdeveloper'", nil) + poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg1", "bastionhosttenant", 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 poll 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhostdeveloper'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ - // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), - // }, + // res = armnetwork.BastionHostsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostPut.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHost() { +// Generated from example definition: 2025-07-01/BastionHostDeveloperDelete.json +func ExampleBastionHostsClient_BeginDelete_deleteDeveloperBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - { - Name: to.Ptr("bastionHostIpConfiguration"), - Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - }, - }, - }}, - }, - }, nil) + poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg2", "bastionhostdeveloper", 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) + log.Fatalf("failed to poll 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhost"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, + // res = armnetwork.BastionHostsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostPutWithPrivateOnly.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithPrivateOnly() { +// Generated from example definition: 2025-07-01/BastionHostDeveloperGet.json +func ExampleBastionHostsClient_Get_getDeveloperBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - EnablePrivateOnlyBastion: to.Ptr(true), - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - { - Name: to.Ptr("bastionHostIpConfiguration"), - Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - }, - }, - }}, - }, - }, nil) + res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhostdeveloper'", 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientGetResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhostdeveloper'"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // }, + // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ + // IPRules: []*armnetwork.IPRule{ + // { + // AddressPrefix: to.Ptr("1.1.1.1/16"), // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostPutWithZones.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithZones() { +// Generated from example definition: 2025-07-01/BastionHostGet.json +func ExampleBastionHostsClient_Get_getBastionHost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - { - Name: to.Ptr("bastionHostIpConfiguration"), - Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - }, - }, - }}, - }, - }, nil) + res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant'", 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhost"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientGetResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhost'"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostDeveloperPut.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createDeveloperBastionHost() { +// Generated from example definition: 2025-07-01/BastionHostGetWithPrivateOnly.json +func ExampleBastionHostsClient_Get_getBastionHostWithPrivateOnly() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg2", "bastionhostdeveloper", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{}, - NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - IPRules: []*armnetwork.IPRule{ - { - AddressPrefix: to.Ptr("1.1.1.1/16"), - }}, - }, - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - }, - }, nil) + res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhostdeveloper"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ + // res = armnetwork.BastionHostsClientGetResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(true), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ // }, - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostPatch.json -func ExampleBastionHostsClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/BastionHostGetWithZones.json +func ExampleBastionHostsClient_Get_getBastionHostWithZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewBastionHostsClient().BeginUpdateTags(ctx, "rg1", "bastionhosttenant", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", 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.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // res = armnetwork.BastionHostsClientGetResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostListBySubscription.json +// Generated from example definition: 2025-07-01/BastionHostListBySubscription.json func ExampleBastionHostsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -677,165 +641,172 @@ func ExampleBastionHostsClient_NewListPager() { _ = 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.BastionHostListResult = armnetwork.BastionHostListResult{ - // Value: []*armnetwork.BastionHost{ - // { - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AzureBastionSubnet"), + // page = armnetwork.BastionHostsClientListResponse{ + // BastionHostListResult: armnetwork.BastionHostListResult{ + // Value: []*armnetwork.BastionHost{ + // { + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AzureBastionSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ - // }, - // }, - // { - // Name: to.Ptr("bastionhostdeveloper"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ - // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // Zones: []*string{ // }, // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), - // }, - // }, - // { - // Name: to.Ptr("bastionhost3"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(true), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName3"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), + // { + // Name: to.Ptr("bastionhostdeveloper"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // }, + // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ + // IPRules: []*armnetwork.IPRule{ + // { + // AddressPrefix: to.Ptr("1.1.1.1/16"), // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), + // }, // }, - // }, - // { - // Name: to.Ptr("bastionhost4"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4/bastionHostIpConfigurations/IpConf"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet4/subnets/AzureBastionSubnet"), + // { + // Name: to.Ptr("bastionhost3"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(true), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName3"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // Zones: []*string{ + // }, // }, - // Zones: []*string{ + // { + // Name: to.Ptr("bastionhost4"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(true), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4/bastionHostIpConfigurations/IpConf"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet4/subnets/AzureBastionSubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // Zones: []*string{ + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionHostListByResourceGroup.json +// Generated from example definition: 2025-07-01/BastionHostListByResourceGroup.json func ExampleBastionHostsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -850,128 +821,209 @@ func ExampleBastionHostsClient_NewListByResourceGroupPager() { _ = 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.BastionHostListResult = armnetwork.BastionHostListResult{ - // Value: []*armnetwork.BastionHost{ - // { - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AzureBastionSubnet"), + // page = armnetwork.BastionHostsClientListByResourceGroupResponse{ + // BastionHostListResult: armnetwork.BastionHostListResult{ + // Value: []*armnetwork.BastionHost{ + // { + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AzureBastionSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // Zones: []*string{ + // }, // }, - // }, - // { - // Name: to.Ptr("bastionhost2"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(true), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2/bastionHostIpConfigurations/IpConf"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName2"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureBastionSubnet"), + // { + // Name: to.Ptr("bastionhost2"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(true), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2/bastionHostIpConfigurations/IpConf"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName2"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureBastionSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // Zones: []*string{ + // }, // }, - // }, - // { - // Name: to.Ptr("bastionhost3"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), + // { + // Name: to.Ptr("bastionhost3"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(true), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), + // }, + // Zones: []*string{ + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/BastionHostPatch.json +func ExampleBastionHostsClient_BeginUpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBastionHostsClient().BeginUpdateTags(ctx, "rg1", "bastionhosttenant", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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 poll 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 = armnetwork.BastionHostsClientUpdateTagsResponse{ + // BastionHost: armnetwork.BastionHost{ + // Name: to.Ptr("bastionhosttenant"), + // Type: to.Ptr("Microsoft.Network/bastionHosts"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.BastionHostPropertiesFormat{ + // DisableCopyPaste: to.Ptr(false), + // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), + // EnableIPConnect: to.Ptr(false), + // EnableKerberos: to.Ptr(false), + // EnablePrivateOnlyBastion: to.Ptr(false), + // EnableSessionRecording: to.Ptr(false), + // EnableShareableLink: to.Ptr(false), + // EnableTunneling: to.Ptr(false), + // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ + // { + // Name: to.Ptr("bastionHostIpConfiguration"), + // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), + // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ScaleUnits: to.Ptr[int32](2), + // }, + // SKU: &armnetwork.SKU{ + // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go index 772756205c3e..12c5d846153c 100644 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go +++ b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // BgpServiceCommunitiesClient contains the methods for the BgpServiceCommunities group. // Don't use this type directly, use NewBgpServiceCommunitiesClient() instead. +// +// Generated from API version 2025-07-01 type BgpServiceCommunitiesClient struct { internal *arm.Client subscriptionID string } // NewBgpServiceCommunitiesClient creates a new instance of BgpServiceCommunitiesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BgpServiceCommunitiesClient, error) { @@ -42,8 +42,6 @@ func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.Tok } // NewListPager - Gets all the available bgp service communities. -// -// Generated from API version 2025-05-01 // - options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager // method. func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { @@ -81,8 +79,8 @@ func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go index 90874fd185ec..c1680000ce3a 100644 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceCommunityList.json +// Generated from example definition: 2025-07-01/ServiceCommunityList.json func ExampleBgpServiceCommunitiesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,46 +33,53 @@ func ExampleBgpServiceCommunitiesClient_NewListPager() { _ = 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.BgpServiceCommunityListResult = armnetwork.BgpServiceCommunityListResult{ - // Value: []*armnetwork.BgpServiceCommunity{ - // { - // Name: to.Ptr("skype"), - // Type: to.Ptr("Microsoft.Network/bgpServiceCommunities"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/bgpServiceCommunities/skype"), - // Properties: &armnetwork.BgpServiceCommunityPropertiesFormat{ - // BgpCommunities: []*armnetwork.BGPCommunity{ - // { - // CommunityName: to.Ptr("Skype For Business Online"), - // CommunityPrefixes: []*string{ - // to.Ptr("13.67.56.225/32"), - // to.Ptr("13.67.186.105/32")}, + // page = armnetwork.BgpServiceCommunitiesClientListResponse{ + // BgpServiceCommunityListResult: armnetwork.BgpServiceCommunityListResult{ + // Value: []*armnetwork.BgpServiceCommunity{ + // { + // Name: to.Ptr("skype"), + // Type: to.Ptr("Microsoft.Network/bgpServiceCommunities"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/bgpServiceCommunities/skype"), + // Properties: &armnetwork.BgpServiceCommunityPropertiesFormat{ + // BgpCommunities: []*armnetwork.BGPCommunity{ + // { + // CommunityName: to.Ptr("Skype For Business Online"), + // CommunityPrefixes: []*string{ + // to.Ptr("13.67.56.225/32"), + // to.Ptr("13.67.186.105/32"), + // }, // CommunityValue: to.Ptr("12076:5030"), // IsAuthorizedToUse: to.Ptr(true), // ServiceGroup: to.Ptr("O365"), // ServiceSupportedRegion: to.Ptr("Global"), - // }}, + // }, + // }, // ServiceName: to.Ptr("skype"), // }, // }, // { // Name: to.Ptr("exchange"), // Type: to.Ptr("Microsoft.Network/bgpServiceCommunities"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/bgpServiceCommunities/exchange"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/bgpServiceCommunities/exchange"), // Properties: &armnetwork.BgpServiceCommunityPropertiesFormat{ // BgpCommunities: []*armnetwork.BGPCommunity{ // { // CommunityName: to.Ptr("Exchange Online"), // CommunityPrefixes: []*string{ // to.Ptr("13.67.56.225/32"), - // to.Ptr("13.67.186.105/32")}, - // CommunityValue: to.Ptr("12076:5040"), - // IsAuthorizedToUse: to.Ptr(true), - // ServiceGroup: to.Ptr("O365"), - // ServiceSupportedRegion: to.Ptr("Global"), - // }}, - // ServiceName: to.Ptr("exchange"), + // to.Ptr("13.67.186.105/32"), + // }, + // CommunityValue: to.Ptr("12076:5040"), + // IsAuthorizedToUse: to.Ptr(true), + // ServiceGroup: to.Ptr("O365"), + // ServiceSupportedRegion: to.Ptr("Global"), + // }, // }, - // }}, - // } + // ServiceName: to.Ptr("exchange"), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/build.go b/sdk/resourcemanager/network/armnetwork/build.go deleted file mode 100644 index 877f457fb90d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/network/armnetwork - -package armnetwork diff --git a/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go index 287740948d9b..5604efee2149 100644 --- a/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/client_factory.go b/sdk/resourcemanager/network/armnetwork/client_factory.go index 84200762d88b..c83a22ddd98a 100644 --- a/sdk/resourcemanager/network/armnetwork/client_factory.go +++ b/sdk/resourcemanager/network/armnetwork/client_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,8 +18,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -170,6 +168,14 @@ func (c *ClientFactory) NewBgpServiceCommunitiesClient() *BgpServiceCommunitiesC } } +// NewCommitsClient creates a new instance of CommitsClient. +func (c *ClientFactory) NewCommitsClient() *CommitsClient { + return &CommitsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewConfigurationPolicyGroupsClient creates a new instance of ConfigurationPolicyGroupsClient. func (c *ClientFactory) NewConfigurationPolicyGroupsClient() *ConfigurationPolicyGroupsClient { return &ConfigurationPolicyGroupsClient{ @@ -186,6 +192,14 @@ func (c *ClientFactory) NewConnectionMonitorsClient() *ConnectionMonitorsClient } } +// NewConnectionPoliciesClient creates a new instance of ConnectionPoliciesClient. +func (c *ClientFactory) NewConnectionPoliciesClient() *ConnectionPoliciesClient { + return &ConnectionPoliciesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewConnectivityConfigurationsClient creates a new instance of ConnectivityConfigurationsClient. func (c *ClientFactory) NewConnectivityConfigurationsClient() *ConnectivityConfigurationsClient { return &ConnectivityConfigurationsClient{ @@ -474,6 +488,14 @@ func (c *ClientFactory) NewInboundSecurityRuleClient() *InboundSecurityRuleClien } } +// NewInterconnectGroupsClient creates a new instance of InterconnectGroupsClient. +func (c *ClientFactory) NewInterconnectGroupsClient() *InterconnectGroupsClient { + return &InterconnectGroupsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewInterfaceIPConfigurationsClient creates a new instance of InterfaceIPConfigurationsClient. func (c *ClientFactory) NewInterfaceIPConfigurationsClient() *InterfaceIPConfigurationsClient { return &InterfaceIPConfigurationsClient{ @@ -1016,6 +1038,14 @@ func (c *ClientFactory) NewStaticMembersClient() *StaticMembersClient { } } +// NewSubgroupsClient creates a new instance of SubgroupsClient. +func (c *ClientFactory) NewSubgroupsClient() *SubgroupsClient { + return &SubgroupsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewSubnetsClient creates a new instance of SubnetsClient. func (c *ClientFactory) NewSubnetsClient() *SubnetsClient { return &SubnetsClient{ diff --git a/sdk/resourcemanager/network/armnetwork/commits_client.go b/sdk/resourcemanager/network/armnetwork/commits_client.go new file mode 100644 index 000000000000..5921436789d9 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/commits_client.go @@ -0,0 +1,335 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// CommitsClient contains the methods for the Commits group. +// Don't use this type directly, use NewCommitsClient() instead. +// +// Generated from API version 2025-07-01 +type CommitsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCommitsClient creates a new instance of CommitsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewCommitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommitsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CommitsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a commit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkManagerName - The name of the network manager. +// - commitName - The name of the commit. +// - resource - Parameters supplied to specify which commit to create +// - options - CommitsClientBeginCreateOrUpdateOptions contains the optional parameters for the CommitsClient.BeginCreateOrUpdate +// method. +func (client *CommitsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, resource Commit, options *CommitsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CommitsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkManagerName, commitName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates a commit. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *CommitsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, resource Commit, options *CommitsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "CommitsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, commitName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CommitsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, resource Commit, _ *CommitsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commits/{commitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if commitName == "" { + return nil, errors.New("parameter commitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitName}", url.PathEscape(commitName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a commit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkManagerName - The name of the network manager. +// - commitName - The name of the commit. +// - options - CommitsClientBeginDeleteOptions contains the optional parameters for the CommitsClient.BeginDelete method. +func (client *CommitsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *CommitsClientBeginDeleteOptions) (*runtime.Poller[CommitsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, commitName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a commit. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *CommitsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *CommitsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "CommitsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, commitName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CommitsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, _ *CommitsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commits/{commitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if commitName == "" { + return nil, errors.New("parameter commitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitName}", url.PathEscape(commitName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + return req, nil +} + +// Get - Gets the specified commit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkManagerName - The name of the network manager. +// - commitName - The name of the commit. +// - options - CommitsClientGetOptions contains the optional parameters for the CommitsClient.Get method. +func (client *CommitsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *CommitsClientGetOptions) (CommitsClientGetResponse, error) { + var err error + const operationName = "CommitsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, commitName, options) + if err != nil { + return CommitsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CommitsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CommitsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *CommitsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, _ *CommitsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commits/{commitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if commitName == "" { + return nil, errors.New("parameter commitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitName}", url.PathEscape(commitName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CommitsClient) getHandleResponse(resp *http.Response) (CommitsClientGetResponse, error) { + result := CommitsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Commit); err != nil { + return CommitsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all commits for the specified network manager. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkManagerName - The name of the network manager. +// - options - CommitsClientListOptions contains the optional parameters for the CommitsClient.NewListPager method. +func (client *CommitsClient) NewListPager(resourceGroupName string, networkManagerName string, options *CommitsClientListOptions) *runtime.Pager[CommitsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitsClientListResponse]{ + More: func(page CommitsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitsClientListResponse) (CommitsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) + }, nil) + if err != nil { + return CommitsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CommitsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *CommitsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commits" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CommitsClient) listHandleResponse(resp *http.Response) (CommitsClientListResponse, error) { + result := CommitsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitListResult); err != nil { + return CommitsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/commits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/commits_client_example_test.go new file mode 100644 index 000000000000..548b8bccb929 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/commits_client_example_test.go @@ -0,0 +1,213 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork_test + +import ( + "context" + "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/network/armnetwork/v10" + "log" +) + +// Generated from example definition: 2025-07-01/NetworkManagerCommitPut.json +func ExampleCommitsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewCommitsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "testNetworkManager", "myTestCommit", armnetwork.Commit{ + Properties: &armnetwork.CommitProperties{ + Description: to.Ptr("Sample Commit"), + TargetLocations: []*string{ + to.Ptr("useast"), + }, + ConfigurationIDs: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + }, + CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), + ForceUpdateTag: to.Ptr("00000000-0000-0000-0000-000000000000"), + }, + }, 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 poll 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 = armnetwork.CommitsClientCreateOrUpdateResponse{ + // Commit: armnetwork.Commit{ + // Name: to.Ptr("myTestCommit"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/commits/myTestCommit"), + // Type: to.Ptr("Microsoft.Network/networkManagers/commits"), + // SystemData: &armnetwork.SystemData{ + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // }, + // Properties: &armnetwork.CommitProperties{ + // Description: to.Ptr("Sample Commit"), + // TargetLocations: []*string{ + // to.Ptr("useast"), + // }, + // ActiveLocations: []*string{ + // to.Ptr("useast"), + // }, + // ConfigurationIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + // }, + // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), + // ForceUpdateTag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerCommitDelete.json +func ExampleCommitsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewCommitsClient().BeginDelete(ctx, "myResourceGroup", "testNetworkManager", "myTestCommit", 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 poll the result: %v", err) + } +} + +// Generated from example definition: 2025-07-01/NetworkManagerCommitGet.json +func ExampleCommitsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewCommitsClient().Get(ctx, "myResourceGroup", "testNetworkManager", "myTestCommit", 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 = armnetwork.CommitsClientGetResponse{ + // Commit: armnetwork.Commit{ + // Name: to.Ptr("myTestCommit"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/commits/myTestCommit"), + // Type: to.Ptr("Microsoft.Network/networkManagers/commits"), + // SystemData: &armnetwork.SystemData{ + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // }, + // Properties: &armnetwork.CommitProperties{ + // Description: to.Ptr("Sample Commit"), + // TargetLocations: []*string{ + // to.Ptr("useast"), + // }, + // ActiveLocations: []*string{ + // to.Ptr("useast"), + // }, + // ConfigurationIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + // }, + // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), + // ForceUpdateTag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerCommitList.json +func ExampleCommitsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCommitsClient().NewListPager("myResourceGroup", "testNetworkManager", 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 = armnetwork.CommitsClientListResponse{ + // CommitListResult: armnetwork.CommitListResult{ + // Value: []*armnetwork.Commit{ + // { + // Name: to.Ptr("myTestCommit"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/commits/myTestCommit"), + // Type: to.Ptr("Microsoft.Network/networkManagers/commits"), + // SystemData: &armnetwork.SystemData{ + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-11T18:52:27Z"); return t}()), + // }, + // Properties: &armnetwork.CommitProperties{ + // Description: to.Ptr("Sample Commit"), + // TargetLocations: []*string{ + // to.Ptr("useast"), + // }, + // ActiveLocations: []*string{ + // to.Ptr("useast"), + // }, + // ConfigurationIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + // }, + // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), + // ForceUpdateTag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // }, + // }, + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/commits?api-version=2025-07-01&$skipToken=10"), + // }, + // } + } +} diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go index 5d7084c4600d..f6d26533372c 100644 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ConfigurationPolicyGroupsClient contains the methods for the ConfigurationPolicyGroups group. // Don't use this type directly, use NewConfigurationPolicyGroupsClient() instead. +// +// Generated from API version 2025-07-01 type ConfigurationPolicyGroupsClient struct { internal *arm.Client subscriptionID string } // NewConfigurationPolicyGroupsClient creates a new instance of ConfigurationPolicyGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewConfigurationPolicyGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationPolicyGroupsClient, error) { @@ -43,11 +43,11 @@ func NewConfigurationPolicyGroupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration. -// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. +// - configurationPolicyGroupName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - vpnServerConfigurationPolicyGroupParameters - Parameters supplied to create or update a VpnServerConfiguration PolicyGroup. // - options - ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate // method. @@ -58,8 +58,7 @@ func (client *ConfigurationPolicyGroupsClient) BeginCreateOrUpdate(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +70,6 @@ func (client *ConfigurationPolicyGroupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConfigurationPolicyGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationPolicyGroupsClient.BeginCreateOrUpdate" @@ -118,9 +115,10 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters); err != nil { return nil, err } @@ -129,11 +127,11 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration. -// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. +// - configurationPolicyGroupName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete // method. func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*runtime.Poller[ConfigurationPolicyGroupsClientDeleteResponse], error) { @@ -143,8 +141,7 @@ func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +153,6 @@ func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, // Delete - Deletes a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConfigurationPolicyGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConfigurationPolicyGroupsClient.BeginDelete" @@ -203,19 +198,18 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration. -// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. +// - configurationPolicyGroupName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - ConfigurationPolicyGroupsClientGetOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.Get // method. func (client *ConfigurationPolicyGroupsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (ConfigurationPolicyGroupsClientGetResponse, error) { @@ -264,8 +258,8 @@ func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +274,9 @@ func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Resp } // NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager // method. func (client *ConfigurationPolicyGroupsClient) NewListByVPNServerConfigurationPager(resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) *runtime.Pager[ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse] { @@ -329,8 +322,8 @@ func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go index 8422acffe944..06c7ae572885 100644 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ConfigurationPolicyGroupPut.json +// Generated from example definition: 2025-07-01/ConfigurationPolicyGroupPut.json func ExampleConfigurationPolicyGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,7 +36,8 @@ func ExampleConfigurationPolicyGroupsClient_BeginCreateOrUpdate() { Name: to.Ptr("policy2"), AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), AttributeValue: to.Ptr("red.com"), - }}, + }, + }, Priority: to.Ptr[int32](0), }, }, nil) @@ -48,46 +46,50 @@ func ExampleConfigurationPolicyGroupsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VPNServerConfigurationPolicyGroup = armnetwork.VPNServerConfigurationPolicyGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), + // res = armnetwork.ConfigurationPolicyGroupsClientCreateOrUpdateResponse{ + // VPNServerConfigurationPolicyGroup: armnetwork.VPNServerConfigurationPolicyGroup{ + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ConfigurationPolicyGroupDelete.json +// Generated from example definition: 2025-07-01/ConfigurationPolicyGroupDelete.json func ExampleConfigurationPolicyGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -95,20 +97,25 @@ func ExampleConfigurationPolicyGroupsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ConfigurationPolicyGroupsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ConfigurationPolicyGroupGet.json +// Generated from example definition: 2025-07-01/ConfigurationPolicyGroupGet.json func ExampleConfigurationPolicyGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -119,42 +126,46 @@ func ExampleConfigurationPolicyGroupsClient_Get() { // 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.VPNServerConfigurationPolicyGroup = armnetwork.VPNServerConfigurationPolicyGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), + // res = armnetwork.ConfigurationPolicyGroupsClientGetResponse{ + // VPNServerConfigurationPolicyGroup: armnetwork.VPNServerConfigurationPolicyGroup{ + // Name: to.Ptr("policyGroup1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ConfigurationPolicyGroupListByVpnServerConfiguration.json +// Generated from example definition: 2025-07-01/ConfigurationPolicyGroupListByVpnServerConfiguration.json func ExampleConfigurationPolicyGroupsClient_NewListByVPNServerConfigurationPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -169,55 +180,61 @@ func ExampleConfigurationPolicyGroupsClient_NewListByVPNServerConfigurationPager _ = 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.ListVPNServerConfigurationPolicyGroupsResult = armnetwork.ListVPNServerConfigurationPolicyGroupsResult{ - // Value: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), + // page = armnetwork.ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{ + // ListVPNServerConfigurationPolicyGroupsResult: armnetwork.ListVPNServerConfigurationPolicyGroupsResult{ + // Value: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go index b3fe078294c9..7d80ab071fee 100644 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ConnectionMonitorsClient contains the methods for the ConnectionMonitors group. // Don't use this type directly, use NewConnectionMonitorsClient() instead. +// +// Generated from API version 2025-07-01 type ConnectionMonitorsClient struct { internal *arm.Client subscriptionID string } // NewConnectionMonitorsClient creates a new instance of ConnectionMonitorsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewConnectionMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionMonitorsClient, error) { @@ -43,10 +43,8 @@ func NewConnectionMonitorsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create or update a connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. // - parameters - Parameters that define the operation to create a connection monitor. // - options - ConnectionMonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorsClient.BeginCreateOrUpdate @@ -58,8 +56,7 @@ func (client *ConnectionMonitorsClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *ConnectionMonitorsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create or update a connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConnectionMonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *ConnectionMonitorsClient) createOrUpdate(ctx context.Context, reso // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,21 +108,18 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. return nil, errors.New("parameter connectionMonitorName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Migrate != nil { reqQP.Set("migrate", *options.Migrate) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -132,10 +128,8 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. // - options - ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete // method. @@ -146,8 +140,7 @@ func (client *ConnectionMonitorsClient) BeginDelete(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -159,8 +152,6 @@ func (client *ConnectionMonitorsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConnectionMonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginDelete" @@ -185,6 +176,10 @@ func (client *ConnectionMonitorsClient) deleteOperation(ctx context.Context, res // deleteCreateRequest creates the Delete request. func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, _ *ConnectionMonitorsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -197,27 +192,20 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter connectionMonitorName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a connection monitor by name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. // - options - ConnectionMonitorsClientGetOptions contains the optional parameters for the ConnectionMonitorsClient.Get method. func (client *ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientGetOptions) (ConnectionMonitorsClientGetResponse, error) { @@ -245,6 +233,10 @@ func (client *ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, _ *ConnectionMonitorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -257,17 +249,13 @@ func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, re return nil, errors.New("parameter connectionMonitorName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -282,30 +270,27 @@ func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists all connection monitors for the specified Network Watcher. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - options - ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.NewListPager // method. func (client *ConnectionMonitorsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) *runtime.Pager[ConnectionMonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectionMonitorsClientListResponse]{ More: func(page ConnectionMonitorsClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ConnectionMonitorsClientListResponse) (ConnectionMonitorsClientListResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ConnectionMonitorsClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return ConnectionMonitorsClientListResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + }, nil) if err != nil { return ConnectionMonitorsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectionMonitorsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -315,6 +300,10 @@ func (client *ConnectionMonitorsClient) NewListPager(resourceGroupName string, n // listCreateRequest creates the List request. func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, _ *ConnectionMonitorsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -323,17 +312,13 @@ func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, r return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -349,10 +334,8 @@ func (client *ConnectionMonitorsClient) listHandleResponse(resp *http.Response) // BeginStop - Stops the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. // - options - ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop // method. @@ -363,8 +346,7 @@ func (client *ConnectionMonitorsClient) BeginStop(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -376,8 +358,6 @@ func (client *ConnectionMonitorsClient) BeginStop(ctx context.Context, resourceG // Stop - Stops the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConnectionMonitorsClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginStop" @@ -402,6 +382,10 @@ func (client *ConnectionMonitorsClient) stop(ctx context.Context, resourceGroupN // stopCreateRequest creates the Stop request. func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, _ *ConnectionMonitorsClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -414,26 +398,19 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r return nil, errors.New("parameter connectionMonitorName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // UpdateTags - Update tags of the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. // - parameters - Parameters supplied to update connection monitor tags. @@ -464,6 +441,10 @@ func (client *ConnectionMonitorsClient) UpdateTags(ctx context.Context, resource // updateTagsCreateRequest creates the UpdateTags request. func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject, _ *ConnectionMonitorsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -476,18 +457,15 @@ func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Cont return nil, errors.New("parameter connectionMonitorName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go index e4af9fc6acdb..b9b0b78754c6 100644 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorCreate.json +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorCreate.json func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorV1() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,12 +29,13 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ { Name: to.Ptr("source"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), }, { Name: to.Ptr("destination"), Address: to.Ptr("bing.com"), - }}, + }, + }, TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ { Name: to.Ptr("tcp"), @@ -46,77 +44,90 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor }, TestFrequencySec: to.Ptr[int32](60), Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - }}, + }, + }, TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ { Name: to.Ptr("tg"), Destinations: []*string{ - to.Ptr("destination")}, + to.Ptr("destination"), + }, Sources: []*string{ - to.Ptr("source")}, + to.Ptr("source"), + }, TestConfigurations: []*string{ - to.Ptr("tcp")}, - }}, + to.Ptr("tcp"), + }, + }, + }, }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) + }, 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) + log.Fatalf("failed to poll 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.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + // res = armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse{ + // ConnectionMonitorResult: armnetwork.ConnectionMonitorResult{ + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("source"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + // }, + // { + // Name: to.Ptr("destination"), + // Address: to.Ptr("bing.com"), + // }, // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("tcp"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("tg"), + // Destinations: []*string{ + // to.Ptr("destination"), + // }, // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr("source"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("tcp"), + // }, // }, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorV2Create.json -func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorV2() { +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorCreateWithArcNetwork.json +func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorWithArcNetwork() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -125,28 +136,35 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ { Name: to.Ptr("vm1"), - ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - { - Name: to.Ptr("CanaryWorkspaceVamshi"), - Filter: &armnetwork.ConnectionMonitorEndpointFilter{ - Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), - Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ - { - Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), - Address: to.Ptr("npmuser"), - }}, - }, - ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), + Type: to.Ptr(armnetwork.EndpointTypeAzureVM), + ResourceID: to.Ptr("/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), }, { Name: to.Ptr("bing"), + Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), Address: to.Ptr("bing.com"), }, { Name: to.Ptr("google"), + Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), Address: to.Ptr("google.com"), - }}, + }, + { + Name: to.Ptr("ArcBasedNetwork"), + Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), + LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ + Region: to.Ptr("eastus"), + }, + Scope: &armnetwork.ConnectionMonitorEndpointScope{ + Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ + { + Address: to.Ptr("172.21.128.0/20"), + }, + }, + }, + SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), + }, + }, Outputs: []*armnetwork.ConnectionMonitorOutput{}, TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ { @@ -157,101 +175,117 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor }, TestFrequencySec: to.Ptr[int32](60), Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - }}, + }, + }, TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ { Name: to.Ptr("test1"), Destinations: []*string{ to.Ptr("bing"), - to.Ptr("google")}, + to.Ptr("google"), + }, Disable: to.Ptr(false), Sources: []*string{ to.Ptr("vm1"), - to.Ptr("CanaryWorkspaceVamshi")}, + to.Ptr("ArcBasedNetwork"), + }, TestConfigurations: []*string{ - to.Ptr("testConfig1")}, - }}, + to.Ptr("testConfig1"), + }, + }, + }, }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) + }, 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) + log.Fatalf("failed to poll 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.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("vm1"), - // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // { - // Name: to.Ptr("CanaryWorkspaceVamshi"), - // Filter: &armnetwork.ConnectionMonitorEndpointFilter{ - // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), - // Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ - // { - // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), - // Address: to.Ptr("npmuser"), - // }}, + // res = armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse{ + // ConnectionMonitorResult: armnetwork.ConnectionMonitorResult{ + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("vm1"), + // ResourceID: to.Ptr("/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), + // }, + // { + // Name: to.Ptr("ArcBasedNetwork"), + // Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), + // LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ + // Region: to.Ptr("eastus"), + // }, + // Scope: &armnetwork.ConnectionMonitorEndpointScope{ + // Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ + // { + // Address: to.Ptr("172.21.128.0/20"), + // }, + // }, + // }, + // SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), + // }, + // { + // Name: to.Ptr("bing"), + // Address: to.Ptr("bing.com"), + // }, + // { + // Name: to.Ptr("google"), + // Address: to.Ptr("google.com"), // }, - // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), // }, - // { - // Name: to.Ptr("bing"), - // Address: to.Ptr("bing.com"), + // Outputs: []*armnetwork.ConnectionMonitorOutput{ // }, - // { - // Name: to.Ptr("google"), - // Address: to.Ptr("google.com"), - // }}, - // Outputs: []*armnetwork.ConnectionMonitorOutput{ - // }, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("testConfig1"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // DisableTraceRoute: to.Ptr(false), - // Port: to.Ptr[int32](80), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("testConfig1"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // DisableTraceRoute: to.Ptr(false), + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("test1"), - // Destinations: []*string{ - // to.Ptr("bing"), - // to.Ptr("google")}, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("test1"), + // Destinations: []*string{ + // to.Ptr("bing"), + // to.Ptr("google"), + // }, // Disable: to.Ptr(false), // Sources: []*string{ // to.Ptr("vm1"), - // to.Ptr("CanaryWorkspaceVamshi")}, - // TestConfigurations: []*string{ - // to.Ptr("testConfig1")}, - // }}, + // to.Ptr("ArcBasedNetwork"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("testConfig1"), + // }, // }, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorCreateWithArcNetwork.json -func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorWithArcNetwork() { +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorV2Create.json +func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorV2() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -260,33 +294,30 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ { Name: to.Ptr("vm1"), - Type: to.Ptr(armnetwork.EndpointTypeAzureVM), - ResourceID: to.Ptr("/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), + ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), + }, + { + Name: to.Ptr("CanaryWorkspaceVamshi"), + Filter: &armnetwork.ConnectionMonitorEndpointFilter{ + Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), + Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ + { + Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), + Address: to.Ptr("npmuser"), + }, + }, + }, + ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), }, { Name: to.Ptr("bing"), - Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), Address: to.Ptr("bing.com"), }, { Name: to.Ptr("google"), - Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), Address: to.Ptr("google.com"), }, - { - Name: to.Ptr("ArcBasedNetwork"), - Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), - LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ - Region: to.Ptr("eastus"), - }, - Scope: &armnetwork.ConnectionMonitorEndpointScope{ - Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ - { - Address: to.Ptr("172.21.128.0/20"), - }}, - }, - SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), - }}, + }, Outputs: []*armnetwork.ConnectionMonitorOutput{}, TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ { @@ -297,161 +328,115 @@ func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitor }, TestFrequencySec: to.Ptr[int32](60), Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - }}, + }, + }, TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ { Name: to.Ptr("test1"), Destinations: []*string{ to.Ptr("bing"), - to.Ptr("google")}, + to.Ptr("google"), + }, Disable: to.Ptr(false), Sources: []*string{ to.Ptr("vm1"), - to.Ptr("ArcBasedNetwork")}, + to.Ptr("CanaryWorkspaceVamshi"), + }, TestConfigurations: []*string{ - to.Ptr("testConfig1")}, - }}, + to.Ptr("testConfig1"), + }, + }, + }, }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) + }, 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) + log.Fatalf("failed to poll 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.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("vm1"), - // ResourceID: to.Ptr("/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), - // }, - // { - // Name: to.Ptr("ArcBasedNetwork"), - // Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), - // LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ - // Region: to.Ptr("eastus"), + // res = armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse{ + // ConnectionMonitorResult: armnetwork.ConnectionMonitorResult{ + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("vm1"), + // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // { + // Name: to.Ptr("CanaryWorkspaceVamshi"), + // Filter: &armnetwork.ConnectionMonitorEndpointFilter{ + // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), + // Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ + // { + // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), + // Address: to.Ptr("npmuser"), + // }, + // }, + // }, + // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), // }, - // Scope: &armnetwork.ConnectionMonitorEndpointScope{ - // Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ - // { - // Address: to.Ptr("172.21.128.0/20"), - // }}, + // { + // Name: to.Ptr("bing"), + // Address: to.Ptr("bing.com"), + // }, + // { + // Name: to.Ptr("google"), + // Address: to.Ptr("google.com"), // }, - // SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), // }, - // { - // Name: to.Ptr("bing"), - // Address: to.Ptr("bing.com"), + // Outputs: []*armnetwork.ConnectionMonitorOutput{ // }, - // { - // Name: to.Ptr("google"), - // Address: to.Ptr("google.com"), - // }}, - // Outputs: []*armnetwork.ConnectionMonitorOutput{ - // }, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("testConfig1"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // DisableTraceRoute: to.Ptr(false), - // Port: to.Ptr[int32](80), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("testConfig1"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // DisableTraceRoute: to.Ptr(false), + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("test1"), - // Destinations: []*string{ - // to.Ptr("bing"), - // to.Ptr("google")}, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("test1"), + // Destinations: []*string{ + // to.Ptr("bing"), + // to.Ptr("google"), + // }, // Disable: to.Ptr(false), // Sources: []*string{ // to.Ptr("vm1"), - // to.Ptr("ArcBasedNetwork")}, - // TestConfigurations: []*string{ - // to.Ptr("testConfig1")}, - // }}, + // to.Ptr("CanaryWorkspaceVamshi"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("testConfig1"), + // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorGet.json -func ExampleConnectionMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectionMonitorsClient().Get(ctx, "rg1", "nw1", "cm1", 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.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorDelete.json +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorDelete.json func ExampleConnectionMonitorsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -461,90 +446,84 @@ func ExampleConnectionMonitorsClient_BeginDelete() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorUpdateTags.json -func ExampleConnectionMonitorsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorGet.json +func ExampleConnectionMonitorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewConnectionMonitorsClient().UpdateTags(ctx, "rg1", "nw1", "cm1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewConnectionMonitorsClient().Get(ctx, "rg1", "nw1", "cm1", 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.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/`/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // AutoStart: to.Ptr(true), - // Destination: &armnetwork.ConnectionMonitorDestination{ - // Address: to.Ptr("bing.com"), - // Port: to.Ptr[int32](80), - // }, - // MonitoringIntervalInSeconds: to.Ptr[int32](60), - // Source: &armnetwork.ConnectionMonitorSource{ - // Port: to.Ptr[int32](0), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // res = armnetwork.ConnectionMonitorsClientGetResponse{ + // ConnectionMonitorResult: armnetwork.ConnectionMonitorResult{ + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("source"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + // }, + // { + // Name: to.Ptr("destination"), + // Address: to.Ptr("bing.com"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("tcp"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), + // }, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("tg"), + // Destinations: []*string{ + // to.Ptr("destination"), + // }, + // Sources: []*string{ + // to.Ptr("source"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("tcp"), + // }, + // }, + // }, // }, - // MonitoringStatus: to.Ptr("Running"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T02:48:10.679Z"); return t}()), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorStop.json -func ExampleConnectionMonitorsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginStop(ctx, "rg1", "nw1", "cm1", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectionMonitorList.json +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorList.json func ExampleConnectionMonitorsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -559,84 +538,178 @@ func ExampleConnectionMonitorsClient_NewListPager() { _ = 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.ConnectionMonitorListResult = armnetwork.ConnectionMonitorListResult{ - // Value: []*armnetwork.ConnectionMonitorResult{ - // { - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + // page = armnetwork.ConnectionMonitorsClientListResponse{ + // ConnectionMonitorListResult: armnetwork.ConnectionMonitorListResult{ + // Value: []*armnetwork.ConnectionMonitorResult{ + // { + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("source"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + // }, + // { + // Name: to.Ptr("destination"), + // Address: to.Ptr("bing.com"), + // }, // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("tcp"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("tg"), + // Destinations: []*string{ + // to.Ptr("destination"), + // }, // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr("source"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("tcp"), + // }, // }, // }, - // { - // Name: to.Ptr("cm2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct2"), - // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("google.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + // }, + // }, + // { + // Name: to.Ptr("cm2"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ + // { + // Name: to.Ptr("source"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct2"), + // }, + // { + // Name: to.Ptr("destination"), + // Address: to.Ptr("google.com"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ + // { + // Name: to.Ptr("tcp"), + // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ + // Port: to.Ptr[int32](80), + // }, + // TestFrequencySec: to.Ptr[int32](60), + // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), + // }, + // }, + // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ + // { + // Name: to.Ptr("tg"), + // Destinations: []*string{ + // to.Ptr("destination"), + // }, + // Sources: []*string{ + // to.Ptr("source"), + // }, + // TestConfigurations: []*string{ + // to.Ptr("tcp"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorStop.json +func ExampleConnectionMonitorsClient_BeginStop() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConnectionMonitorsClient().BeginStop(ctx, "rg1", "nw1", "cm1", 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 poll 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 = armnetwork.ConnectionMonitorsClientStopResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NetworkWatcherConnectionMonitorUpdateTags.json +func ExampleConnectionMonitorsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewConnectionMonitorsClient().UpdateTags(ctx, "rg1", "nw1", "cm1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ConnectionMonitorsClientUpdateTagsResponse{ + // ConnectionMonitorResult: armnetwork.ConnectionMonitorResult{ + // Name: to.Ptr("cm1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/`/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.ConnectionMonitorResultProperties{ + // AutoStart: to.Ptr(true), + // Destination: &armnetwork.ConnectionMonitorDestination{ + // Address: to.Ptr("bing.com"), + // Port: to.Ptr[int32](80), + // }, + // MonitoringIntervalInSeconds: to.Ptr[int32](60), + // MonitoringStatus: to.Ptr("Running"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Source: &armnetwork.ConnectionMonitorSource{ + // Port: to.Ptr[int32](0), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T02:48:10.6797393Z"); return t}()), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/connectionpolicies_client.go b/sdk/resourcemanager/network/armnetwork/connectionpolicies_client.go new file mode 100644 index 000000000000..8177095d52d3 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/connectionpolicies_client.go @@ -0,0 +1,333 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ConnectionPoliciesClient contains the methods for the ConnectionPolicies group. +// Don't use this type directly, use NewConnectionPoliciesClient() instead. +// +// Generated from API version 2025-07-01 +type ConnectionPoliciesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConnectionPoliciesClient creates a new instance of ConnectionPoliciesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewConnectionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionPoliciesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConnectionPoliciesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a ConnectionPolicy if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - connectionPolicyName - The name of the ConnectionPolicy that is unique within a VirtualHub. This name can be used to access +// the resource. +// - resource - Parameters supplied to create or update a ConnectionPolicy. +// - options - ConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionPoliciesClient.BeginCreateOrUpdate +// method. +func (client *ConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, resource ConnectionPolicy, options *ConnectionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConnectionPoliciesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, connectionPolicyName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionPoliciesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectionPoliciesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates a ConnectionPolicy if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ConnectionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, resource ConnectionPolicy, options *ConnectionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ConnectionPoliciesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, connectionPolicyName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ConnectionPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, resource ConnectionPolicy, _ *ConnectionPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/connectionPolicies/{connectionPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionPolicyName == "" { + return nil, errors.New("parameter connectionPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionPolicyName}", url.PathEscape(connectionPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a ConnectionPolicy. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - connectionPolicyName - The name of the ConnectionPolicy that is unique within a VirtualHub. This name can be used to access +// the resource. +// - options - ConnectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ConnectionPoliciesClient.BeginDelete +// method. +func (client *ConnectionPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *ConnectionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ConnectionPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, connectionPolicyName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionPoliciesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectionPoliciesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a ConnectionPolicy. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ConnectionPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *ConnectionPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ConnectionPoliciesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, connectionPolicyName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConnectionPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, _ *ConnectionPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/connectionPolicies/{connectionPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionPolicyName == "" { + return nil, errors.New("parameter connectionPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionPolicyName}", url.PathEscape(connectionPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + return req, nil +} + +// Get - Retrieves the details of a ConnectionPolicy. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - connectionPolicyName - The name of the ConnectionPolicy that is unique within a VirtualHub. This name can be used to access +// the resource. +// - options - ConnectionPoliciesClientGetOptions contains the optional parameters for the ConnectionPoliciesClient.Get method. +func (client *ConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *ConnectionPoliciesClientGetOptions) (ConnectionPoliciesClientGetResponse, error) { + var err error + const operationName = "ConnectionPoliciesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, connectionPolicyName, options) + if err != nil { + return ConnectionPoliciesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectionPoliciesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConnectionPoliciesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ConnectionPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, _ *ConnectionPoliciesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/connectionPolicies/{connectionPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionPolicyName == "" { + return nil, errors.New("parameter connectionPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionPolicyName}", url.PathEscape(connectionPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ConnectionPoliciesClient) getHandleResponse(resp *http.Response) (ConnectionPoliciesClientGetResponse, error) { + result := ConnectionPoliciesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionPolicy); err != nil { + return ConnectionPoliciesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all ConnectionPolicies. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - options - ConnectionPoliciesClientListOptions contains the optional parameters for the ConnectionPoliciesClient.NewListPager +// method. +func (client *ConnectionPoliciesClient) NewListPager(resourceGroupName string, virtualHubName string, options *ConnectionPoliciesClientListOptions) *runtime.Pager[ConnectionPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConnectionPoliciesClientListResponse]{ + More: func(page ConnectionPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConnectionPoliciesClientListResponse) (ConnectionPoliciesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ConnectionPoliciesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + }, nil) + if err != nil { + return ConnectionPoliciesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ConnectionPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *ConnectionPoliciesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/connectionPolicies" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConnectionPoliciesClient) listHandleResponse(resp *http.Response) (ConnectionPoliciesClientListResponse, error) { + result := ConnectionPoliciesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListConnectionPoliciesResult); err != nil { + return ConnectionPoliciesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/connectionpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectionpolicies_client_example_test.go new file mode 100644 index 000000000000..976966340588 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/connectionpolicies_client_example_test.go @@ -0,0 +1,241 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork_test + +import ( + "context" + "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/network/armnetwork/v10" + "log" +) + +// Generated from example definition: 2025-07-01/ConnectionPolicyPut.json +func ExampleConnectionPoliciesClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConnectionPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "TestHub", "testpolicy2", armnetwork.ConnectionPolicy{ + Properties: &armnetwork.ConnectionPolicyProperties{ + RoutingConfiguration: &armnetwork.RoutingConfiguration{ + AssociatedRouteTable: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/hubRouteTables/defaultRouteTable"), + }, + InboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + }, + OutboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + }, + PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + Labels: []*string{ + to.Ptr("default"), + }, + }, + }, + EnableInternetSecurity: to.Ptr(true), + }, + }, 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 poll 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 = armnetwork.ConnectionPoliciesClientCreateOrUpdateResponse{ + // ConnectionPolicy: armnetwork.ConnectionPolicy{ + // Name: to.Ptr("testpolicy2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/connectionPolicies/testpolicy2"), + // Etag: to.Ptr("W/\"2b03e4fa-c9ed-403c-815f-d8bd6d40a37b\""), + // Properties: &armnetwork.ConnectionPolicyProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // EnableInternetSecurity: to.Ptr(true), + // AssociatedConnections: []*string{ + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/hubRouteTables/defaultRouteTable"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // Labels: []*string{ + // to.Ptr("default"), + // }, + // IDs: []*armnetwork.SubResource{ + // }, + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + // }, + // }, + // }, + // Type: to.Ptr("Microsoft.Network/virtualHubs/connectionPolicies"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/ConnectionPolicyDelete.json +func ExampleConnectionPoliciesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConnectionPoliciesClient().BeginDelete(ctx, "rg1", "TestHub", "testpolicy", 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 poll the result: %v", err) + } +} + +// Generated from example definition: 2025-07-01/ConnectionPolicyGet.json +func ExampleConnectionPoliciesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewConnectionPoliciesClient().Get(ctx, "rg1", "TestHub", "testpolicy", 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 = armnetwork.ConnectionPoliciesClientGetResponse{ + // ConnectionPolicy: armnetwork.ConnectionPolicy{ + // Name: to.Ptr("testpolicy"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/connectionPolicies/testpolicy"), + // Etag: to.Ptr("W/\"2b03e4fa-c9ed-403c-815f-d8bd6d40a37b\""), + // Properties: &armnetwork.ConnectionPolicyProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // EnableInternetSecurity: to.Ptr(true), + // AssociatedConnections: []*string{ + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/hubRouteTables/defaultRouteTable"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // Labels: []*string{ + // to.Ptr("default"), + // }, + // IDs: []*armnetwork.SubResource{ + // }, + // }, + // }, + // }, + // Type: to.Ptr("Microsoft.Network/virtualHubs/connectionPolicies"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/ConnectionPolicyList.json +func ExampleConnectionPoliciesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewConnectionPoliciesClient().NewListPager("rg1", "TestHub", 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 = armnetwork.ConnectionPoliciesClientListResponse{ + // ListConnectionPoliciesResult: armnetwork.ListConnectionPoliciesResult{ + // Value: []*armnetwork.ConnectionPolicy{ + // { + // Name: to.Ptr("testpolicy"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/connectionPolicies/testpolicy"), + // Etag: to.Ptr("W/\"2b03e4fa-c9ed-403c-815f-d8bd6d40a37b\""), + // Properties: &armnetwork.ConnectionPolicyProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // EnableInternetSecurity: to.Ptr(true), + // AssociatedConnections: []*string{ + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/hubRouteTables/defaultRouteTable"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // Labels: []*string{ + // to.Ptr("default"), + // }, + // IDs: []*armnetwork.SubResource{ + // }, + // }, + // }, + // }, + // Type: to.Ptr("Microsoft.Network/virtualHubs/connectionPolicies"), + // }, + // { + // Name: to.Ptr("testpolicy2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/connectionPolicies/testpolicy2"), + // Etag: to.Ptr("W/\"2b03e4fa-c9ed-403c-815f-d8bd6d40a37b\""), + // Properties: &armnetwork.ConnectionPolicyProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // EnableInternetSecurity: to.Ptr(true), + // AssociatedConnections: []*string{ + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/hubRouteTables/defaultRouteTable"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // Labels: []*string{ + // to.Ptr("default"), + // }, + // IDs: []*armnetwork.SubResource{ + // }, + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/TestHub/routeMaps/TestRouteMap"), + // }, + // }, + // }, + // Type: to.Ptr("Microsoft.Network/virtualHubs/connectionPolicies"), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go index d5e755a4030a..86a5db9bac21 100644 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ConnectivityConfigurationsClient contains the methods for the ConnectivityConfigurations group. // Don't use this type directly, use NewConnectivityConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type ConnectivityConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewConnectivityConfigurationsClient creates a new instance of ConnectivityConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewConnectivityConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectivityConfigurationsClient, error) { @@ -44,9 +44,7 @@ func NewConnectivityConfigurationsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates/Updates a new network manager connectivity configuration // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. // - connectivityConfiguration - Parameters supplied to create/update a network manager connectivity configuration @@ -98,9 +96,10 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectivityConfiguration); err != nil { return nil, err } @@ -119,9 +118,7 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, // and connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. // - options - ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete @@ -133,8 +130,7 @@ func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectivityConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -147,8 +143,6 @@ func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, // Delete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and // connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ConnectivityConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectivityConfigurationsClient.BeginDelete" @@ -194,21 +188,18 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and connectivity // Configuration name // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. // - options - ConnectivityConfigurationsClientGetOptions contains the optional parameters for the ConnectivityConfigurationsClient.Get @@ -259,8 +250,8 @@ func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -275,9 +266,7 @@ func (client *ConnectivityConfigurationsClient) getHandleResponse(resp *http.Res } // NewListPager - Lists all the network manager connectivity configuration in a specified network manager. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.NewListPager // method. @@ -330,8 +319,8 @@ func (client *ConnectivityConfigurationsClient) listCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go index f78a883fbf99..f67d72b527b4 100644 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go @@ -1,86 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectivityConfigurationGet.json -func ExampleConnectivityConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectivityConfigurationsClient().Get(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", 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.ConnectivityConfiguration = armnetwork.ConnectivityConfiguration{ - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ - // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), - // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), - // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), - // }, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectivityConfigurationPut.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectivityConfigurationPut.json func ExampleConnectivityConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -93,7 +32,8 @@ func ExampleConnectivityConfigurationsClient_CreateOrUpdate() { IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - }}, + }, + }, ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), @@ -105,7 +45,8 @@ func ExampleConnectivityConfigurationsClient_CreateOrUpdate() { { ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - }}, + }, + }, IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), }, }, nil) @@ -115,81 +56,151 @@ func ExampleConnectivityConfigurationsClient_CreateOrUpdate() { // 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.ConnectivityConfiguration = armnetwork.ConnectivityConfiguration{ - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Connectivity Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ - // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), - // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), - // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // res = armnetwork.ConnectivityConfigurationsClientCreateOrUpdateResponse{ + // ConnectivityConfiguration: armnetwork.ConnectivityConfiguration{ + // Name: to.Ptr("myTestConnectivityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), + // Properties: &armnetwork.ConnectivityConfigurationProperties{ + // Description: to.Ptr("Sample Connectivity Configuration"), + // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // { + // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), + // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), + // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), + // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), + // }, + // }, + // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ + // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), + // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), + // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // }, + // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), + // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), + // Hubs: []*armnetwork.Hub{ + // { + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), + // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), + // }, + // }, + // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectivityConfigurationDelete.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectivityConfigurationDelete.json func ExampleConnectivityConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConnectivityConfigurationsClient().BeginDelete(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", &armnetwork.ConnectivityConfigurationsClientBeginDeleteOptions{Force: to.Ptr(false)}) + poller, err := clientFactory.NewConnectivityConfigurationsClient().BeginDelete(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", &armnetwork.ConnectivityConfigurationsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ConnectivityConfigurationsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerConnectivityConfigurationGet.json +func ExampleConnectivityConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewConnectivityConfigurationsClient().Get(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", 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 = armnetwork.ConnectivityConfigurationsClientGetResponse{ + // ConnectivityConfiguration: armnetwork.ConnectivityConfiguration{ + // Name: to.Ptr("myTestConnectivityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), + // Properties: &armnetwork.ConnectivityConfigurationProperties{ + // Description: to.Ptr("Sample Configuration"), + // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // { + // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), + // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), + // }, + // }, + // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ + // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), + // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), + // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // }, + // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), + // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), + // Hubs: []*armnetwork.Hub{ + // { + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), + // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), + // }, + // }, + // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectivityConfigurationList.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectivityConfigurationList.json func ExampleConnectivityConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConnectivityConfigurationsClient().NewListPager("myResourceGroup", "testNetworkManager", &armnetwork.ConnectivityConfigurationsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewConnectivityConfigurationsClient().NewListPager("myResourceGroup", "testNetworkManager", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -200,46 +211,52 @@ func ExampleConnectivityConfigurationsClient_NewListPager() { _ = 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.ConnectivityConfigurationListResult = armnetwork.ConnectivityConfigurationListResult{ - // Value: []*armnetwork.ConnectivityConfiguration{ - // { - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscription/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/netwrokGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ - // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), - // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), - // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // page = armnetwork.ConnectivityConfigurationsClientListResponse{ + // ConnectivityConfigurationListResult: armnetwork.ConnectivityConfigurationListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/managedNetworks/testNetworkManager/connectivityConfigurations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ConnectivityConfiguration{ + // { + // Name: to.Ptr("myTestConnectivityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), + // ID: to.Ptr("subscription/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), + // Properties: &armnetwork.ConnectivityConfigurationProperties{ + // Description: to.Ptr("Sample Configuration"), + // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // { + // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), + // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), + // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/netwrokGroups/group1"), + // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), + // }, + // }, + // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ + // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), + // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), + // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // }, + // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), + // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), + // Hubs: []*armnetwork.Hub{ + // { + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), + // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), + // }, + // }, + // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/constants.go b/sdk/resourcemanager/network/armnetwork/constants.go index 594aa21f98e8..b2fc0b713003 100644 --- a/sdk/resourcemanager/network/armnetwork/constants.go +++ b/sdk/resourcemanager/network/armnetwork/constants.go @@ -1,16 +1,22 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork +const ( + version20181001 string = "2018-10-01" + version20250701 string = "2025-07-01" +) + // Access - Access to be allowed or denied. type Access string const ( + // AccessAllow - Allow AccessAllow Access = "Allow" - AccessDeny Access = "Deny" + // AccessDeny - Deny + AccessDeny Access = "Deny" ) // PossibleAccessValues returns the possible values for the Access const type. @@ -43,7 +49,9 @@ func PossibleAccessModeValues() []AccessMode { type AccessRuleDirection string const ( - AccessRuleDirectionInbound AccessRuleDirection = "Inbound" + // AccessRuleDirectionInbound - Inbound + AccessRuleDirectionInbound AccessRuleDirection = "Inbound" + // AccessRuleDirectionOutbound - Outbound AccessRuleDirectionOutbound AccessRuleDirection = "Outbound" ) @@ -59,12 +67,18 @@ func PossibleAccessRuleDirectionValues() []AccessRuleDirection { type ActionType string const ( - ActionTypeAllow ActionType = "Allow" + // ActionTypeAllow - Allow + ActionTypeAllow ActionType = "Allow" + // ActionTypeAnomalyScoring - AnomalyScoring ActionTypeAnomalyScoring ActionType = "AnomalyScoring" - ActionTypeBlock ActionType = "Block" - ActionTypeCAPTCHA ActionType = "CAPTCHA" - ActionTypeJSChallenge ActionType = "JSChallenge" - ActionTypeLog ActionType = "Log" + // ActionTypeBlock - Block + ActionTypeBlock ActionType = "Block" + // ActionTypeCAPTCHA - CAPTCHA + ActionTypeCAPTCHA ActionType = "CAPTCHA" + // ActionTypeJSChallenge - JSChallenge + ActionTypeJSChallenge ActionType = "JSChallenge" + // ActionTypeLog - Log + ActionTypeLog ActionType = "Log" ) // PossibleActionTypeValues returns the possible values for the ActionType const type. @@ -83,9 +97,12 @@ func PossibleActionTypeValues() []ActionType { type AddressPrefixType string const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" + // AddressPrefixTypeIPPrefix - IPPrefix + AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" + // AddressPrefixTypeNetworkGroup - NetworkGroup AddressPrefixTypeNetworkGroup AddressPrefixType = "NetworkGroup" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" + // AddressPrefixTypeServiceTag - ServiceTag + AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" ) // PossibleAddressPrefixTypeValues returns the possible values for the AddressPrefixType const type. @@ -102,8 +119,10 @@ func PossibleAddressPrefixTypeValues() []AddressPrefixType { type AddressSpaceAggregationOption string const ( + // AddressSpaceAggregationOptionManual - Manual AddressSpaceAggregationOptionManual AddressSpaceAggregationOption = "Manual" - AddressSpaceAggregationOptionNone AddressSpaceAggregationOption = "None" + // AddressSpaceAggregationOptionNone - None + AddressSpaceAggregationOptionNone AddressSpaceAggregationOption = "None" ) // PossibleAddressSpaceAggregationOptionValues returns the possible values for the AddressSpaceAggregationOption const type. @@ -116,13 +135,15 @@ func PossibleAddressSpaceAggregationOptionValues() []AddressSpaceAggregationOpti // AddressUpdateAction - Specifies the type of update operation to perform on addresses within the address location of service // gateway. -// * FullUpdate: Replaces all existing address data with the new list provided in the request. Any previously defined addresses +// - FullUpdate: Replaces all existing address data with the new list provided in the request. Any previously defined addresses // not included will be removed. -// * PartialUpdate: Updates only the specified addresses. +// - PartialUpdate: Updates only the specified addresses. type AddressUpdateAction string const ( - AddressUpdateActionFullUpdate AddressUpdateAction = "FullUpdate" + // AddressUpdateActionFullUpdate - FullUpdate + AddressUpdateActionFullUpdate AddressUpdateAction = "FullUpdate" + // AddressUpdateActionPartialUpdate - PartialUpdate AddressUpdateActionPartialUpdate AddressUpdateAction = "PartialUpdate" ) @@ -138,7 +159,9 @@ func PossibleAddressUpdateActionValues() []AddressUpdateAction { type AdminRuleKind string const ( - AdminRuleKindCustom AdminRuleKind = "Custom" + // AdminRuleKindCustom - Custom + AdminRuleKindCustom AdminRuleKind = "Custom" + // AdminRuleKindDefault - Default AdminRuleKindDefault AdminRuleKind = "Default" ) @@ -155,8 +178,10 @@ func PossibleAdminRuleKindValues() []AdminRuleKind { type AdminState string const ( + // AdminStateDisabled - Disabled AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" + // AdminStateEnabled - Enabled + AdminStateEnabled AdminState = "Enabled" ) // PossibleAdminStateValues returns the possible values for the AdminState const type. @@ -172,16 +197,26 @@ func PossibleAdminStateValues() []AdminState { type AdvertisedPublicPrefixPropertiesValidationState string const ( - AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "AsnValidationFailed" + // AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed - AsnValidationFailed + AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "AsnValidationFailed" + // AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry - CertificateMissingInRoutingRegistry AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry AdvertisedPublicPrefixPropertiesValidationState = "CertificateMissingInRoutingRegistry" - AdvertisedPublicPrefixPropertiesValidationStateConfigured AdvertisedPublicPrefixPropertiesValidationState = "Configured" - AdvertisedPublicPrefixPropertiesValidationStateConfiguring AdvertisedPublicPrefixPropertiesValidationState = "Configuring" - AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding AdvertisedPublicPrefixPropertiesValidationState = "InvalidSignatureEncoding" - AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ManualValidationNeeded" - AdvertisedPublicPrefixPropertiesValidationStateNotConfigured AdvertisedPublicPrefixPropertiesValidationState = "NotConfigured" - AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed AdvertisedPublicPrefixPropertiesValidationState = "SignatureVerificationFailed" - AdvertisedPublicPrefixPropertiesValidationStateValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "ValidationFailed" - AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ValidationNeeded" + // AdvertisedPublicPrefixPropertiesValidationStateConfigured - Configured + AdvertisedPublicPrefixPropertiesValidationStateConfigured AdvertisedPublicPrefixPropertiesValidationState = "Configured" + // AdvertisedPublicPrefixPropertiesValidationStateConfiguring - Configuring + AdvertisedPublicPrefixPropertiesValidationStateConfiguring AdvertisedPublicPrefixPropertiesValidationState = "Configuring" + // AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding - InvalidSignatureEncoding + AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding AdvertisedPublicPrefixPropertiesValidationState = "InvalidSignatureEncoding" + // AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded - ManualValidationNeeded + AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ManualValidationNeeded" + // AdvertisedPublicPrefixPropertiesValidationStateNotConfigured - NotConfigured + AdvertisedPublicPrefixPropertiesValidationStateNotConfigured AdvertisedPublicPrefixPropertiesValidationState = "NotConfigured" + // AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed - SignatureVerificationFailed + AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed AdvertisedPublicPrefixPropertiesValidationState = "SignatureVerificationFailed" + // AdvertisedPublicPrefixPropertiesValidationStateValidationFailed - ValidationFailed + AdvertisedPublicPrefixPropertiesValidationStateValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "ValidationFailed" + // AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded - ValidationNeeded + AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ValidationNeeded" ) // PossibleAdvertisedPublicPrefixPropertiesValidationStateValues returns the possible values for the AdvertisedPublicPrefixPropertiesValidationState const type. @@ -204,11 +239,16 @@ func PossibleAdvertisedPublicPrefixPropertiesValidationStateValues() []Advertise type ApplicationGatewayBackendHealthServerHealth string const ( - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" + // ApplicationGatewayBackendHealthServerHealthDown - Down + ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" + // ApplicationGatewayBackendHealthServerHealthDraining - Draining ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" + // ApplicationGatewayBackendHealthServerHealthPartial - Partial + ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" + // ApplicationGatewayBackendHealthServerHealthUnknown - Unknown + ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // ApplicationGatewayBackendHealthServerHealthUp - Up + ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" ) // PossibleApplicationGatewayBackendHealthServerHealthValues returns the possible values for the ApplicationGatewayBackendHealthServerHealth const type. @@ -226,8 +266,10 @@ func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGa type ApplicationGatewayClientAuthVerificationModes string const ( + // ApplicationGatewayClientAuthVerificationModesPassthrough - Passthrough ApplicationGatewayClientAuthVerificationModesPassthrough ApplicationGatewayClientAuthVerificationModes = "Passthrough" - ApplicationGatewayClientAuthVerificationModesStrict ApplicationGatewayClientAuthVerificationModes = "Strict" + // ApplicationGatewayClientAuthVerificationModesStrict - Strict + ApplicationGatewayClientAuthVerificationModesStrict ApplicationGatewayClientAuthVerificationModes = "Strict" ) // PossibleApplicationGatewayClientAuthVerificationModesValues returns the possible values for the ApplicationGatewayClientAuthVerificationModes const type. @@ -242,7 +284,9 @@ func PossibleApplicationGatewayClientAuthVerificationModesValues() []Application type ApplicationGatewayClientRevocationOptions string const ( + // ApplicationGatewayClientRevocationOptionsNone - None ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" + // ApplicationGatewayClientRevocationOptionsOCSP - OCSP ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" ) @@ -258,8 +302,10 @@ func PossibleApplicationGatewayClientRevocationOptionsValues() []ApplicationGate type ApplicationGatewayCookieBasedAffinity string const ( + // ApplicationGatewayCookieBasedAffinityDisabled - Disabled ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" + // ApplicationGatewayCookieBasedAffinityEnabled - Enabled + ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) // PossibleApplicationGatewayCookieBasedAffinityValues returns the possible values for the ApplicationGatewayCookieBasedAffinity const type. @@ -274,14 +320,23 @@ func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayC type ApplicationGatewayCustomErrorStatusCode string const ( + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus400 - HttpStatus400 ApplicationGatewayCustomErrorStatusCodeHTTPStatus400 ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 - HttpStatus403 ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus404 - HttpStatus404 ApplicationGatewayCustomErrorStatusCodeHTTPStatus404 ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus405 - HttpStatus405 ApplicationGatewayCustomErrorStatusCodeHTTPStatus405 ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus408 - HttpStatus408 ApplicationGatewayCustomErrorStatusCodeHTTPStatus408 ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus500 - HttpStatus500 ApplicationGatewayCustomErrorStatusCodeHTTPStatus500 ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 - HttpStatus502 ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus503 - HttpStatus503 ApplicationGatewayCustomErrorStatusCodeHTTPStatus503 ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus504 - HttpStatus504 ApplicationGatewayCustomErrorStatusCodeHTTPStatus504 ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" ) @@ -304,7 +359,9 @@ func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewa type ApplicationGatewayFirewallMode string const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + // ApplicationGatewayFirewallModeDetection - Detection + ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + // ApplicationGatewayFirewallModePrevention - Prevention ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" ) @@ -321,8 +378,10 @@ func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewall type ApplicationGatewayFirewallRateLimitDuration string const ( + // ApplicationGatewayFirewallRateLimitDurationFiveMins - FiveMins ApplicationGatewayFirewallRateLimitDurationFiveMins ApplicationGatewayFirewallRateLimitDuration = "FiveMins" - ApplicationGatewayFirewallRateLimitDurationOneMin ApplicationGatewayFirewallRateLimitDuration = "OneMin" + // ApplicationGatewayFirewallRateLimitDurationOneMin - OneMin + ApplicationGatewayFirewallRateLimitDurationOneMin ApplicationGatewayFirewallRateLimitDuration = "OneMin" ) // PossibleApplicationGatewayFirewallRateLimitDurationValues returns the possible values for the ApplicationGatewayFirewallRateLimitDuration const type. @@ -337,11 +396,16 @@ func PossibleApplicationGatewayFirewallRateLimitDurationValues() []ApplicationGa type ApplicationGatewayFirewallUserSessionVariable string const ( - ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" - ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader ApplicationGatewayFirewallUserSessionVariable = "ClientAddrXFFHeader" - ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" + // ApplicationGatewayFirewallUserSessionVariableClientAddr - ClientAddr + ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" + // ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader - ClientAddrXFFHeader + ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader ApplicationGatewayFirewallUserSessionVariable = "ClientAddrXFFHeader" + // ApplicationGatewayFirewallUserSessionVariableGeoLocation - GeoLocation + ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" + // ApplicationGatewayFirewallUserSessionVariableGeoLocationXFFHeader - GeoLocationXFFHeader ApplicationGatewayFirewallUserSessionVariableGeoLocationXFFHeader ApplicationGatewayFirewallUserSessionVariable = "GeoLocationXFFHeader" - ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" + // ApplicationGatewayFirewallUserSessionVariableNone - None + ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" ) // PossibleApplicationGatewayFirewallUserSessionVariableValues returns the possible values for the ApplicationGatewayFirewallUserSessionVariable const type. @@ -359,9 +423,12 @@ func PossibleApplicationGatewayFirewallUserSessionVariableValues() []Application type ApplicationGatewayLoadDistributionAlgorithm string const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + // ApplicationGatewayLoadDistributionAlgorithmIPHash - IpHash + ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + // ApplicationGatewayLoadDistributionAlgorithmLeastConnections - LeastConnections ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" + // ApplicationGatewayLoadDistributionAlgorithmRoundRobin - RoundRobin + ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" ) // PossibleApplicationGatewayLoadDistributionAlgorithmValues returns the possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. @@ -377,9 +444,13 @@ func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGa type ApplicationGatewayOperationalState string const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + // ApplicationGatewayOperationalStateRunning - Running + ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + // ApplicationGatewayOperationalStateStarting - Starting ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + // ApplicationGatewayOperationalStateStopped - Stopped + ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + // ApplicationGatewayOperationalStateStopping - Stopping ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" ) @@ -421,9 +492,13 @@ func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { type ApplicationGatewayRedirectType string const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + // ApplicationGatewayRedirectTypeFound - Found + ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + // ApplicationGatewayRedirectTypePermanent - Permanent ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + // ApplicationGatewayRedirectTypeSeeOther - SeeOther + ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + // ApplicationGatewayRedirectTypeTemporary - Temporary ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" ) @@ -441,7 +516,9 @@ func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirect type ApplicationGatewayRequestRoutingRuleType string const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + // ApplicationGatewayRequestRoutingRuleTypeBasic - Basic + ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + // ApplicationGatewayRequestRoutingRuleTypePathBasedRouting - PathBasedRouting ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" ) @@ -457,10 +534,14 @@ func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatew type ApplicationGatewayRuleSetStatusOptions string const ( + // ApplicationGatewayRuleSetStatusOptionsDeprecated - Deprecated ApplicationGatewayRuleSetStatusOptionsDeprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" - ApplicationGatewayRuleSetStatusOptionsGA ApplicationGatewayRuleSetStatusOptions = "GA" - ApplicationGatewayRuleSetStatusOptionsPreview ApplicationGatewayRuleSetStatusOptions = "Preview" - ApplicationGatewayRuleSetStatusOptionsSupported ApplicationGatewayRuleSetStatusOptions = "Supported" + // ApplicationGatewayRuleSetStatusOptionsGA - GA + ApplicationGatewayRuleSetStatusOptionsGA ApplicationGatewayRuleSetStatusOptions = "GA" + // ApplicationGatewayRuleSetStatusOptionsPreview - Preview + ApplicationGatewayRuleSetStatusOptionsPreview ApplicationGatewayRuleSetStatusOptions = "Preview" + // ApplicationGatewayRuleSetStatusOptionsSupported - Supported + ApplicationGatewayRuleSetStatusOptionsSupported ApplicationGatewayRuleSetStatusOptions = "Supported" ) // PossibleApplicationGatewayRuleSetStatusOptionsValues returns the possible values for the ApplicationGatewayRuleSetStatusOptions const type. @@ -477,7 +558,9 @@ func PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGateway type ApplicationGatewaySKUFamily string const ( + // ApplicationGatewaySKUFamilyGeneration1 - Generation_1 ApplicationGatewaySKUFamilyGeneration1 ApplicationGatewaySKUFamily = "Generation_1" + // ApplicationGatewaySKUFamilyGeneration2 - Generation_2 ApplicationGatewaySKUFamilyGeneration2 ApplicationGatewaySKUFamily = "Generation_2" ) @@ -493,14 +576,22 @@ func PossibleApplicationGatewaySKUFamilyValues() []ApplicationGatewaySKUFamily { type ApplicationGatewaySKUName string const ( - ApplicationGatewaySKUNameBasic ApplicationGatewaySKUName = "Basic" - ApplicationGatewaySKUNameStandardLarge ApplicationGatewaySKUName = "Standard_Large" + // ApplicationGatewaySKUNameBasic - Basic + ApplicationGatewaySKUNameBasic ApplicationGatewaySKUName = "Basic" + // ApplicationGatewaySKUNameStandardLarge - Standard_Large + ApplicationGatewaySKUNameStandardLarge ApplicationGatewaySKUName = "Standard_Large" + // ApplicationGatewaySKUNameStandardMedium - Standard_Medium ApplicationGatewaySKUNameStandardMedium ApplicationGatewaySKUName = "Standard_Medium" - ApplicationGatewaySKUNameStandardSmall ApplicationGatewaySKUName = "Standard_Small" - ApplicationGatewaySKUNameStandardV2 ApplicationGatewaySKUName = "Standard_v2" - ApplicationGatewaySKUNameWAFLarge ApplicationGatewaySKUName = "WAF_Large" - ApplicationGatewaySKUNameWAFMedium ApplicationGatewaySKUName = "WAF_Medium" - ApplicationGatewaySKUNameWAFV2 ApplicationGatewaySKUName = "WAF_v2" + // ApplicationGatewaySKUNameStandardSmall - Standard_Small + ApplicationGatewaySKUNameStandardSmall ApplicationGatewaySKUName = "Standard_Small" + // ApplicationGatewaySKUNameStandardV2 - Standard_v2 + ApplicationGatewaySKUNameStandardV2 ApplicationGatewaySKUName = "Standard_v2" + // ApplicationGatewaySKUNameWAFLarge - WAF_Large + ApplicationGatewaySKUNameWAFLarge ApplicationGatewaySKUName = "WAF_Large" + // ApplicationGatewaySKUNameWAFMedium - WAF_Medium + ApplicationGatewaySKUNameWAFMedium ApplicationGatewaySKUName = "WAF_Medium" + // ApplicationGatewaySKUNameWAFV2 - WAF_v2 + ApplicationGatewaySKUNameWAFV2 ApplicationGatewaySKUName = "WAF_v2" ) // PossibleApplicationGatewaySKUNameValues returns the possible values for the ApplicationGatewaySKUName const type. @@ -521,34 +612,62 @@ func PossibleApplicationGatewaySKUNameValues() []ApplicationGatewaySKUName { type ApplicationGatewaySSLCipherSuite string const ( - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA - TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA - TLS_DHE_DSS_WITH_AES_128_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 - TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA - TLS_DHE_DSS_WITH_AES_256_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 - TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA - TLS_DHE_RSA_WITH_AES_128_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256 - TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA - TLS_DHE_RSA_WITH_AES_256_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384 - TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA - TLS_RSA_WITH_3DES_EDE_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA - TLS_RSA_WITH_AES_128_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256 - TLS_RSA_WITH_AES_128_CBC_SHA256 + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256 - TLS_RSA_WITH_AES_128_GCM_SHA256 + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA - TLS_RSA_WITH_AES_256_CBC_SHA + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256 - TLS_RSA_WITH_AES_256_CBC_SHA256 + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384 - TLS_RSA_WITH_AES_256_GCM_SHA384 + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" ) // PossibleApplicationGatewaySSLCipherSuiteValues returns the possible values for the ApplicationGatewaySSLCipherSuite const type. @@ -589,10 +708,15 @@ func PossibleApplicationGatewaySSLCipherSuiteValues() []ApplicationGatewaySSLCip type ApplicationGatewaySSLPolicyName string const ( - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401" + // ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501 - AppGwSslPolicy20150501 + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20150501" + // ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401 - AppGwSslPolicy20170401 + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401" + // ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S - AppGwSslPolicy20170401S ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101" + // ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101 - AppGwSslPolicy20220101 + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101" + // ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S - AppGwSslPolicy20220101S ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101S" ) @@ -611,8 +735,11 @@ func PossibleApplicationGatewaySSLPolicyNameValues() []ApplicationGatewaySSLPoli type ApplicationGatewaySSLPolicyType string const ( - ApplicationGatewaySSLPolicyTypeCustom ApplicationGatewaySSLPolicyType = "Custom" - ApplicationGatewaySSLPolicyTypeCustomV2 ApplicationGatewaySSLPolicyType = "CustomV2" + // ApplicationGatewaySSLPolicyTypeCustom - Custom + ApplicationGatewaySSLPolicyTypeCustom ApplicationGatewaySSLPolicyType = "Custom" + // ApplicationGatewaySSLPolicyTypeCustomV2 - CustomV2 + ApplicationGatewaySSLPolicyTypeCustomV2 ApplicationGatewaySSLPolicyType = "CustomV2" + // ApplicationGatewaySSLPolicyTypePredefined - Predefined ApplicationGatewaySSLPolicyTypePredefined ApplicationGatewaySSLPolicyType = "Predefined" ) @@ -629,9 +756,13 @@ func PossibleApplicationGatewaySSLPolicyTypeValues() []ApplicationGatewaySSLPoli type ApplicationGatewaySSLProtocol string const ( + // ApplicationGatewaySSLProtocolTLSv10 - TLSv1_0 ApplicationGatewaySSLProtocolTLSv10 ApplicationGatewaySSLProtocol = "TLSv1_0" + // ApplicationGatewaySSLProtocolTLSv11 - TLSv1_1 ApplicationGatewaySSLProtocolTLSv11 ApplicationGatewaySSLProtocol = "TLSv1_1" + // ApplicationGatewaySSLProtocolTLSv12 - TLSv1_2 ApplicationGatewaySSLProtocolTLSv12 ApplicationGatewaySSLProtocol = "TLSv1_2" + // ApplicationGatewaySSLProtocolTLSv13 - TLSv1_3 ApplicationGatewaySSLProtocolTLSv13 ApplicationGatewaySSLProtocol = "TLSv1_3" ) @@ -649,11 +780,16 @@ func PossibleApplicationGatewaySSLProtocolValues() []ApplicationGatewaySSLProtoc type ApplicationGatewayTier string const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierBasic - Basic + ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" + // ApplicationGatewayTierStandard - Standard + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierStandardV2 - Standard_v2 ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" + // ApplicationGatewayTierWAF - WAF + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + // ApplicationGatewayTierWAFV2 - WAF_v2 + ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" ) // PossibleApplicationGatewayTierValues returns the possible values for the ApplicationGatewayTier const type. @@ -670,10 +806,14 @@ func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { type ApplicationGatewayTierTypes string const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" + // ApplicationGatewayTierTypesStandard - Standard + ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" + // ApplicationGatewayTierTypesStandardV2 - Standard_v2 ApplicationGatewayTierTypesStandardV2 ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFV2 ApplicationGatewayTierTypes = "WAF_v2" + // ApplicationGatewayTierTypesWAF - WAF + ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" + // ApplicationGatewayTierTypesWAFV2 - WAF_v2 + ApplicationGatewayTierTypesWAFV2 ApplicationGatewayTierTypes = "WAF_v2" ) // PossibleApplicationGatewayTierTypesValues returns the possible values for the ApplicationGatewayTierTypes const type. @@ -690,8 +830,10 @@ func PossibleApplicationGatewayTierTypesValues() []ApplicationGatewayTierTypes { type ApplicationGatewayUnAuthorizedRequestAction string const ( + // ApplicationGatewayUnAuthorizedRequestActionAllow - Allow ApplicationGatewayUnAuthorizedRequestActionAllow ApplicationGatewayUnAuthorizedRequestAction = "Allow" - ApplicationGatewayUnAuthorizedRequestActionDeny ApplicationGatewayUnAuthorizedRequestAction = "Deny" + // ApplicationGatewayUnAuthorizedRequestActionDeny - Deny + ApplicationGatewayUnAuthorizedRequestActionDeny ApplicationGatewayUnAuthorizedRequestAction = "Deny" ) // PossibleApplicationGatewayUnAuthorizedRequestActionValues returns the possible values for the ApplicationGatewayUnAuthorizedRequestAction const type. @@ -706,11 +848,16 @@ func PossibleApplicationGatewayUnAuthorizedRequestActionValues() []ApplicationGa type ApplicationGatewayWafRuleActionTypes string const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" + // ApplicationGatewayWafRuleActionTypesAllow - Allow + ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" + // ApplicationGatewayWafRuleActionTypesAnomalyScoring - AnomalyScoring ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" + // ApplicationGatewayWafRuleActionTypesBlock - Block + ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" + // ApplicationGatewayWafRuleActionTypesLog - Log + ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" + // ApplicationGatewayWafRuleActionTypesNone - None + ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" ) // PossibleApplicationGatewayWafRuleActionTypesValues returns the possible values for the ApplicationGatewayWafRuleActionTypes const type. @@ -728,8 +875,11 @@ func PossibleApplicationGatewayWafRuleActionTypesValues() []ApplicationGatewayWa type ApplicationGatewayWafRuleSensitivityTypes string const ( - ApplicationGatewayWafRuleSensitivityTypesHigh ApplicationGatewayWafRuleSensitivityTypes = "High" - ApplicationGatewayWafRuleSensitivityTypesLow ApplicationGatewayWafRuleSensitivityTypes = "Low" + // ApplicationGatewayWafRuleSensitivityTypesHigh - High + ApplicationGatewayWafRuleSensitivityTypesHigh ApplicationGatewayWafRuleSensitivityTypes = "High" + // ApplicationGatewayWafRuleSensitivityTypesLow - Low + ApplicationGatewayWafRuleSensitivityTypesLow ApplicationGatewayWafRuleSensitivityTypes = "Low" + // ApplicationGatewayWafRuleSensitivityTypesMedium - Medium ApplicationGatewayWafRuleSensitivityTypesMedium ApplicationGatewayWafRuleSensitivityTypes = "Medium" ) @@ -746,8 +896,10 @@ func PossibleApplicationGatewayWafRuleSensitivityTypesValues() []ApplicationGate type ApplicationGatewayWafRuleStateTypes string const ( + // ApplicationGatewayWafRuleStateTypesDisabled - Disabled ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" + // ApplicationGatewayWafRuleStateTypesEnabled - Enabled + ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" ) // PossibleApplicationGatewayWafRuleStateTypesValues returns the possible values for the ApplicationGatewayWafRuleStateTypes const type. @@ -762,8 +914,11 @@ func PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWaf type AssociationAccessMode string const ( - AssociationAccessModeAudit AssociationAccessMode = "Audit" + // AssociationAccessModeAudit - Audit + AssociationAccessModeAudit AssociationAccessMode = "Audit" + // AssociationAccessModeEnforced - Enforced AssociationAccessModeEnforced AssociationAccessMode = "Enforced" + // AssociationAccessModeLearning - Learning AssociationAccessModeLearning AssociationAccessMode = "Learning" ) @@ -780,8 +935,10 @@ func PossibleAssociationAccessModeValues() []AssociationAccessMode { type AssociationType string const ( + // AssociationTypeAssociated - Associated AssociationTypeAssociated AssociationType = "Associated" - AssociationTypeContains AssociationType = "Contains" + // AssociationTypeContains - Contains + AssociationTypeContains AssociationType = "Contains" ) // PossibleAssociationTypeValues returns the possible values for the AssociationType const type. @@ -796,8 +953,10 @@ func PossibleAssociationTypeValues() []AssociationType { type AuthenticationMethod string const ( + // AuthenticationMethodEAPMSCHAPv2 - EAPMSCHAPv2 AuthenticationMethodEAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" + // AuthenticationMethodEAPTLS - EAPTLS + AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" ) // PossibleAuthenticationMethodValues returns the possible values for the AuthenticationMethod const type. @@ -812,8 +971,10 @@ func PossibleAuthenticationMethodValues() []AuthenticationMethod { type AuthorizationUseStatus string const ( + // AuthorizationUseStatusAvailable - Available AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" + // AuthorizationUseStatusInUse - InUse + AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" ) // PossibleAuthorizationUseStatusValues returns the possible values for the AuthorizationUseStatus const type. @@ -828,8 +989,10 @@ func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { type AutoLearnPrivateRangesMode string const ( + // AutoLearnPrivateRangesModeDisabled - Disabled AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" - AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" + // AutoLearnPrivateRangesModeEnabled - Enabled + AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" ) // PossibleAutoLearnPrivateRangesModeValues returns the possible values for the AutoLearnPrivateRangesMode const type. @@ -844,8 +1007,11 @@ func PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode { type AzureFirewallApplicationRuleProtocolType string const ( - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + // AzureFirewallApplicationRuleProtocolTypeHTTP - Http + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + // AzureFirewallApplicationRuleProtocolTypeHTTPS - Https AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" + // AzureFirewallApplicationRuleProtocolTypeMssql - Mssql AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" ) @@ -862,7 +1028,9 @@ func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApp type AzureFirewallNatRCActionType string const ( + // AzureFirewallNatRCActionTypeDnat - Dnat AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" + // AzureFirewallNatRCActionTypeSnat - Snat AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" ) @@ -878,10 +1046,14 @@ func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType type AzureFirewallNetworkRuleProtocol string const ( - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" + // AzureFirewallNetworkRuleProtocolAny - Any + AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" + // AzureFirewallNetworkRuleProtocolICMP - ICMP AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" + // AzureFirewallNetworkRuleProtocolTCP - TCP + AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" + // AzureFirewallNetworkRuleProtocolUDP - UDP + AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" ) // PossibleAzureFirewallNetworkRuleProtocolValues returns the possible values for the AzureFirewallNetworkRuleProtocol const type. @@ -898,12 +1070,18 @@ func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRule type AzureFirewallPacketCaptureFlagsType string const ( - AzureFirewallPacketCaptureFlagsTypeAck AzureFirewallPacketCaptureFlagsType = "ack" - AzureFirewallPacketCaptureFlagsTypeFin AzureFirewallPacketCaptureFlagsType = "fin" + // AzureFirewallPacketCaptureFlagsTypeAck - ack + AzureFirewallPacketCaptureFlagsTypeAck AzureFirewallPacketCaptureFlagsType = "ack" + // AzureFirewallPacketCaptureFlagsTypeFin - fin + AzureFirewallPacketCaptureFlagsTypeFin AzureFirewallPacketCaptureFlagsType = "fin" + // AzureFirewallPacketCaptureFlagsTypePush - push AzureFirewallPacketCaptureFlagsTypePush AzureFirewallPacketCaptureFlagsType = "push" - AzureFirewallPacketCaptureFlagsTypeRst AzureFirewallPacketCaptureFlagsType = "rst" - AzureFirewallPacketCaptureFlagsTypeSyn AzureFirewallPacketCaptureFlagsType = "syn" - AzureFirewallPacketCaptureFlagsTypeUrg AzureFirewallPacketCaptureFlagsType = "urg" + // AzureFirewallPacketCaptureFlagsTypeRst - rst + AzureFirewallPacketCaptureFlagsTypeRst AzureFirewallPacketCaptureFlagsType = "rst" + // AzureFirewallPacketCaptureFlagsTypeSyn - syn + AzureFirewallPacketCaptureFlagsTypeSyn AzureFirewallPacketCaptureFlagsType = "syn" + // AzureFirewallPacketCaptureFlagsTypeUrg - urg + AzureFirewallPacketCaptureFlagsTypeUrg AzureFirewallPacketCaptureFlagsType = "urg" ) // PossibleAzureFirewallPacketCaptureFlagsTypeValues returns the possible values for the AzureFirewallPacketCaptureFlagsType const type. @@ -921,14 +1099,16 @@ func PossibleAzureFirewallPacketCaptureFlagsTypeValues() []AzureFirewallPacketCa // AzureFirewallPacketCaptureOperationType - The packet capture operation to perform. If the Start operation is selected, // please provide all the fields in the firewallPacketCaptureParameters to successfully initiate the packet capture. If the // Status or Stop operation is selected, only the operation field is required; all other fields in the firewallPacketCaptureParameters -// can be omitted to successfully retrieve the capture status or stop -// the capture. +// can be omitted to successfully retrieve the capture status or stop the capture. type AzureFirewallPacketCaptureOperationType string const ( - AzureFirewallPacketCaptureOperationTypeStart AzureFirewallPacketCaptureOperationType = "Start" + // AzureFirewallPacketCaptureOperationTypeStart - Start + AzureFirewallPacketCaptureOperationTypeStart AzureFirewallPacketCaptureOperationType = "Start" + // AzureFirewallPacketCaptureOperationTypeStatus - Status AzureFirewallPacketCaptureOperationTypeStatus AzureFirewallPacketCaptureOperationType = "Status" - AzureFirewallPacketCaptureOperationTypeStop AzureFirewallPacketCaptureOperationType = "Stop" + // AzureFirewallPacketCaptureOperationTypeStop - Stop + AzureFirewallPacketCaptureOperationTypeStop AzureFirewallPacketCaptureOperationType = "Stop" ) // PossibleAzureFirewallPacketCaptureOperationTypeValues returns the possible values for the AzureFirewallPacketCaptureOperationType const type. @@ -944,16 +1124,26 @@ func PossibleAzureFirewallPacketCaptureOperationTypeValues() []AzureFirewallPack type AzureFirewallPacketCaptureResponseCode string const ( - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureCompleted AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureCompleted" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureFailed AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureFailed" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureInProgress AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureInProgress" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureNotInProgress AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureNotInProgress" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailed AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartFailed" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureCompleted - AzureFirewallPacketCaptureCompleted + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureCompleted AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureCompleted" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureFailed - AzureFirewallPacketCaptureFailed + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureFailed AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureFailed" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureInProgress - AzureFirewallPacketCaptureInProgress + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureInProgress AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureInProgress" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureNotInProgress - AzureFirewallPacketCaptureNotInProgress + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureNotInProgress AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureNotInProgress" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailed - AzureFirewallPacketCaptureStartFailed + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailed AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartFailed" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailedToUpload - AzureFirewallPacketCaptureStartFailedToUpload AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailedToUpload AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartFailedToUpload" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailure AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartFailure" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartSucceeded AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartSucceeded" - AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStopSucceeded AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStopSucceeded" - AzureFirewallPacketCaptureResponseCodeNotImplemented AzureFirewallPacketCaptureResponseCode = "NotImplemented" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailure - AzureFirewallPacketCaptureStartFailure + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartFailure AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartFailure" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartSucceeded - AzureFirewallPacketCaptureStartSucceeded + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStartSucceeded AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStartSucceeded" + // AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStopSucceeded - AzureFirewallPacketCaptureStopSucceeded + AzureFirewallPacketCaptureResponseCodeAzureFirewallPacketCaptureStopSucceeded AzureFirewallPacketCaptureResponseCode = "AzureFirewallPacketCaptureStopSucceeded" + // AzureFirewallPacketCaptureResponseCodeNotImplemented - NotImplemented + AzureFirewallPacketCaptureResponseCodeNotImplemented AzureFirewallPacketCaptureResponseCode = "NotImplemented" ) // PossibleAzureFirewallPacketCaptureResponseCodeValues returns the possible values for the AzureFirewallPacketCaptureResponseCode const type. @@ -976,8 +1166,10 @@ func PossibleAzureFirewallPacketCaptureResponseCodeValues() []AzureFirewallPacke type AzureFirewallRCActionType string const ( + // AzureFirewallRCActionTypeAllow - Allow AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" + // AzureFirewallRCActionTypeDeny - Deny + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" ) // PossibleAzureFirewallRCActionTypeValues returns the possible values for the AzureFirewallRCActionType const type. @@ -992,7 +1184,9 @@ func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { type AzureFirewallSKUName string const ( - AzureFirewallSKUNameAZFWHub AzureFirewallSKUName = "AZFW_Hub" + // AzureFirewallSKUNameAZFWHub - AZFW_Hub + AzureFirewallSKUNameAZFWHub AzureFirewallSKUName = "AZFW_Hub" + // AzureFirewallSKUNameAZFWVnet - AZFW_VNet AzureFirewallSKUNameAZFWVnet AzureFirewallSKUName = "AZFW_VNet" ) @@ -1008,8 +1202,11 @@ func PossibleAzureFirewallSKUNameValues() []AzureFirewallSKUName { type AzureFirewallSKUTier string const ( - AzureFirewallSKUTierBasic AzureFirewallSKUTier = "Basic" - AzureFirewallSKUTierPremium AzureFirewallSKUTier = "Premium" + // AzureFirewallSKUTierBasic - Basic + AzureFirewallSKUTierBasic AzureFirewallSKUTier = "Basic" + // AzureFirewallSKUTierPremium - Premium + AzureFirewallSKUTierPremium AzureFirewallSKUTier = "Premium" + // AzureFirewallSKUTierStandard - Standard AzureFirewallSKUTierStandard AzureFirewallSKUTier = "Standard" ) @@ -1026,9 +1223,12 @@ func PossibleAzureFirewallSKUTierValues() []AzureFirewallSKUTier { type AzureFirewallThreatIntelMode string const ( + // AzureFirewallThreatIntelModeAlert - Alert AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" + // AzureFirewallThreatIntelModeDeny - Deny + AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" + // AzureFirewallThreatIntelModeOff - Off + AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" ) // PossibleAzureFirewallThreatIntelModeValues returns the possible values for the AzureFirewallThreatIntelMode const type. @@ -1044,7 +1244,9 @@ func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode type BastionConnectProtocol string const ( + // BastionConnectProtocolRDP - RDP BastionConnectProtocolRDP BastionConnectProtocol = "RDP" + // BastionConnectProtocolSSH - SSH BastionConnectProtocolSSH BastionConnectProtocol = "SSH" ) @@ -1060,10 +1262,14 @@ func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { type BastionHostSKUName string const ( - BastionHostSKUNameBasic BastionHostSKUName = "Basic" + // BastionHostSKUNameBasic - Basic + BastionHostSKUNameBasic BastionHostSKUName = "Basic" + // BastionHostSKUNameDeveloper - Developer BastionHostSKUNameDeveloper BastionHostSKUName = "Developer" - BastionHostSKUNamePremium BastionHostSKUName = "Premium" - BastionHostSKUNameStandard BastionHostSKUName = "Standard" + // BastionHostSKUNamePremium - Premium + BastionHostSKUNamePremium BastionHostSKUName = "Premium" + // BastionHostSKUNameStandard - Standard + BastionHostSKUNameStandard BastionHostSKUName = "Standard" ) // PossibleBastionHostSKUNameValues returns the possible values for the BastionHostSKUName const type. @@ -1080,11 +1286,16 @@ func PossibleBastionHostSKUNameValues() []BastionHostSKUName { type BgpPeerState string const ( - BgpPeerStateConnected BgpPeerState = "Connected" + // BgpPeerStateConnected - Connected + BgpPeerStateConnected BgpPeerState = "Connected" + // BgpPeerStateConnecting - Connecting BgpPeerStateConnecting BgpPeerState = "Connecting" - BgpPeerStateIdle BgpPeerState = "Idle" - BgpPeerStateStopped BgpPeerState = "Stopped" - BgpPeerStateUnknown BgpPeerState = "Unknown" + // BgpPeerStateIdle - Idle + BgpPeerStateIdle BgpPeerState = "Idle" + // BgpPeerStateStopped - Stopped + BgpPeerStateStopped BgpPeerState = "Stopped" + // BgpPeerStateUnknown - Unknown + BgpPeerStateUnknown BgpPeerState = "Unknown" ) // PossibleBgpPeerStateValues returns the possible values for the BgpPeerState const type. @@ -1102,8 +1313,11 @@ func PossibleBgpPeerStateValues() []BgpPeerState { type CircuitConnectionStatus string const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + // CircuitConnectionStatusConnected - Connected + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + // CircuitConnectionStatusConnecting - Connecting + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + // CircuitConnectionStatusDisconnected - Disconnected CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" ) @@ -1120,14 +1334,22 @@ func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { type CommissionedState string const ( - CommissionedStateCommissioned CommissionedState = "Commissioned" + // CommissionedStateCommissioned - Commissioned + CommissionedStateCommissioned CommissionedState = "Commissioned" + // CommissionedStateCommissionedNoInternetAdvertise - CommissionedNoInternetAdvertise CommissionedStateCommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" - CommissionedStateCommissioning CommissionedState = "Commissioning" - CommissionedStateDecommissioning CommissionedState = "Decommissioning" - CommissionedStateDeprovisioned CommissionedState = "Deprovisioned" - CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" - CommissionedStateProvisioned CommissionedState = "Provisioned" - CommissionedStateProvisioning CommissionedState = "Provisioning" + // CommissionedStateCommissioning - Commissioning + CommissionedStateCommissioning CommissionedState = "Commissioning" + // CommissionedStateDecommissioning - Decommissioning + CommissionedStateDecommissioning CommissionedState = "Decommissioning" + // CommissionedStateDeprovisioned - Deprovisioned + CommissionedStateDeprovisioned CommissionedState = "Deprovisioned" + // CommissionedStateDeprovisioning - Deprovisioning + CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" + // CommissionedStateProvisioned - Provisioned + CommissionedStateProvisioned CommissionedState = "Provisioned" + // CommissionedStateProvisioning - Provisioning + CommissionedStateProvisioning CommissionedState = "Provisioning" ) // PossibleCommissionedStateValues returns the possible values for the CommissionedState const type. @@ -1148,10 +1370,14 @@ func PossibleCommissionedStateValues() []CommissionedState { type ConfigurationType string const ( - ConfigurationTypeConnectivity ConfigurationType = "Connectivity" - ConfigurationTypeRouting ConfigurationType = "Routing" + // ConfigurationTypeConnectivity - Connectivity + ConfigurationTypeConnectivity ConfigurationType = "Connectivity" + // ConfigurationTypeRouting - Routing + ConfigurationTypeRouting ConfigurationType = "Routing" + // ConfigurationTypeSecurityAdmin - SecurityAdmin ConfigurationTypeSecurityAdmin ConfigurationType = "SecurityAdmin" - ConfigurationTypeSecurityUser ConfigurationType = "SecurityUser" + // ConfigurationTypeSecurityUser - SecurityUser + ConfigurationTypeSecurityUser ConfigurationType = "SecurityUser" ) // PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. @@ -1227,6 +1453,7 @@ func PossibleConnectionAuthenticationTypeValues() []ConnectionAuthenticationType type ConnectionMonitorEndpointFilterItemType string const ( + // ConnectionMonitorEndpointFilterItemTypeAgentAddress - AgentAddress ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" ) @@ -1241,6 +1468,7 @@ func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitor type ConnectionMonitorEndpointFilterType string const ( + // ConnectionMonitorEndpointFilterTypeInclude - Include ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" ) @@ -1251,31 +1479,16 @@ func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndp } } -// ConnectionMonitorSourceStatus - Status of connection monitor source. -type ConnectionMonitorSourceStatus string - -const ( - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns the possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ - ConnectionMonitorSourceStatusActive, - ConnectionMonitorSourceStatusInactive, - ConnectionMonitorSourceStatusUnknown, - } -} - // ConnectionMonitorTestConfigurationProtocol - The protocol to use in test evaluation. type ConnectionMonitorTestConfigurationProtocol string const ( + // ConnectionMonitorTestConfigurationProtocolHTTP - Http ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" + // ConnectionMonitorTestConfigurationProtocolIcmp - Icmp ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" + // ConnectionMonitorTestConfigurationProtocolTCP - Tcp + ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" ) // PossibleConnectionMonitorTestConfigurationProtocolValues returns the possible values for the ConnectionMonitorTestConfigurationProtocol const type. @@ -1291,7 +1504,9 @@ func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMoni type ConnectionMonitorType string const ( - ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" + // ConnectionMonitorTypeMultiEndpoint - MultiEndpoint + ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" + // ConnectionMonitorTypeSingleSourceDestination - SingleSourceDestination ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" ) @@ -1303,32 +1518,18 @@ func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { } } -// ConnectionState - The connection state. -type ConnectionState string - -const ( - ConnectionStateReachable ConnectionState = "Reachable" - ConnectionStateUnknown ConnectionState = "Unknown" - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns the possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ - ConnectionStateReachable, - ConnectionStateUnknown, - ConnectionStateUnreachable, - } -} - // ConnectionStatus - The connection status. type ConnectionStatus string const ( - ConnectionStatusConnected ConnectionStatus = "Connected" - ConnectionStatusDegraded ConnectionStatus = "Degraded" + // ConnectionStatusConnected - Connected + ConnectionStatusConnected ConnectionStatus = "Connected" + // ConnectionStatusDegraded - Degraded + ConnectionStatusDegraded ConnectionStatus = "Degraded" + // ConnectionStatusDisconnected - Disconnected ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusUnknown ConnectionStatus = "Unknown" + // ConnectionStatusUnknown - Unknown + ConnectionStatusUnknown ConnectionStatus = "Unknown" ) // PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type. @@ -1345,8 +1546,10 @@ func PossibleConnectionStatusValues() []ConnectionStatus { type ConnectivityTopology string const ( + // ConnectivityTopologyHubAndSpoke - HubAndSpoke ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" + // ConnectivityTopologyMesh - Mesh + ConnectivityTopologyMesh ConnectivityTopology = "Mesh" ) // PossibleConnectivityTopologyValues returns the possible values for the ConnectivityTopology const type. @@ -1361,12 +1564,18 @@ func PossibleConnectivityTopologyValues() []ConnectivityTopology { type CoverageLevel string const ( + // CoverageLevelAboveAverage - AboveAverage CoverageLevelAboveAverage CoverageLevel = "AboveAverage" - CoverageLevelAverage CoverageLevel = "Average" + // CoverageLevelAverage - Average + CoverageLevelAverage CoverageLevel = "Average" + // CoverageLevelBelowAverage - BelowAverage CoverageLevelBelowAverage CoverageLevel = "BelowAverage" - CoverageLevelDefault CoverageLevel = "Default" - CoverageLevelFull CoverageLevel = "Full" - CoverageLevelLow CoverageLevel = "Low" + // CoverageLevelDefault - Default + CoverageLevelDefault CoverageLevel = "Default" + // CoverageLevelFull - Full + CoverageLevelFull CoverageLevel = "Full" + // CoverageLevelLow - Low + CoverageLevelLow CoverageLevel = "Low" ) // PossibleCoverageLevelValues returns the possible values for the CoverageLevel const type. @@ -1381,14 +1590,42 @@ func PossibleCoverageLevelValues() []CoverageLevel { } } -// CreatedByType - The type of identity that created the resource. +// CreatedByType - The kind of entity that created the resource. type CreatedByType string const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// CreatedByType - The kind of entity that created the resource. +type CreatedByType string + +const ( + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. @@ -1405,8 +1642,11 @@ func PossibleCreatedByTypeValues() []CreatedByType { type CustomIPPrefixType string const ( - CustomIPPrefixTypeChild CustomIPPrefixType = "Child" - CustomIPPrefixTypeParent CustomIPPrefixType = "Parent" + // CustomIPPrefixTypeChild - Child + CustomIPPrefixTypeChild CustomIPPrefixType = "Child" + // CustomIPPrefixTypeParent - Parent + CustomIPPrefixTypeParent CustomIPPrefixType = "Parent" + // CustomIPPrefixTypeSingular - Singular CustomIPPrefixTypeSingular CustomIPPrefixType = "Singular" ) @@ -1423,6 +1663,7 @@ func PossibleCustomIPPrefixTypeValues() []CustomIPPrefixType { type DdosDetectionMode string const ( + // DdosDetectionModeTrafficThreshold - TrafficThreshold DdosDetectionModeTrafficThreshold DdosDetectionMode = "TrafficThreshold" ) @@ -1437,8 +1678,11 @@ func PossibleDdosDetectionModeValues() []DdosDetectionMode { type DdosSettingsProtectionMode string const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + // DdosSettingsProtectionModeDisabled - Disabled + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + // DdosSettingsProtectionModeEnabled - Enabled + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + // DdosSettingsProtectionModeVirtualNetworkInherited - VirtualNetworkInherited DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" ) @@ -1455,9 +1699,12 @@ func PossibleDdosSettingsProtectionModeValues() []DdosSettingsProtectionMode { type DdosTrafficType string const ( - DdosTrafficTypeTCP DdosTrafficType = "Tcp" + // DdosTrafficTypeTCP - Tcp + DdosTrafficTypeTCP DdosTrafficType = "Tcp" + // DdosTrafficTypeTCPSyn - TcpSyn DdosTrafficTypeTCPSyn DdosTrafficType = "TcpSyn" - DdosTrafficTypeUDP DdosTrafficType = "Udp" + // DdosTrafficTypeUDP - Udp + DdosTrafficTypeUDP DdosTrafficType = "Udp" ) // PossibleDdosTrafficTypeValues returns the possible values for the DdosTrafficType const type. @@ -1473,8 +1720,10 @@ func PossibleDdosTrafficTypeValues() []DdosTrafficType { type DeleteExistingPeering string const ( + // DeleteExistingPeeringFalse - False DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" + // DeleteExistingPeeringTrue - True + DeleteExistingPeeringTrue DeleteExistingPeering = "True" ) // PossibleDeleteExistingPeeringValues returns the possible values for the DeleteExistingPeering const type. @@ -1489,7 +1738,9 @@ func PossibleDeleteExistingPeeringValues() []DeleteExistingPeering { type DeleteOptions string const ( + // DeleteOptionsDelete - Delete DeleteOptionsDelete DeleteOptions = "Delete" + // DeleteOptionsDetach - Detach DeleteOptionsDetach DeleteOptions = "Detach" ) @@ -1505,9 +1756,13 @@ func PossibleDeleteOptionsValues() []DeleteOptions { type DeploymentStatus string const ( - DeploymentStatusDeployed DeploymentStatus = "Deployed" - DeploymentStatusDeploying DeploymentStatus = "Deploying" - DeploymentStatusFailed DeploymentStatus = "Failed" + // DeploymentStatusDeployed - Deployed + DeploymentStatusDeployed DeploymentStatus = "Deployed" + // DeploymentStatusDeploying - Deploying + DeploymentStatusDeploying DeploymentStatus = "Deploying" + // DeploymentStatusFailed - Failed + DeploymentStatusFailed DeploymentStatus = "Failed" + // DeploymentStatusNotStarted - NotStarted DeploymentStatusNotStarted DeploymentStatus = "NotStarted" ) @@ -1525,8 +1780,10 @@ func PossibleDeploymentStatusValues() []DeploymentStatus { type DestinationPortBehavior string const ( + // DestinationPortBehaviorListenIfAvailable - ListenIfAvailable DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - DestinationPortBehaviorNone DestinationPortBehavior = "None" + // DestinationPortBehaviorNone - None + DestinationPortBehaviorNone DestinationPortBehavior = "None" ) // PossibleDestinationPortBehaviorValues returns the possible values for the DestinationPortBehavior const type. @@ -1541,14 +1798,22 @@ func PossibleDestinationPortBehaviorValues() []DestinationPortBehavior { type DhGroup string const ( - DhGroupDHGroup1 DhGroup = "DHGroup1" - DhGroupDHGroup14 DhGroup = "DHGroup14" - DhGroupDHGroup2 DhGroup = "DHGroup2" + // DhGroupDHGroup1 - DHGroup1 + DhGroupDHGroup1 DhGroup = "DHGroup1" + // DhGroupDHGroup14 - DHGroup14 + DhGroupDHGroup14 DhGroup = "DHGroup14" + // DhGroupDHGroup2 - DHGroup2 + DhGroupDHGroup2 DhGroup = "DHGroup2" + // DhGroupDHGroup2048 - DHGroup2048 DhGroupDHGroup2048 DhGroup = "DHGroup2048" - DhGroupDHGroup24 DhGroup = "DHGroup24" - DhGroupECP256 DhGroup = "ECP256" - DhGroupECP384 DhGroup = "ECP384" - DhGroupNone DhGroup = "None" + // DhGroupDHGroup24 - DHGroup24 + DhGroupDHGroup24 DhGroup = "DHGroup24" + // DhGroupECP256 - ECP256 + DhGroupECP256 DhGroup = "ECP256" + // DhGroupECP384 - ECP384 + DhGroupECP384 DhGroup = "ECP384" + // DhGroupNone - None + DhGroupNone DhGroup = "None" ) // PossibleDhGroupValues returns the possible values for the DhGroup const type. @@ -1569,7 +1834,9 @@ func PossibleDhGroupValues() []DhGroup { type Direction string const ( - DirectionInbound Direction = "Inbound" + // DirectionInbound - Inbound + DirectionInbound Direction = "Inbound" + // DirectionOutbound - Outbound DirectionOutbound Direction = "Outbound" ) @@ -1599,11 +1866,31 @@ func PossibleDisableBgpRoutePropagationValues() []DisableBgpRoutePropagation { } } +// DisablePeeringRoute - Whether to disable the routes learned by peering on the route table. +type DisablePeeringRoute string + +const ( + // DisablePeeringRouteAll - All peering routes are disabled. + DisablePeeringRouteAll DisablePeeringRoute = "All" + // DisablePeeringRouteNone - Peering routes are enabled. + DisablePeeringRouteNone DisablePeeringRoute = "None" +) + +// PossibleDisablePeeringRouteValues returns the possible values for the DisablePeeringRoute const type. +func PossibleDisablePeeringRouteValues() []DisablePeeringRoute { + return []DisablePeeringRoute{ + DisablePeeringRouteAll, + DisablePeeringRouteNone, + } +} + // EffectiveAdminRuleKind - Whether the rule is custom or default. type EffectiveAdminRuleKind string const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" + // EffectiveAdminRuleKindCustom - Custom + EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" + // EffectiveAdminRuleKindDefault - Default EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" ) @@ -1619,9 +1906,13 @@ func PossibleEffectiveAdminRuleKindValues() []EffectiveAdminRuleKind { type EffectiveRouteSource string const ( - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - EffectiveRouteSourceUser EffectiveRouteSource = "User" + // EffectiveRouteSourceDefault - Default + EffectiveRouteSourceDefault EffectiveRouteSource = "Default" + // EffectiveRouteSourceUnknown - Unknown + EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" + // EffectiveRouteSourceUser - User + EffectiveRouteSourceUser EffectiveRouteSource = "User" + // EffectiveRouteSourceVirtualNetworkGateway - VirtualNetworkGateway EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" ) @@ -1639,7 +1930,9 @@ func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { type EffectiveRouteState string const ( - EffectiveRouteStateActive EffectiveRouteState = "Active" + // EffectiveRouteStateActive - Active + EffectiveRouteStateActive EffectiveRouteState = "Active" + // EffectiveRouteStateInvalid - Invalid EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" ) @@ -1655,8 +1948,11 @@ func PossibleEffectiveRouteStateValues() []EffectiveRouteState { type EffectiveSecurityRuleProtocol string const ( + // EffectiveSecurityRuleProtocolAll - All EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + // EffectiveSecurityRuleProtocolTCP - Tcp EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" + // EffectiveSecurityRuleProtocolUDP - Udp EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" ) @@ -1673,14 +1969,23 @@ func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtoc type EndpointType string const ( - EndpointTypeAzureArcNetwork EndpointType = "AzureArcNetwork" - EndpointTypeAzureArcVM EndpointType = "AzureArcVM" - EndpointTypeAzureSubnet EndpointType = "AzureSubnet" - EndpointTypeAzureVM EndpointType = "AzureVM" - EndpointTypeAzureVMSS EndpointType = "AzureVMSS" - EndpointTypeAzureVNet EndpointType = "AzureVNet" - EndpointTypeExternalAddress EndpointType = "ExternalAddress" + // EndpointTypeAzureArcNetwork - AzureArcNetwork + EndpointTypeAzureArcNetwork EndpointType = "AzureArcNetwork" + // EndpointTypeAzureArcVM - AzureArcVM + EndpointTypeAzureArcVM EndpointType = "AzureArcVM" + // EndpointTypeAzureSubnet - AzureSubnet + EndpointTypeAzureSubnet EndpointType = "AzureSubnet" + // EndpointTypeAzureVM - AzureVM + EndpointTypeAzureVM EndpointType = "AzureVM" + // EndpointTypeAzureVMSS - AzureVMSS + EndpointTypeAzureVMSS EndpointType = "AzureVMSS" + // EndpointTypeAzureVNet - AzureVNet + EndpointTypeAzureVNet EndpointType = "AzureVNet" + // EndpointTypeExternalAddress - ExternalAddress + EndpointTypeExternalAddress EndpointType = "ExternalAddress" + // EndpointTypeMMAWorkspaceMachine - MMAWorkspaceMachine EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" + // EndpointTypeMMAWorkspaceNetwork - MMAWorkspaceNetwork EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" ) @@ -1699,31 +2004,16 @@ func PossibleEndpointTypeValues() []EndpointType { } } -// EvaluationState - Connectivity analysis evaluation state. -type EvaluationState string - -const ( - EvaluationStateCompleted EvaluationState = "Completed" - EvaluationStateInProgress EvaluationState = "InProgress" - EvaluationStateNotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns the possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{ - EvaluationStateCompleted, - EvaluationStateInProgress, - EvaluationStateNotStarted, - } -} - // ExceptionEntryMatchVariable - The variable on which we evaluate the exception condition type ExceptionEntryMatchVariable string const ( - ExceptionEntryMatchVariableRemoteAddr ExceptionEntryMatchVariable = "RemoteAddr" + // ExceptionEntryMatchVariableRemoteAddr - RemoteAddr + ExceptionEntryMatchVariableRemoteAddr ExceptionEntryMatchVariable = "RemoteAddr" + // ExceptionEntryMatchVariableRequestHeader - RequestHeader ExceptionEntryMatchVariableRequestHeader ExceptionEntryMatchVariable = "RequestHeader" - ExceptionEntryMatchVariableRequestURI ExceptionEntryMatchVariable = "RequestURI" + // ExceptionEntryMatchVariableRequestURI - RequestURI + ExceptionEntryMatchVariableRequestURI ExceptionEntryMatchVariable = "RequestURI" ) // PossibleExceptionEntryMatchVariableValues returns the possible values for the ExceptionEntryMatchVariable const type. @@ -1740,9 +2030,13 @@ func PossibleExceptionEntryMatchVariableValues() []ExceptionEntryMatchVariable { type ExceptionEntrySelectorMatchOperator string const ( - ExceptionEntrySelectorMatchOperatorContains ExceptionEntrySelectorMatchOperator = "Contains" - ExceptionEntrySelectorMatchOperatorEndsWith ExceptionEntrySelectorMatchOperator = "EndsWith" - ExceptionEntrySelectorMatchOperatorEquals ExceptionEntrySelectorMatchOperator = "Equals" + // ExceptionEntrySelectorMatchOperatorContains - Contains + ExceptionEntrySelectorMatchOperatorContains ExceptionEntrySelectorMatchOperator = "Contains" + // ExceptionEntrySelectorMatchOperatorEndsWith - EndsWith + ExceptionEntrySelectorMatchOperatorEndsWith ExceptionEntrySelectorMatchOperator = "EndsWith" + // ExceptionEntrySelectorMatchOperatorEquals - Equals + ExceptionEntrySelectorMatchOperatorEquals ExceptionEntrySelectorMatchOperator = "Equals" + // ExceptionEntrySelectorMatchOperatorStartsWith - StartsWith ExceptionEntrySelectorMatchOperatorStartsWith ExceptionEntrySelectorMatchOperator = "StartsWith" ) @@ -1760,10 +2054,15 @@ func PossibleExceptionEntrySelectorMatchOperatorValues() []ExceptionEntrySelecto type ExceptionEntryValueMatchOperator string const ( - ExceptionEntryValueMatchOperatorContains ExceptionEntryValueMatchOperator = "Contains" - ExceptionEntryValueMatchOperatorEndsWith ExceptionEntryValueMatchOperator = "EndsWith" - ExceptionEntryValueMatchOperatorEquals ExceptionEntryValueMatchOperator = "Equals" - ExceptionEntryValueMatchOperatorIPMatch ExceptionEntryValueMatchOperator = "IPMatch" + // ExceptionEntryValueMatchOperatorContains - Contains + ExceptionEntryValueMatchOperatorContains ExceptionEntryValueMatchOperator = "Contains" + // ExceptionEntryValueMatchOperatorEndsWith - EndsWith + ExceptionEntryValueMatchOperatorEndsWith ExceptionEntryValueMatchOperator = "EndsWith" + // ExceptionEntryValueMatchOperatorEquals - Equals + ExceptionEntryValueMatchOperatorEquals ExceptionEntryValueMatchOperator = "Equals" + // ExceptionEntryValueMatchOperatorIPMatch - IPMatch + ExceptionEntryValueMatchOperatorIPMatch ExceptionEntryValueMatchOperator = "IPMatch" + // ExceptionEntryValueMatchOperatorStartsWith - StartsWith ExceptionEntryValueMatchOperatorStartsWith ExceptionEntryValueMatchOperator = "StartsWith" ) @@ -1782,9 +2081,13 @@ func PossibleExceptionEntryValueMatchOperatorValues() []ExceptionEntryValueMatch type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured - Configured + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring - Configuring + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured - NotConfigured + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" ) @@ -1802,8 +2105,10 @@ func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []Exp type ExpressRouteCircuitPeeringState string const ( + // ExpressRouteCircuitPeeringStateDisabled - Disabled ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" + // ExpressRouteCircuitPeeringStateEnabled - Enabled + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" ) // PossibleExpressRouteCircuitPeeringStateValues returns the possible values for the ExpressRouteCircuitPeeringState const type. @@ -1818,7 +2123,9 @@ func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeerin type ExpressRouteCircuitSKUFamily string const ( - ExpressRouteCircuitSKUFamilyMeteredData ExpressRouteCircuitSKUFamily = "MeteredData" + // ExpressRouteCircuitSKUFamilyMeteredData - MeteredData + ExpressRouteCircuitSKUFamilyMeteredData ExpressRouteCircuitSKUFamily = "MeteredData" + // ExpressRouteCircuitSKUFamilyUnlimitedData - UnlimitedData ExpressRouteCircuitSKUFamilyUnlimitedData ExpressRouteCircuitSKUFamily = "UnlimitedData" ) @@ -1834,9 +2141,13 @@ func PossibleExpressRouteCircuitSKUFamilyValues() []ExpressRouteCircuitSKUFamily type ExpressRouteCircuitSKUTier string const ( - ExpressRouteCircuitSKUTierBasic ExpressRouteCircuitSKUTier = "Basic" - ExpressRouteCircuitSKUTierLocal ExpressRouteCircuitSKUTier = "Local" - ExpressRouteCircuitSKUTierPremium ExpressRouteCircuitSKUTier = "Premium" + // ExpressRouteCircuitSKUTierBasic - Basic + ExpressRouteCircuitSKUTierBasic ExpressRouteCircuitSKUTier = "Basic" + // ExpressRouteCircuitSKUTierLocal - Local + ExpressRouteCircuitSKUTierLocal ExpressRouteCircuitSKUTier = "Local" + // ExpressRouteCircuitSKUTierPremium - Premium + ExpressRouteCircuitSKUTierPremium ExpressRouteCircuitSKUTier = "Premium" + // ExpressRouteCircuitSKUTierStandard - Standard ExpressRouteCircuitSKUTierStandard ExpressRouteCircuitSKUTier = "Standard" ) @@ -1850,12 +2161,50 @@ func PossibleExpressRouteCircuitSKUTierValues() []ExpressRouteCircuitSKUTier { } } +// ExpressRouteFailoverBgpStatusAddressFamily - The address family type for BGP status. +type ExpressRouteFailoverBgpStatusAddressFamily string + +const ( + // ExpressRouteFailoverBgpStatusAddressFamilyIPv4 - IPv4 address family. + ExpressRouteFailoverBgpStatusAddressFamilyIPv4 ExpressRouteFailoverBgpStatusAddressFamily = "IPv4" + // ExpressRouteFailoverBgpStatusAddressFamilyIPv6 - IPv6 address family. + ExpressRouteFailoverBgpStatusAddressFamilyIPv6 ExpressRouteFailoverBgpStatusAddressFamily = "IPv6" +) + +// PossibleExpressRouteFailoverBgpStatusAddressFamilyValues returns the possible values for the ExpressRouteFailoverBgpStatusAddressFamily const type. +func PossibleExpressRouteFailoverBgpStatusAddressFamilyValues() []ExpressRouteFailoverBgpStatusAddressFamily { + return []ExpressRouteFailoverBgpStatusAddressFamily{ + ExpressRouteFailoverBgpStatusAddressFamilyIPv4, + ExpressRouteFailoverBgpStatusAddressFamilyIPv6, + } +} + +// ExpressRouteFailoverLinkType - The link on which the failover test is being performed. +type ExpressRouteFailoverLinkType string + +const ( + // ExpressRouteFailoverLinkTypePrimary - Primary link. + ExpressRouteFailoverLinkTypePrimary ExpressRouteFailoverLinkType = "Primary" + // ExpressRouteFailoverLinkTypeSecondary - Secondary link. + ExpressRouteFailoverLinkTypeSecondary ExpressRouteFailoverLinkType = "Secondary" +) + +// PossibleExpressRouteFailoverLinkTypeValues returns the possible values for the ExpressRouteFailoverLinkType const type. +func PossibleExpressRouteFailoverLinkTypeValues() []ExpressRouteFailoverLinkType { + return []ExpressRouteFailoverLinkType{ + ExpressRouteFailoverLinkTypePrimary, + ExpressRouteFailoverLinkTypeSecondary, + } +} + // ExpressRouteLinkAdminState - Administrative state of the physical port. type ExpressRouteLinkAdminState string const ( + // ExpressRouteLinkAdminStateDisabled - Disabled ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" + // ExpressRouteLinkAdminStateEnabled - Enabled + ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" ) // PossibleExpressRouteLinkAdminStateValues returns the possible values for the ExpressRouteLinkAdminState const type. @@ -1870,7 +2219,9 @@ func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { type ExpressRouteLinkConnectorType string const ( + // ExpressRouteLinkConnectorTypeLC - LC ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" + // ExpressRouteLinkConnectorTypeSC - SC ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" ) @@ -1882,13 +2233,38 @@ func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorTy } } +// ExpressRouteLinkFailoverBgpStatus - The BGP status of an ExpressRoute link failover. +type ExpressRouteLinkFailoverBgpStatus string + +const ( + // ExpressRouteLinkFailoverBgpStatusConnected - Connected status. + ExpressRouteLinkFailoverBgpStatusConnected ExpressRouteLinkFailoverBgpStatus = "Connected" + // ExpressRouteLinkFailoverBgpStatusDisconnected - Disconnected status. + ExpressRouteLinkFailoverBgpStatusDisconnected ExpressRouteLinkFailoverBgpStatus = "Disconnected" + // ExpressRouteLinkFailoverBgpStatusUndefined - Undefined status. + ExpressRouteLinkFailoverBgpStatusUndefined ExpressRouteLinkFailoverBgpStatus = "Undefined" +) + +// PossibleExpressRouteLinkFailoverBgpStatusValues returns the possible values for the ExpressRouteLinkFailoverBgpStatus const type. +func PossibleExpressRouteLinkFailoverBgpStatusValues() []ExpressRouteLinkFailoverBgpStatus { + return []ExpressRouteLinkFailoverBgpStatus{ + ExpressRouteLinkFailoverBgpStatusConnected, + ExpressRouteLinkFailoverBgpStatusDisconnected, + ExpressRouteLinkFailoverBgpStatusUndefined, + } +} + // ExpressRouteLinkMacSecCipher - Mac security cipher. type ExpressRouteLinkMacSecCipher string const ( - ExpressRouteLinkMacSecCipherGCMAES128 ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGCMAES256 ExpressRouteLinkMacSecCipher = "GcmAes256" + // ExpressRouteLinkMacSecCipherGCMAES128 - GcmAes128 + ExpressRouteLinkMacSecCipherGCMAES128 ExpressRouteLinkMacSecCipher = "GcmAes128" + // ExpressRouteLinkMacSecCipherGCMAES256 - GcmAes256 + ExpressRouteLinkMacSecCipherGCMAES256 ExpressRouteLinkMacSecCipher = "GcmAes256" + // ExpressRouteLinkMacSecCipherGCMAesXpn128 - GcmAesXpn128 ExpressRouteLinkMacSecCipherGCMAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" + // ExpressRouteLinkMacSecCipherGCMAesXpn256 - GcmAesXpn256 ExpressRouteLinkMacSecCipherGCMAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" ) @@ -1906,8 +2282,10 @@ func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher type ExpressRouteLinkMacSecSciState string const ( + // ExpressRouteLinkMacSecSciStateDisabled - Disabled ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" + // ExpressRouteLinkMacSecSciStateEnabled - Enabled + ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" ) // PossibleExpressRouteLinkMacSecSciStateValues returns the possible values for the ExpressRouteLinkMacSecSciState const type. @@ -1922,8 +2300,10 @@ func PossibleExpressRouteLinkMacSecSciStateValues() []ExpressRouteLinkMacSecSciS type ExpressRoutePeeringState string const ( + // ExpressRoutePeeringStateDisabled - Disabled ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" + // ExpressRoutePeeringStateEnabled - Enabled + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" ) // PossibleExpressRoutePeeringStateValues returns the possible values for the ExpressRoutePeeringState const type. @@ -1938,9 +2318,12 @@ func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { type ExpressRoutePeeringType string const ( + // ExpressRoutePeeringTypeAzurePrivatePeering - AzurePrivatePeering ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" + // ExpressRoutePeeringTypeAzurePublicPeering - AzurePublicPeering + ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + // ExpressRoutePeeringTypeMicrosoftPeering - MicrosoftPeering + ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" ) // PossibleExpressRoutePeeringTypeValues returns the possible values for the ExpressRoutePeeringType const type. @@ -1956,8 +2339,10 @@ func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { type ExpressRoutePortAuthorizationUseStatus string const ( + // ExpressRoutePortAuthorizationUseStatusAvailable - Available ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" - ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" + // ExpressRoutePortAuthorizationUseStatusInUse - InUse + ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" ) // PossibleExpressRoutePortAuthorizationUseStatusValues returns the possible values for the ExpressRoutePortAuthorizationUseStatus const type. @@ -1972,7 +2357,9 @@ func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAu type ExpressRoutePortsBillingType string const ( - ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" + // ExpressRoutePortsBillingTypeMeteredData - MeteredData + ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" + // ExpressRoutePortsBillingTypeUnlimitedData - UnlimitedData ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" ) @@ -1988,8 +2375,10 @@ func PossibleExpressRoutePortsBillingTypeValues() []ExpressRoutePortsBillingType type ExpressRoutePortsEncapsulation string const ( + // ExpressRoutePortsEncapsulationDot1Q - Dot1Q ExpressRoutePortsEncapsulationDot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" + // ExpressRoutePortsEncapsulationQinQ - QinQ + ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" ) // PossibleExpressRoutePortsEncapsulationValues returns the possible values for the ExpressRoutePortsEncapsulation const type. @@ -2005,6 +2394,7 @@ func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsula type ExtendedLocationTypes string const ( + // ExtendedLocationTypesEdgeZone - EdgeZone ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" ) @@ -2019,7 +2409,9 @@ func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { type FailoverConnectionStatus string const ( - FailoverConnectionStatusConnected FailoverConnectionStatus = "Connected" + // FailoverConnectionStatusConnected - Connected + FailoverConnectionStatusConnected FailoverConnectionStatus = "Connected" + // FailoverConnectionStatusDisconnected - Disconnected FailoverConnectionStatusDisconnected FailoverConnectionStatus = "Disconnected" ) @@ -2035,15 +2427,24 @@ func PossibleFailoverConnectionStatusValues() []FailoverConnectionStatus { type FailoverTestStatus string const ( - FailoverTestStatusCompleted FailoverTestStatus = "Completed" - FailoverTestStatusExpired FailoverTestStatus = "Expired" - FailoverTestStatusInvalid FailoverTestStatus = "Invalid" - FailoverTestStatusNotStarted FailoverTestStatus = "NotStarted" - FailoverTestStatusRunning FailoverTestStatus = "Running" + // FailoverTestStatusCompleted - Completed + FailoverTestStatusCompleted FailoverTestStatus = "Completed" + // FailoverTestStatusExpired - Expired + FailoverTestStatusExpired FailoverTestStatus = "Expired" + // FailoverTestStatusInvalid - Invalid + FailoverTestStatusInvalid FailoverTestStatus = "Invalid" + // FailoverTestStatusNotStarted - NotStarted + FailoverTestStatusNotStarted FailoverTestStatus = "NotStarted" + // FailoverTestStatusRunning - Running + FailoverTestStatusRunning FailoverTestStatus = "Running" + // FailoverTestStatusStartFailed - StartFailed FailoverTestStatusStartFailed FailoverTestStatus = "StartFailed" - FailoverTestStatusStarting FailoverTestStatus = "Starting" - FailoverTestStatusStopFailed FailoverTestStatus = "StopFailed" - FailoverTestStatusStopping FailoverTestStatus = "Stopping" + // FailoverTestStatusStarting - Starting + FailoverTestStatusStarting FailoverTestStatus = "Starting" + // FailoverTestStatusStopFailed - StopFailed + FailoverTestStatusStopFailed FailoverTestStatus = "StopFailed" + // FailoverTestStatusStopping - Stopping + FailoverTestStatusStopping FailoverTestStatus = "Stopping" ) // PossibleFailoverTestStatusValues returns the possible values for the FailoverTestStatus const type. @@ -2065,15 +2466,24 @@ func PossibleFailoverTestStatusValues() []FailoverTestStatus { type FailoverTestStatusForSingleTest string const ( - FailoverTestStatusForSingleTestCompleted FailoverTestStatusForSingleTest = "Completed" - FailoverTestStatusForSingleTestExpired FailoverTestStatusForSingleTest = "Expired" - FailoverTestStatusForSingleTestInvalid FailoverTestStatusForSingleTest = "Invalid" - FailoverTestStatusForSingleTestNotStarted FailoverTestStatusForSingleTest = "NotStarted" - FailoverTestStatusForSingleTestRunning FailoverTestStatusForSingleTest = "Running" + // FailoverTestStatusForSingleTestCompleted - Completed + FailoverTestStatusForSingleTestCompleted FailoverTestStatusForSingleTest = "Completed" + // FailoverTestStatusForSingleTestExpired - Expired + FailoverTestStatusForSingleTestExpired FailoverTestStatusForSingleTest = "Expired" + // FailoverTestStatusForSingleTestInvalid - Invalid + FailoverTestStatusForSingleTestInvalid FailoverTestStatusForSingleTest = "Invalid" + // FailoverTestStatusForSingleTestNotStarted - NotStarted + FailoverTestStatusForSingleTestNotStarted FailoverTestStatusForSingleTest = "NotStarted" + // FailoverTestStatusForSingleTestRunning - Running + FailoverTestStatusForSingleTestRunning FailoverTestStatusForSingleTest = "Running" + // FailoverTestStatusForSingleTestStartFailed - StartFailed FailoverTestStatusForSingleTestStartFailed FailoverTestStatusForSingleTest = "StartFailed" - FailoverTestStatusForSingleTestStarting FailoverTestStatusForSingleTest = "Starting" - FailoverTestStatusForSingleTestStopFailed FailoverTestStatusForSingleTest = "StopFailed" - FailoverTestStatusForSingleTestStopping FailoverTestStatusForSingleTest = "Stopping" + // FailoverTestStatusForSingleTestStarting - Starting + FailoverTestStatusForSingleTestStarting FailoverTestStatusForSingleTest = "Starting" + // FailoverTestStatusForSingleTestStopFailed - StopFailed + FailoverTestStatusForSingleTestStopFailed FailoverTestStatusForSingleTest = "StopFailed" + // FailoverTestStatusForSingleTestStopping - Stopping + FailoverTestStatusForSingleTestStopping FailoverTestStatusForSingleTest = "Stopping" ) // PossibleFailoverTestStatusForSingleTestValues returns the possible values for the FailoverTestStatusForSingleTest const type. @@ -2095,8 +2505,11 @@ func PossibleFailoverTestStatusForSingleTestValues() []FailoverTestStatusForSing type FailoverTestType string const ( - FailoverTestTypeAll FailoverTestType = "All" - FailoverTestTypeMultiSiteFailover FailoverTestType = "MultiSiteFailover" + // FailoverTestTypeAll - All + FailoverTestTypeAll FailoverTestType = "All" + // FailoverTestTypeMultiSiteFailover - MultiSiteFailover + FailoverTestTypeMultiSiteFailover FailoverTestType = "MultiSiteFailover" + // FailoverTestTypeSingleSiteFailover - SingleSiteFailover FailoverTestTypeSingleSiteFailover FailoverTestType = "SingleSiteFailover" ) @@ -2113,8 +2526,10 @@ func PossibleFailoverTestTypeValues() []FailoverTestType { type FirewallPolicyFilterRuleCollectionActionType string const ( + // FirewallPolicyFilterRuleCollectionActionTypeAllow - Allow FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" + // FirewallPolicyFilterRuleCollectionActionTypeDeny - Deny + FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" ) // PossibleFirewallPolicyFilterRuleCollectionActionTypeValues returns the possible values for the FirewallPolicyFilterRuleCollectionActionType const type. @@ -2129,7 +2544,9 @@ func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPoli type FirewallPolicyIDPSQuerySortOrder string const ( - FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" + // FirewallPolicyIDPSQuerySortOrderAscending - Ascending + FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" + // FirewallPolicyIDPSQuerySortOrderDescending - Descending FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" ) @@ -2146,12 +2563,18 @@ func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQueryS type FirewallPolicyIDPSSignatureDirection int32 const ( - FirewallPolicyIDPSSignatureDirectionFive FirewallPolicyIDPSSignatureDirection = 5 - FirewallPolicyIDPSSignatureDirectionFour FirewallPolicyIDPSSignatureDirection = 4 - FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 + // FirewallPolicyIDPSSignatureDirectionFive - 5 + FirewallPolicyIDPSSignatureDirectionFive FirewallPolicyIDPSSignatureDirection = 5 + // FirewallPolicyIDPSSignatureDirectionFour - 4 + FirewallPolicyIDPSSignatureDirectionFour FirewallPolicyIDPSSignatureDirection = 4 + // FirewallPolicyIDPSSignatureDirectionOne - 1 + FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 + // FirewallPolicyIDPSSignatureDirectionThree - 3 FirewallPolicyIDPSSignatureDirectionThree FirewallPolicyIDPSSignatureDirection = 3 - FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 - FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 + // FirewallPolicyIDPSSignatureDirectionTwo - 2 + FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 + // FirewallPolicyIDPSSignatureDirectionZero - 0 + FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 ) // PossibleFirewallPolicyIDPSSignatureDirectionValues returns the possible values for the FirewallPolicyIDPSSignatureDirection const type. @@ -2170,8 +2593,11 @@ func PossibleFirewallPolicyIDPSSignatureDirectionValues() []FirewallPolicyIDPSSi type FirewallPolicyIDPSSignatureMode int32 const ( - FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 - FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 + // FirewallPolicyIDPSSignatureModeOne - 1 + FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 + // FirewallPolicyIDPSSignatureModeTwo - 2 + FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 + // FirewallPolicyIDPSSignatureModeZero - 0 FirewallPolicyIDPSSignatureModeZero FirewallPolicyIDPSSignatureMode = 0 ) @@ -2188,9 +2614,12 @@ func PossibleFirewallPolicyIDPSSignatureModeValues() []FirewallPolicyIDPSSignatu type FirewallPolicyIDPSSignatureSeverity int32 const ( - FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 + // FirewallPolicyIDPSSignatureSeverityOne - 1 + FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 + // FirewallPolicyIDPSSignatureSeverityThree - 3 FirewallPolicyIDPSSignatureSeverityThree FirewallPolicyIDPSSignatureSeverity = 3 - FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 + // FirewallPolicyIDPSSignatureSeverityTwo - 2 + FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 ) // PossibleFirewallPolicyIDPSSignatureSeverityValues returns the possible values for the FirewallPolicyIDPSSignatureSeverity const type. @@ -2204,17 +2633,21 @@ func PossibleFirewallPolicyIDPSSignatureSeverityValues() []FirewallPolicyIDPSSig // FirewallPolicyIntrusionDetectionProfileType - Specifies the Intrusion Detection signature profile to apply. // Values: -// * Off: IDPS profiles disabled; uses the same signature set that existed before profiles. -// * Emerging: Signatures of the newest, most recent threats. -// * Core: Complete, modern, standard set of signatures. -// * Extended: Core signatures plus older legacy signatures for maximum coverage. +// - Off: IDPS profiles disabled; uses the same signature set that existed before profiles. +// - Emerging: Signatures of the newest, most recent threats. +// - Core: Complete, modern, standard set of signatures. +// - Extended: Core signatures plus older legacy signatures for maximum coverage. type FirewallPolicyIntrusionDetectionProfileType string const ( - FirewallPolicyIntrusionDetectionProfileTypeCore FirewallPolicyIntrusionDetectionProfileType = "Core" + // FirewallPolicyIntrusionDetectionProfileTypeCore - Core + FirewallPolicyIntrusionDetectionProfileTypeCore FirewallPolicyIntrusionDetectionProfileType = "Core" + // FirewallPolicyIntrusionDetectionProfileTypeEmerging - Emerging FirewallPolicyIntrusionDetectionProfileTypeEmerging FirewallPolicyIntrusionDetectionProfileType = "Emerging" + // FirewallPolicyIntrusionDetectionProfileTypeExtended - Extended FirewallPolicyIntrusionDetectionProfileTypeExtended FirewallPolicyIntrusionDetectionProfileType = "Extended" - FirewallPolicyIntrusionDetectionProfileTypeOff FirewallPolicyIntrusionDetectionProfileType = "Off" + // FirewallPolicyIntrusionDetectionProfileTypeOff - Off + FirewallPolicyIntrusionDetectionProfileTypeOff FirewallPolicyIntrusionDetectionProfileType = "Off" ) // PossibleFirewallPolicyIntrusionDetectionProfileTypeValues returns the possible values for the FirewallPolicyIntrusionDetectionProfileType const type. @@ -2231,10 +2664,14 @@ func PossibleFirewallPolicyIntrusionDetectionProfileTypeValues() []FirewallPolic type FirewallPolicyIntrusionDetectionProtocol string const ( - FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" + // FirewallPolicyIntrusionDetectionProtocolANY - ANY + FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" + // FirewallPolicyIntrusionDetectionProtocolICMP - ICMP FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" - FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" - FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" + // FirewallPolicyIntrusionDetectionProtocolTCP - TCP + FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" + // FirewallPolicyIntrusionDetectionProtocolUDP - UDP + FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" ) // PossibleFirewallPolicyIntrusionDetectionProtocolValues returns the possible values for the FirewallPolicyIntrusionDetectionProtocol const type. @@ -2251,9 +2688,12 @@ func PossibleFirewallPolicyIntrusionDetectionProtocolValues() []FirewallPolicyIn type FirewallPolicyIntrusionDetectionStateType string const ( + // FirewallPolicyIntrusionDetectionStateTypeAlert - Alert FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" - FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" - FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" + // FirewallPolicyIntrusionDetectionStateTypeDeny - Deny + FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" + // FirewallPolicyIntrusionDetectionStateTypeOff - Off + FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" ) // PossibleFirewallPolicyIntrusionDetectionStateTypeValues returns the possible values for the FirewallPolicyIntrusionDetectionStateType const type. @@ -2269,6 +2709,7 @@ func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyI type FirewallPolicyNatRuleCollectionActionType string const ( + // FirewallPolicyNatRuleCollectionActionTypeDNAT - DNAT FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" ) @@ -2283,7 +2724,9 @@ func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyN type FirewallPolicyRuleApplicationProtocolType string const ( - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" + // FirewallPolicyRuleApplicationProtocolTypeHTTP - Http + FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" + // FirewallPolicyRuleApplicationProtocolTypeHTTPS - Https FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" ) @@ -2299,8 +2742,10 @@ func PossibleFirewallPolicyRuleApplicationProtocolTypeValues() []FirewallPolicyR type FirewallPolicyRuleCollectionType string const ( + // FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection - FirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyFilterRuleCollection" - FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" + // FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection - FirewallPolicyNatRuleCollection + FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" ) // PossibleFirewallPolicyRuleCollectionTypeValues returns the possible values for the FirewallPolicyRuleCollectionType const type. @@ -2315,10 +2760,14 @@ func PossibleFirewallPolicyRuleCollectionTypeValues() []FirewallPolicyRuleCollec type FirewallPolicyRuleNetworkProtocol string const ( - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" + // FirewallPolicyRuleNetworkProtocolAny - Any + FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" + // FirewallPolicyRuleNetworkProtocolICMP - ICMP FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" + // FirewallPolicyRuleNetworkProtocolTCP - TCP + FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" + // FirewallPolicyRuleNetworkProtocolUDP - UDP + FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" ) // PossibleFirewallPolicyRuleNetworkProtocolValues returns the possible values for the FirewallPolicyRuleNetworkProtocol const type. @@ -2335,9 +2784,12 @@ func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetwo type FirewallPolicyRuleType string const ( + // FirewallPolicyRuleTypeApplicationRule - ApplicationRule FirewallPolicyRuleTypeApplicationRule FirewallPolicyRuleType = "ApplicationRule" - FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" - FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" + // FirewallPolicyRuleTypeNatRule - NatRule + FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" + // FirewallPolicyRuleTypeNetworkRule - NetworkRule + FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" ) // PossibleFirewallPolicyRuleTypeValues returns the possible values for the FirewallPolicyRuleType const type. @@ -2353,8 +2805,11 @@ func PossibleFirewallPolicyRuleTypeValues() []FirewallPolicyRuleType { type FirewallPolicySKUTier string const ( - FirewallPolicySKUTierBasic FirewallPolicySKUTier = "Basic" - FirewallPolicySKUTierPremium FirewallPolicySKUTier = "Premium" + // FirewallPolicySKUTierBasic - Basic + FirewallPolicySKUTierBasic FirewallPolicySKUTier = "Basic" + // FirewallPolicySKUTierPremium - Premium + FirewallPolicySKUTierPremium FirewallPolicySKUTier = "Premium" + // FirewallPolicySKUTierStandard - Standard FirewallPolicySKUTierStandard FirewallPolicySKUTier = "Standard" ) @@ -2371,6 +2826,7 @@ func PossibleFirewallPolicySKUTierValues() []FirewallPolicySKUTier { type FlowLogFormatType string const ( + // FlowLogFormatTypeJSON - JSON FlowLogFormatTypeJSON FlowLogFormatType = "JSON" ) @@ -2385,9 +2841,12 @@ func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { type GatewayLoadBalancerTunnelInterfaceType string const ( + // GatewayLoadBalancerTunnelInterfaceTypeExternal - External GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + // GatewayLoadBalancerTunnelInterfaceTypeInternal - Internal GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" + // GatewayLoadBalancerTunnelInterfaceTypeNone - None + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" ) // PossibleGatewayLoadBalancerTunnelInterfaceTypeValues returns the possible values for the GatewayLoadBalancerTunnelInterfaceType const type. @@ -2403,9 +2862,12 @@ func PossibleGatewayLoadBalancerTunnelInterfaceTypeValues() []GatewayLoadBalance type GatewayLoadBalancerTunnelProtocol string const ( + // GatewayLoadBalancerTunnelProtocolNative - Native GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" + // GatewayLoadBalancerTunnelProtocolNone - None + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + // GatewayLoadBalancerTunnelProtocolVXLAN - VXLAN + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" ) // PossibleGatewayLoadBalancerTunnelProtocolValues returns the possible values for the GatewayLoadBalancerTunnelProtocol const type. @@ -2421,14 +2883,23 @@ func PossibleGatewayLoadBalancerTunnelProtocolValues() []GatewayLoadBalancerTunn type Geo string const ( - GeoAFRI Geo = "AFRI" - GeoAPAC Geo = "APAC" - GeoAQ Geo = "AQ" - GeoEURO Geo = "EURO" - GeoGLOBAL Geo = "GLOBAL" - GeoLATAM Geo = "LATAM" - GeoME Geo = "ME" - GeoNAM Geo = "NAM" + // GeoAFRI - AFRI + GeoAFRI Geo = "AFRI" + // GeoAPAC - APAC + GeoAPAC Geo = "APAC" + // GeoAQ - AQ + GeoAQ Geo = "AQ" + // GeoEURO - EURO + GeoEURO Geo = "EURO" + // GeoGLOBAL - GLOBAL + GeoGLOBAL Geo = "GLOBAL" + // GeoLATAM - LATAM + GeoLATAM Geo = "LATAM" + // GeoME - ME + GeoME Geo = "ME" + // GeoNAM - NAM + GeoNAM Geo = "NAM" + // GeoOCEANIA - OCEANIA GeoOCEANIA Geo = "OCEANIA" ) @@ -2451,8 +2922,10 @@ func PossibleGeoValues() []Geo { type GroupConnectivity string const ( + // GroupConnectivityDirectlyConnected - DirectlyConnected GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" + // GroupConnectivityNone - None + GroupConnectivityNone GroupConnectivity = "None" ) // PossibleGroupConnectivityValues returns the possible values for the GroupConnectivity const type. @@ -2467,7 +2940,9 @@ func PossibleGroupConnectivityValues() []GroupConnectivity { type GroupMemberType string const ( - GroupMemberTypeSubnet GroupMemberType = "Subnet" + // GroupMemberTypeSubnet - Subnet + GroupMemberTypeSubnet GroupMemberType = "Subnet" + // GroupMemberTypeVirtualNetwork - VirtualNetwork GroupMemberTypeVirtualNetwork GroupMemberType = "VirtualNetwork" ) @@ -2483,7 +2958,9 @@ func PossibleGroupMemberTypeValues() []GroupMemberType { type HTTPConfigurationMethod string const ( - HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" + // HTTPConfigurationMethodGet - Get + HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" + // HTTPConfigurationMethodPost - Post HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" ) @@ -2499,6 +2976,7 @@ func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { type HTTPMethod string const ( + // HTTPMethodGet - Get HTTPMethodGet HTTPMethod = "Get" ) @@ -2513,10 +2991,14 @@ func PossibleHTTPMethodValues() []HTTPMethod { type HubBgpConnectionStatus string const ( - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" + // HubBgpConnectionStatusConnected - Connected + HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" + // HubBgpConnectionStatusConnecting - Connecting + HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" + // HubBgpConnectionStatusNotConnected - NotConnected HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" + // HubBgpConnectionStatusUnknown - Unknown + HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" ) // PossibleHubBgpConnectionStatusValues returns the possible values for the HubBgpConnectionStatus const type. @@ -2533,9 +3015,12 @@ func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { type HubRoutingPreference string const ( - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" + // HubRoutingPreferenceASPath - ASPath + HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" + // HubRoutingPreferenceExpressRoute - ExpressRoute HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - HubRoutingPreferenceVPNGateway HubRoutingPreference = "VpnGateway" + // HubRoutingPreferenceVPNGateway - VpnGateway + HubRoutingPreferenceVPNGateway HubRoutingPreference = "VpnGateway" ) // PossibleHubRoutingPreferenceValues returns the possible values for the HubRoutingPreference const type. @@ -2547,32 +3032,14 @@ func PossibleHubRoutingPreferenceValues() []HubRoutingPreference { } } -// HubVirtualNetworkConnectionStatus - The current state of the VirtualHub to vnet connection. -type HubVirtualNetworkConnectionStatus string - -const ( - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns the possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{ - HubVirtualNetworkConnectionStatusConnected, - HubVirtualNetworkConnectionStatusConnecting, - HubVirtualNetworkConnectionStatusNotConnected, - HubVirtualNetworkConnectionStatusUnknown, - } -} - // IPAllocationMethod - IP address allocation method. type IPAllocationMethod string const ( + // IPAllocationMethodDynamic - Dynamic IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" + // IPAllocationMethodStatic - Static + IPAllocationMethodStatic IPAllocationMethod = "Static" ) // PossibleIPAllocationMethodValues returns the possible values for the IPAllocationMethod const type. @@ -2587,7 +3054,9 @@ func PossibleIPAllocationMethodValues() []IPAllocationMethod { type IPAllocationType string const ( - IPAllocationTypeHypernet IPAllocationType = "Hypernet" + // IPAllocationTypeHypernet - Hypernet + IPAllocationTypeHypernet IPAllocationType = "Hypernet" + // IPAllocationTypeUndefined - Undefined IPAllocationTypeUndefined IPAllocationType = "Undefined" ) @@ -2603,7 +3072,9 @@ func PossibleIPAllocationTypeValues() []IPAllocationType { type IPFlowProtocol string const ( + // IPFlowProtocolTCP - TCP IPFlowProtocolTCP IPFlowProtocol = "TCP" + // IPFlowProtocolUDP - UDP IPFlowProtocolUDP IPFlowProtocol = "UDP" ) @@ -2619,15 +3090,24 @@ func PossibleIPFlowProtocolValues() []IPFlowProtocol { type IPSecEncryption string const ( - IPSecEncryptionAES128 IPSecEncryption = "AES128" - IPSecEncryptionAES192 IPSecEncryption = "AES192" - IPSecEncryptionAES256 IPSecEncryption = "AES256" - IPSecEncryptionDES IPSecEncryption = "DES" - IPSecEncryptionDES3 IPSecEncryption = "DES3" + // IPSecEncryptionAES128 - AES128 + IPSecEncryptionAES128 IPSecEncryption = "AES128" + // IPSecEncryptionAES192 - AES192 + IPSecEncryptionAES192 IPSecEncryption = "AES192" + // IPSecEncryptionAES256 - AES256 + IPSecEncryptionAES256 IPSecEncryption = "AES256" + // IPSecEncryptionDES - DES + IPSecEncryptionDES IPSecEncryption = "DES" + // IPSecEncryptionDES3 - DES3 + IPSecEncryptionDES3 IPSecEncryption = "DES3" + // IPSecEncryptionGCMAES128 - GCMAES128 IPSecEncryptionGCMAES128 IPSecEncryption = "GCMAES128" + // IPSecEncryptionGCMAES192 - GCMAES192 IPSecEncryptionGCMAES192 IPSecEncryption = "GCMAES192" + // IPSecEncryptionGCMAES256 - GCMAES256 IPSecEncryptionGCMAES256 IPSecEncryption = "GCMAES256" - IPSecEncryptionNone IPSecEncryption = "None" + // IPSecEncryptionNone - None + IPSecEncryptionNone IPSecEncryption = "None" ) // PossibleIPSecEncryptionValues returns the possible values for the IPSecEncryption const type. @@ -2649,12 +3129,18 @@ func PossibleIPSecEncryptionValues() []IPSecEncryption { type IPSecIntegrity string const ( + // IPSecIntegrityGCMAES128 - GCMAES128 IPSecIntegrityGCMAES128 IPSecIntegrity = "GCMAES128" + // IPSecIntegrityGCMAES192 - GCMAES192 IPSecIntegrityGCMAES192 IPSecIntegrity = "GCMAES192" + // IPSecIntegrityGCMAES256 - GCMAES256 IPSecIntegrityGCMAES256 IPSecIntegrity = "GCMAES256" - IPSecIntegrityMD5 IPSecIntegrity = "MD5" - IPSecIntegritySHA1 IPSecIntegrity = "SHA1" - IPSecIntegritySHA256 IPSecIntegrity = "SHA256" + // IPSecIntegrityMD5 - MD5 + IPSecIntegrityMD5 IPSecIntegrity = "MD5" + // IPSecIntegritySHA1 - SHA1 + IPSecIntegritySHA1 IPSecIntegrity = "SHA1" + // IPSecIntegritySHA256 - SHA256 + IPSecIntegritySHA256 IPSecIntegrity = "SHA256" ) // PossibleIPSecIntegrityValues returns the possible values for the IPSecIntegrity const type. @@ -2673,7 +3159,9 @@ func PossibleIPSecIntegrityValues() []IPSecIntegrity { type IPType string const ( + // IPTypeIPv4 - IPv4 IPTypeIPv4 IPType = "IPv4" + // IPTypeIPv6 - IPv6 IPTypeIPv6 IPType = "IPv6" ) @@ -2689,7 +3177,9 @@ func PossibleIPTypeValues() []IPType { type IPVersion string const ( + // IPVersionIPv4 - IPv4 IPVersionIPv4 IPVersion = "IPv4" + // IPVersionIPv6 - IPv6 IPVersionIPv6 IPVersion = "IPv6" ) @@ -2705,12 +3195,19 @@ func PossibleIPVersionValues() []IPVersion { type IkeEncryption string const ( - IkeEncryptionAES128 IkeEncryption = "AES128" - IkeEncryptionAES192 IkeEncryption = "AES192" - IkeEncryptionAES256 IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDES3 IkeEncryption = "DES3" + // IkeEncryptionAES128 - AES128 + IkeEncryptionAES128 IkeEncryption = "AES128" + // IkeEncryptionAES192 - AES192 + IkeEncryptionAES192 IkeEncryption = "AES192" + // IkeEncryptionAES256 - AES256 + IkeEncryptionAES256 IkeEncryption = "AES256" + // IkeEncryptionDES - DES + IkeEncryptionDES IkeEncryption = "DES" + // IkeEncryptionDES3 - DES3 + IkeEncryptionDES3 IkeEncryption = "DES3" + // IkeEncryptionGCMAES128 - GCMAES128 IkeEncryptionGCMAES128 IkeEncryption = "GCMAES128" + // IkeEncryptionGCMAES256 - GCMAES256 IkeEncryptionGCMAES256 IkeEncryption = "GCMAES256" ) @@ -2731,12 +3228,18 @@ func PossibleIkeEncryptionValues() []IkeEncryption { type IkeIntegrity string const ( + // IkeIntegrityGCMAES128 - GCMAES128 IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" + // IkeIntegrityGCMAES256 - GCMAES256 IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - IkeIntegrityMD5 IkeIntegrity = "MD5" - IkeIntegritySHA1 IkeIntegrity = "SHA1" - IkeIntegritySHA256 IkeIntegrity = "SHA256" - IkeIntegritySHA384 IkeIntegrity = "SHA384" + // IkeIntegrityMD5 - MD5 + IkeIntegrityMD5 IkeIntegrity = "MD5" + // IkeIntegritySHA1 - SHA1 + IkeIntegritySHA1 IkeIntegrity = "SHA1" + // IkeIntegritySHA256 - SHA256 + IkeIntegritySHA256 IkeIntegrity = "SHA256" + // IkeIntegritySHA384 - SHA384 + IkeIntegritySHA384 IkeIntegrity = "SHA384" ) // PossibleIkeIntegrityValues returns the possible values for the IkeIntegrity const type. @@ -2756,8 +3259,10 @@ func PossibleIkeIntegrityValues() []IkeIntegrity { type InboundSecurityRuleType string const ( + // InboundSecurityRuleTypeAutoExpire - AutoExpire InboundSecurityRuleTypeAutoExpire InboundSecurityRuleType = "AutoExpire" - InboundSecurityRuleTypePermanent InboundSecurityRuleType = "Permanent" + // InboundSecurityRuleTypePermanent - Permanent + InboundSecurityRuleTypePermanent InboundSecurityRuleType = "Permanent" ) // PossibleInboundSecurityRuleTypeValues returns the possible values for the InboundSecurityRuleType const type. @@ -2772,7 +3277,9 @@ func PossibleInboundSecurityRuleTypeValues() []InboundSecurityRuleType { type InboundSecurityRulesProtocol string const ( + // InboundSecurityRulesProtocolTCP - TCP InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" + // InboundSecurityRulesProtocolUDP - UDP InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" ) @@ -2784,12 +3291,32 @@ func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol } } +// InterconnectGroupScope - Scope of an interconnect group resource. +type InterconnectGroupScope string + +const ( + // InterconnectGroupScopeInfiniBand - InfiniBand interconnect group scope. + InterconnectGroupScopeInfiniBand InterconnectGroupScope = "InfiniBand" + // InterconnectGroupScopeNone - No interconnect group scope. + InterconnectGroupScopeNone InterconnectGroupScope = "None" +) + +// PossibleInterconnectGroupScopeValues returns the possible values for the InterconnectGroupScope const type. +func PossibleInterconnectGroupScopeValues() []InterconnectGroupScope { + return []InterconnectGroupScope{ + InterconnectGroupScopeInfiniBand, + InterconnectGroupScopeNone, + } +} + // IsGlobal - Flag if global mesh is supported. type IsGlobal string const ( + // IsGlobalFalse - False IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" + // IsGlobalTrue - True + IsGlobalTrue IsGlobal = "True" ) // PossibleIsGlobalValues returns the possible values for the IsGlobal const type. @@ -2804,8 +3331,10 @@ func PossibleIsGlobalValues() []IsGlobal { type IsRollback string const ( + // IsRollbackFalse - false IsRollbackFalse IsRollback = "false" - IsRollbackTrue IsRollback = "true" + // IsRollbackTrue - true + IsRollbackTrue IsRollback = "true" ) // PossibleIsRollbackValues returns the possible values for the IsRollback const type. @@ -2820,8 +3349,10 @@ func PossibleIsRollbackValues() []IsRollback { type IsWorkloadProtected string const ( + // IsWorkloadProtectedFalse - False IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" + // IsWorkloadProtectedTrue - True + IsWorkloadProtectedTrue IsWorkloadProtected = "True" ) // PossibleIsWorkloadProtectedValues returns the possible values for the IsWorkloadProtected const type. @@ -2836,15 +3367,24 @@ func PossibleIsWorkloadProtectedValues() []IsWorkloadProtected { type IssueType string const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDNSResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" + // IssueTypeAgentStopped - AgentStopped + IssueTypeAgentStopped IssueType = "AgentStopped" + // IssueTypeDNSResolution - DnsResolution + IssueTypeDNSResolution IssueType = "DnsResolution" + // IssueTypeGuestFirewall - GuestFirewall + IssueTypeGuestFirewall IssueType = "GuestFirewall" + // IssueTypeNetworkSecurityRule - NetworkSecurityRule IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" + // IssueTypePlatform - Platform + IssueTypePlatform IssueType = "Platform" + // IssueTypePortThrottled - PortThrottled + IssueTypePortThrottled IssueType = "PortThrottled" + // IssueTypeSocketBind - SocketBind + IssueTypeSocketBind IssueType = "SocketBind" + // IssueTypeUnknown - Unknown + IssueTypeUnknown IssueType = "Unknown" + // IssueTypeUserDefinedRoute - UserDefinedRoute + IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" ) // PossibleIssueTypeValues returns the possible values for the IssueType const type. @@ -2867,9 +3407,12 @@ func PossibleIssueTypeValues() []IssueType { type LoadBalancerBackendAddressAdminState string const ( + // LoadBalancerBackendAddressAdminStateDown - Down LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + // LoadBalancerBackendAddressAdminStateNone - None LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" + // LoadBalancerBackendAddressAdminStateUp - Up + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" ) // PossibleLoadBalancerBackendAddressAdminStateValues returns the possible values for the LoadBalancerBackendAddressAdminState const type. @@ -2881,12 +3424,30 @@ func PossibleLoadBalancerBackendAddressAdminStateValues() []LoadBalancerBackendA } } +// LoadBalancerDetailLevel - Controls verbosity of the returned load balancer resource. +type LoadBalancerDetailLevel string + +const ( + // LoadBalancerDetailLevelReduced - When set to 'Reduced', read-only reference collections may be omitted. + LoadBalancerDetailLevelReduced LoadBalancerDetailLevel = "Reduced" +) + +// PossibleLoadBalancerDetailLevelValues returns the possible values for the LoadBalancerDetailLevel const type. +func PossibleLoadBalancerDetailLevelValues() []LoadBalancerDetailLevel { + return []LoadBalancerDetailLevel{ + LoadBalancerDetailLevelReduced, + } +} + // LoadBalancerOutboundRuleProtocol - The protocol for the outbound rule in load balancer. type LoadBalancerOutboundRuleProtocol string const ( + // LoadBalancerOutboundRuleProtocolAll - All LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" + // LoadBalancerOutboundRuleProtocolTCP - Tcp LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" + // LoadBalancerOutboundRuleProtocolUDP - Udp LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" ) @@ -2903,8 +3464,11 @@ func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRule type LoadBalancerSKUName string const ( - LoadBalancerSKUNameBasic LoadBalancerSKUName = "Basic" - LoadBalancerSKUNameGateway LoadBalancerSKUName = "Gateway" + // LoadBalancerSKUNameBasic - Basic + LoadBalancerSKUNameBasic LoadBalancerSKUName = "Basic" + // LoadBalancerSKUNameGateway - Gateway + LoadBalancerSKUNameGateway LoadBalancerSKUName = "Gateway" + // LoadBalancerSKUNameStandard - Standard LoadBalancerSKUNameStandard LoadBalancerSKUName = "Standard" ) @@ -2921,7 +3485,9 @@ func PossibleLoadBalancerSKUNameValues() []LoadBalancerSKUName { type LoadBalancerSKUTier string const ( - LoadBalancerSKUTierGlobal LoadBalancerSKUTier = "Global" + // LoadBalancerSKUTierGlobal - Global + LoadBalancerSKUTierGlobal LoadBalancerSKUTier = "Global" + // LoadBalancerSKUTierRegional - Regional LoadBalancerSKUTierRegional LoadBalancerSKUTier = "Regional" ) @@ -2937,8 +3503,10 @@ func PossibleLoadBalancerSKUTierValues() []LoadBalancerSKUTier { type LoadBalancerScope string const ( + // LoadBalancerScopePrivate - Private LoadBalancerScopePrivate LoadBalancerScope = "Private" - LoadBalancerScopePublic LoadBalancerScope = "Public" + // LoadBalancerScopePublic - Public + LoadBalancerScopePublic LoadBalancerScope = "Public" ) // PossibleLoadBalancerScopeValues returns the possible values for the LoadBalancerScope const type. @@ -2953,8 +3521,11 @@ func PossibleLoadBalancerScopeValues() []LoadBalancerScope { type LoadDistribution string const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" + // LoadDistributionDefault - Default + LoadDistributionDefault LoadDistribution = "Default" + // LoadDistributionSourceIP - SourceIP + LoadDistributionSourceIP LoadDistribution = "SourceIP" + // LoadDistributionSourceIPProtocol - SourceIPProtocol LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" ) @@ -2967,12 +3538,32 @@ func PossibleLoadDistributionValues() []LoadDistribution { } } +// MaintenanceTestCategory - The type of maintenance that can occur during an ExpressRoute failover test. +type MaintenanceTestCategory string + +const ( + // MaintenanceTestCategoryASPathPrepend - AS path prepend test category. + MaintenanceTestCategoryASPathPrepend MaintenanceTestCategory = "ASPathPrepend" + // MaintenanceTestCategoryBgpDisconnect - BGP disconnect test category. + MaintenanceTestCategoryBgpDisconnect MaintenanceTestCategory = "BgpDisconnect" +) + +// PossibleMaintenanceTestCategoryValues returns the possible values for the MaintenanceTestCategory const type. +func PossibleMaintenanceTestCategoryValues() []MaintenanceTestCategory { + return []MaintenanceTestCategory{ + MaintenanceTestCategoryASPathPrepend, + MaintenanceTestCategoryBgpDisconnect, + } +} + // ManagedRuleEnabledState - The state of the managed rule. Defaults to Disabled if not specified. type ManagedRuleEnabledState string const ( + // ManagedRuleEnabledStateDisabled - Disabled ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" + // ManagedRuleEnabledStateEnabled - Enabled + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" ) // PossibleManagedRuleEnabledStateValues returns the possible values for the ManagedRuleEnabledState const type. @@ -2983,11 +3574,34 @@ func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { } } +// Nat64State - Whether Nat64 is enabled for the NAT gateway resource. +type Nat64State string + +const ( + // Nat64StateDisabled - Nat64 is disabled. + Nat64StateDisabled Nat64State = "Disabled" + // Nat64StateEnabled - Nat64 is enabled. + Nat64StateEnabled Nat64State = "Enabled" + // Nat64StateNone - Nat64 Property is not set. + Nat64StateNone Nat64State = "None" +) + +// PossibleNat64StateValues returns the possible values for the Nat64State const type. +func PossibleNat64StateValues() []Nat64State { + return []Nat64State{ + Nat64StateDisabled, + Nat64StateEnabled, + Nat64StateNone, + } +} + // NatGatewaySKUName - Name of Nat Gateway SKU. type NatGatewaySKUName string const ( - NatGatewaySKUNameStandard NatGatewaySKUName = "Standard" + // NatGatewaySKUNameStandard - Standard + NatGatewaySKUNameStandard NatGatewaySKUName = "Standard" + // NatGatewaySKUNameStandardV2 - StandardV2 NatGatewaySKUNameStandardV2 NatGatewaySKUName = "StandardV2" ) @@ -3003,9 +3617,12 @@ func PossibleNatGatewaySKUNameValues() []NatGatewaySKUName { type NetworkIntentPolicyBasedService string const ( - NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" + // NetworkIntentPolicyBasedServiceAll - All + NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" + // NetworkIntentPolicyBasedServiceAllowRulesOnly - AllowRulesOnly NetworkIntentPolicyBasedServiceAllowRulesOnly NetworkIntentPolicyBasedService = "AllowRulesOnly" - NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" + // NetworkIntentPolicyBasedServiceNone - None + NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" ) // PossibleNetworkIntentPolicyBasedServiceValues returns the possible values for the NetworkIntentPolicyBasedService const type. @@ -3021,10 +3638,14 @@ func PossibleNetworkIntentPolicyBasedServiceValues() []NetworkIntentPolicyBasedS type NetworkInterfaceAuxiliaryMode string const ( + // NetworkInterfaceAuxiliaryModeAcceleratedConnections - AcceleratedConnections NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" + // NetworkInterfaceAuxiliaryModeFloating - Floating + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + // NetworkInterfaceAuxiliaryModeMaxConnections - MaxConnections + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + // NetworkInterfaceAuxiliaryModeNone - None + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" ) // PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type. @@ -3041,10 +3662,15 @@ func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMo type NetworkInterfaceAuxiliarySKU string const ( - NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1" - NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2" - NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4" - NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8" + // NetworkInterfaceAuxiliarySKUA1 - A1 + NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1" + // NetworkInterfaceAuxiliarySKUA2 - A2 + NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2" + // NetworkInterfaceAuxiliarySKUA4 - A4 + NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4" + // NetworkInterfaceAuxiliarySKUA8 - A8 + NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8" + // NetworkInterfaceAuxiliarySKUNone - None NetworkInterfaceAuxiliarySKUNone NetworkInterfaceAuxiliarySKU = "None" ) @@ -3063,11 +3689,16 @@ func PossibleNetworkInterfaceAuxiliarySKUValues() []NetworkInterfaceAuxiliarySKU type NetworkInterfaceMigrationPhase string const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + // NetworkInterfaceMigrationPhaseAbort - Abort + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + // NetworkInterfaceMigrationPhaseCommit - Commit + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + // NetworkInterfaceMigrationPhaseCommitted - Committed NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" + // NetworkInterfaceMigrationPhaseNone - None + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + // NetworkInterfaceMigrationPhasePrepare - Prepare + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" ) // PossibleNetworkInterfaceMigrationPhaseValues returns the possible values for the NetworkInterfaceMigrationPhase const type. @@ -3085,7 +3716,9 @@ func PossibleNetworkInterfaceMigrationPhaseValues() []NetworkInterfaceMigrationP type NetworkInterfaceNicType string const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + // NetworkInterfaceNicTypeElastic - Elastic + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + // NetworkInterfaceNicTypeStandard - Standard NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" ) @@ -3097,32 +3730,18 @@ func PossibleNetworkInterfaceNicTypeValues() []NetworkInterfaceNicType { } } -// NetworkOperationStatus - Status of the Azure async operation. -type NetworkOperationStatus string - -const ( - NetworkOperationStatusFailed NetworkOperationStatus = "Failed" - NetworkOperationStatusInProgress NetworkOperationStatus = "InProgress" - NetworkOperationStatusSucceeded NetworkOperationStatus = "Succeeded" -) - -// PossibleNetworkOperationStatusValues returns the possible values for the NetworkOperationStatus const type. -func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { - return []NetworkOperationStatus{ - NetworkOperationStatusFailed, - NetworkOperationStatusInProgress, - NetworkOperationStatusSucceeded, - } -} - // NetworkProtocol - Network Protocol. type NetworkProtocol string const ( - NetworkProtocolAny NetworkProtocol = "Any" + // NetworkProtocolAny - Any + NetworkProtocolAny NetworkProtocol = "Any" + // NetworkProtocolICMP - ICMP NetworkProtocolICMP NetworkProtocol = "ICMP" - NetworkProtocolTCP NetworkProtocol = "TCP" - NetworkProtocolUDP NetworkProtocol = "UDP" + // NetworkProtocolTCP - TCP + NetworkProtocolTCP NetworkProtocol = "TCP" + // NetworkProtocolUDP - UDP + NetworkProtocolUDP NetworkProtocol = "UDP" ) // PossibleNetworkProtocolValues returns the possible values for the NetworkProtocol const type. @@ -3139,12 +3758,21 @@ func PossibleNetworkProtocolValues() []NetworkProtocol { type NextHopType string const ( - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - NextHopTypeInternet NextHopType = "Internet" - NextHopTypeNone NextHopType = "None" - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" + // NextHopTypeHyperNetGateway - HyperNetGateway + NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" + // NextHopTypeInternet - Internet + NextHopTypeInternet NextHopType = "Internet" + // NextHopTypeNone - No next hop type. + NextHopTypeNone NextHopType = "None" + // NextHopTypeVirtualAppliance - VirtualAppliance + NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" + // NextHopTypeVirtualApplianceEcmp - Routes traffic to virtual appliances using Equal-Cost Multi-Path (ECMP) routing with + // multiple next hop IP addresses. + NextHopTypeVirtualApplianceEcmp NextHopType = "VirtualApplianceEcmp" + // NextHopTypeVirtualNetworkGateway - VirtualNetworkGateway NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - NextHopTypeVnetLocal NextHopType = "VnetLocal" + // NextHopTypeVnetLocal - VnetLocal + NextHopTypeVnetLocal NextHopType = "VnetLocal" ) // PossibleNextHopTypeValues returns the possible values for the NextHopType const type. @@ -3154,6 +3782,7 @@ func PossibleNextHopTypeValues() []NextHopType { NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, + NextHopTypeVirtualApplianceEcmp, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal, } @@ -3163,9 +3792,12 @@ func PossibleNextHopTypeValues() []NextHopType { type NextStep string const ( - NextStepContinue NextStep = "Continue" + // NextStepContinue - Continue + NextStepContinue NextStep = "Continue" + // NextStepTerminate - Terminate NextStepTerminate NextStep = "Terminate" - NextStepUnknown NextStep = "Unknown" + // NextStepUnknown - Unknown + NextStepUnknown NextStep = "Unknown" ) // PossibleNextStepValues returns the possible values for the NextStep const type. @@ -3181,8 +3813,10 @@ func PossibleNextStepValues() []NextStep { type NicTypeInRequest string const ( + // NicTypeInRequestPrivateNic - PrivateNic NicTypeInRequestPrivateNic NicTypeInRequest = "PrivateNic" - NicTypeInRequestPublicNic NicTypeInRequest = "PublicNic" + // NicTypeInRequestPublicNic - PublicNic + NicTypeInRequestPublicNic NicTypeInRequest = "PublicNic" ) // PossibleNicTypeInRequestValues returns the possible values for the NicTypeInRequest const type. @@ -3198,9 +3832,12 @@ func PossibleNicTypeInRequestValues() []NicTypeInRequest { type NicTypeInResponse string const ( + // NicTypeInResponseAdditionalNic - AdditionalNic NicTypeInResponseAdditionalNic NicTypeInResponse = "AdditionalNic" - NicTypeInResponsePrivateNic NicTypeInResponse = "PrivateNic" - NicTypeInResponsePublicNic NicTypeInResponse = "PublicNic" + // NicTypeInResponsePrivateNic - PrivateNic + NicTypeInResponsePrivateNic NicTypeInResponse = "PrivateNic" + // NicTypeInResponsePublicNic - PublicNic + NicTypeInResponsePublicNic NicTypeInResponse = "PublicNic" ) // PossibleNicTypeInResponseValues returns the possible values for the NicTypeInResponse const type. @@ -3216,12 +3853,19 @@ func PossibleNicTypeInResponseValues() []NicTypeInResponse { type NspLinkProvisioningState string const ( - NspLinkProvisioningStateAccepted NspLinkProvisioningState = "Accepted" - NspLinkProvisioningStateCreating NspLinkProvisioningState = "Creating" - NspLinkProvisioningStateDeleting NspLinkProvisioningState = "Deleting" - NspLinkProvisioningStateFailed NspLinkProvisioningState = "Failed" - NspLinkProvisioningStateSucceeded NspLinkProvisioningState = "Succeeded" - NspLinkProvisioningStateUpdating NspLinkProvisioningState = "Updating" + // NspLinkProvisioningStateAccepted - Accepted + NspLinkProvisioningStateAccepted NspLinkProvisioningState = "Accepted" + // NspLinkProvisioningStateCreating - Creating + NspLinkProvisioningStateCreating NspLinkProvisioningState = "Creating" + // NspLinkProvisioningStateDeleting - Deleting + NspLinkProvisioningStateDeleting NspLinkProvisioningState = "Deleting" + // NspLinkProvisioningStateFailed - Failed + NspLinkProvisioningStateFailed NspLinkProvisioningState = "Failed" + // NspLinkProvisioningStateSucceeded - Succeeded + NspLinkProvisioningStateSucceeded NspLinkProvisioningState = "Succeeded" + // NspLinkProvisioningStateUpdating - Updating + NspLinkProvisioningStateUpdating NspLinkProvisioningState = "Updating" + // NspLinkProvisioningStateWaitForRemoteCompletion - WaitForRemoteCompletion NspLinkProvisioningStateWaitForRemoteCompletion NspLinkProvisioningState = "WaitForRemoteCompletion" ) @@ -3242,10 +3886,14 @@ func PossibleNspLinkProvisioningStateValues() []NspLinkProvisioningState { type NspLinkStatus string const ( - NspLinkStatusApproved NspLinkStatus = "Approved" + // NspLinkStatusApproved - Approved + NspLinkStatusApproved NspLinkStatus = "Approved" + // NspLinkStatusDisconnected - Disconnected NspLinkStatusDisconnected NspLinkStatus = "Disconnected" - NspLinkStatusPending NspLinkStatus = "Pending" - NspLinkStatusRejected NspLinkStatus = "Rejected" + // NspLinkStatusPending - Pending + NspLinkStatusPending NspLinkStatus = "Pending" + // NspLinkStatusRejected - Rejected + NspLinkStatusRejected NspLinkStatus = "Rejected" ) // PossibleNspLinkStatusValues returns the possible values for the NspLinkStatus const type. @@ -3262,12 +3910,18 @@ func PossibleNspLinkStatusValues() []NspLinkStatus { type NspProvisioningState string const ( - NspProvisioningStateAccepted NspProvisioningState = "Accepted" - NspProvisioningStateCreating NspProvisioningState = "Creating" - NspProvisioningStateDeleting NspProvisioningState = "Deleting" - NspProvisioningStateFailed NspProvisioningState = "Failed" + // NspProvisioningStateAccepted - Accepted + NspProvisioningStateAccepted NspProvisioningState = "Accepted" + // NspProvisioningStateCreating - Creating + NspProvisioningStateCreating NspProvisioningState = "Creating" + // NspProvisioningStateDeleting - Deleting + NspProvisioningStateDeleting NspProvisioningState = "Deleting" + // NspProvisioningStateFailed - Failed + NspProvisioningStateFailed NspProvisioningState = "Failed" + // NspProvisioningStateSucceeded - Succeeded NspProvisioningStateSucceeded NspProvisioningState = "Succeeded" - NspProvisioningStateUpdating NspProvisioningState = "Updating" + // NspProvisioningStateUpdating - Updating + NspProvisioningStateUpdating NspProvisioningState = "Updating" ) // PossibleNspProvisioningStateValues returns the possible values for the NspProvisioningState const type. @@ -3282,6 +3936,30 @@ func PossibleNspProvisioningStateValues() []NspProvisioningState { } } +// NspReadinessState - The readiness state of the resource type for NSP support. +type NspReadinessState string + +const ( + // NspReadinessStateGA - Resource Provider is generally available for NSP Integration + NspReadinessStateGA NspReadinessState = "GA" + // NspReadinessStateNotReady - NSP Onboarding is not started or not Supported + NspReadinessStateNotReady NspReadinessState = "NotReady" + // NspReadinessStateOnboarding - Resource Provider is actively being onboarded to NSP + NspReadinessStateOnboarding NspReadinessState = "Onboarding" + // NspReadinessStatePreview - Resource Provider supports NSP in Preview + NspReadinessStatePreview NspReadinessState = "Preview" +) + +// PossibleNspReadinessStateValues returns the possible values for the NspReadinessState const type. +func PossibleNspReadinessStateValues() []NspReadinessState { + return []NspReadinessState{ + NspReadinessStateGA, + NspReadinessStateNotReady, + NspReadinessStateOnboarding, + NspReadinessStatePreview, + } +} + type NvaNicType string const ( @@ -3309,9 +3987,13 @@ func PossibleNvaNicTypeValues() []NvaNicType { type OfficeTrafficCategory string const ( - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + // OfficeTrafficCategoryAll - All + OfficeTrafficCategoryAll OfficeTrafficCategory = "All" + // OfficeTrafficCategoryNone - None + OfficeTrafficCategoryNone OfficeTrafficCategory = "None" + // OfficeTrafficCategoryOptimize - Optimize + OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + // OfficeTrafficCategoryOptimizeAndAllow - OptimizeAndAllow OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" ) @@ -3329,8 +4011,11 @@ func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { type Origin string const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" + // OriginInbound - Inbound + OriginInbound Origin = "Inbound" + // OriginLocal - Local + OriginLocal Origin = "Local" + // OriginOutbound - Outbound OriginOutbound Origin = "Outbound" ) @@ -3347,6 +4032,7 @@ func PossibleOriginValues() []Origin { type OutputType string const ( + // OutputTypeWorkspace - Workspace OutputTypeWorkspace OutputType = "Workspace" ) @@ -3361,14 +4047,23 @@ func PossibleOutputTypeValues() []OutputType { type OwaspCrsExclusionEntryMatchVariable string const ( - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + // OwaspCrsExclusionEntryMatchVariableRequestArgKeys - RequestArgKeys + OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" + // OwaspCrsExclusionEntryMatchVariableRequestArgNames - RequestArgNames + OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + // OwaspCrsExclusionEntryMatchVariableRequestArgValues - RequestArgValues + OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" + // OwaspCrsExclusionEntryMatchVariableRequestCookieKeys - RequestCookieKeys + OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" + // OwaspCrsExclusionEntryMatchVariableRequestCookieNames - RequestCookieNames + OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + // OwaspCrsExclusionEntryMatchVariableRequestCookieValues - RequestCookieValues OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys - RequestHeaderKeys + OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderNames - RequestHeaderNames + OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderValues - RequestHeaderValues OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" ) @@ -3392,10 +4087,15 @@ func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntr type OwaspCrsExclusionEntrySelectorMatchOperator string const ( - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" + // OwaspCrsExclusionEntrySelectorMatchOperatorContains - Contains + OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" + // OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith - EndsWith + OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" + // OwaspCrsExclusionEntrySelectorMatchOperatorEquals - Equals + OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" + // OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny - EqualsAny + OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" + // OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith - StartsWith OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" ) @@ -3414,7 +4114,9 @@ func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclu type PacketCaptureTargetType string const ( - PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" + // PacketCaptureTargetTypeAzureVM - AzureVM + PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" + // PacketCaptureTargetTypeAzureVMSS - AzureVMSS PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" ) @@ -3429,11 +4131,16 @@ func PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType { type PcError string const ( - PcErrorAgentStopped PcError = "AgentStopped" - PcErrorCaptureFailed PcError = "CaptureFailed" - PcErrorInternalError PcError = "InternalError" + // PcErrorAgentStopped - AgentStopped + PcErrorAgentStopped PcError = "AgentStopped" + // PcErrorCaptureFailed - CaptureFailed + PcErrorCaptureFailed PcError = "CaptureFailed" + // PcErrorInternalError - InternalError + PcErrorInternalError PcError = "InternalError" + // PcErrorLocalFileFailed - LocalFileFailed PcErrorLocalFileFailed PcError = "LocalFileFailed" - PcErrorStorageFailed PcError = "StorageFailed" + // PcErrorStorageFailed - StorageFailed + PcErrorStorageFailed PcError = "StorageFailed" ) // PossiblePcErrorValues returns the possible values for the PcError const type. @@ -3451,8 +4158,11 @@ func PossiblePcErrorValues() []PcError { type PcProtocol string const ( + // PcProtocolAny - Any PcProtocolAny PcProtocol = "Any" + // PcProtocolTCP - TCP PcProtocolTCP PcProtocol = "TCP" + // PcProtocolUDP - UDP PcProtocolUDP PcProtocol = "UDP" ) @@ -3469,11 +4179,16 @@ func PossiblePcProtocolValues() []PcProtocol { type PcStatus string const ( - PcStatusError PcStatus = "Error" + // PcStatusError - Error + PcStatusError PcStatus = "Error" + // PcStatusNotStarted - NotStarted PcStatusNotStarted PcStatus = "NotStarted" - PcStatusRunning PcStatus = "Running" - PcStatusStopped PcStatus = "Stopped" - PcStatusUnknown PcStatus = "Unknown" + // PcStatusRunning - Running + PcStatusRunning PcStatus = "Running" + // PcStatusStopped - Stopped + PcStatusStopped PcStatus = "Stopped" + // PcStatusUnknown - Unknown + PcStatusUnknown PcStatus = "Unknown" ) // PossiblePcStatusValues returns the possible values for the PcStatus const type. @@ -3511,15 +4226,24 @@ func PossiblePeeringEnforcementValues() []PeeringEnforcement { type PfsGroup string const ( - PfsGroupECP256 PfsGroup = "ECP256" - PfsGroupECP384 PfsGroup = "ECP384" - PfsGroupNone PfsGroup = "None" - PfsGroupPFS1 PfsGroup = "PFS1" - PfsGroupPFS14 PfsGroup = "PFS14" - PfsGroupPFS2 PfsGroup = "PFS2" + // PfsGroupECP256 - ECP256 + PfsGroupECP256 PfsGroup = "ECP256" + // PfsGroupECP384 - ECP384 + PfsGroupECP384 PfsGroup = "ECP384" + // PfsGroupNone - None + PfsGroupNone PfsGroup = "None" + // PfsGroupPFS1 - PFS1 + PfsGroupPFS1 PfsGroup = "PFS1" + // PfsGroupPFS14 - PFS14 + PfsGroupPFS14 PfsGroup = "PFS14" + // PfsGroupPFS2 - PFS2 + PfsGroupPFS2 PfsGroup = "PFS2" + // PfsGroupPFS2048 - PFS2048 PfsGroupPFS2048 PfsGroup = "PFS2048" - PfsGroupPFS24 PfsGroup = "PFS24" - PfsGroupPFSMM PfsGroup = "PFSMM" + // PfsGroupPFS24 - PFS24 + PfsGroupPFS24 PfsGroup = "PFS24" + // PfsGroupPFSMM - PFSMM + PfsGroupPFSMM PfsGroup = "PFSMM" ) // PossiblePfsGroupValues returns the possible values for the PfsGroup const type. @@ -3542,7 +4266,9 @@ func PossiblePfsGroupValues() []PfsGroup { type PreferredIPVersion string const ( + // PreferredIPVersionIPv4 - IPv4 PreferredIPVersionIPv4 PreferredIPVersion = "IPv4" + // PreferredIPVersionIPv6 - IPv6 PreferredIPVersionIPv6 PreferredIPVersion = "IPv6" ) @@ -3558,9 +4284,12 @@ func PossiblePreferredIPVersionValues() []PreferredIPVersion { type PreferredRoutingGateway string const ( + // PreferredRoutingGatewayExpressRoute - ExpressRoute PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - PreferredRoutingGatewayVPNGateway PreferredRoutingGateway = "VpnGateway" + // PreferredRoutingGatewayNone - None + PreferredRoutingGatewayNone PreferredRoutingGateway = "None" + // PreferredRoutingGatewayVPNGateway - VpnGateway + PreferredRoutingGatewayVPNGateway PreferredRoutingGateway = "VpnGateway" ) // PossiblePreferredRoutingGatewayValues returns the possible values for the PreferredRoutingGateway const type. @@ -3572,6 +4301,24 @@ func PossiblePreferredRoutingGatewayValues() []PreferredRoutingGateway { } } +// PrivateEndpointBillingSKU - The billing sku of the private endpoint. +type PrivateEndpointBillingSKU string + +const ( + // PrivateEndpointBillingSKUFixed - Fixed sku is best for high data processing private endpoints. + PrivateEndpointBillingSKUFixed PrivateEndpointBillingSKU = "Fixed" + // PrivateEndpointBillingSKUPayAsYouGo - PayAsYouGo sku is the default price for private endpoints. + PrivateEndpointBillingSKUPayAsYouGo PrivateEndpointBillingSKU = "PayAsYouGo" +) + +// PossiblePrivateEndpointBillingSKUValues returns the possible values for the PrivateEndpointBillingSKU const type. +func PossiblePrivateEndpointBillingSKUValues() []PrivateEndpointBillingSKU { + return []PrivateEndpointBillingSKU{ + PrivateEndpointBillingSKUFixed, + PrivateEndpointBillingSKUPayAsYouGo, + } +} + // PrivateEndpointIPVersionType - Specifies the IP version type for the private IPs of the private endpoint. If not defined, // this defaults to IPv4. type PrivateEndpointIPVersionType string @@ -3598,7 +4345,9 @@ func PossiblePrivateEndpointIPVersionTypeValues() []PrivateEndpointIPVersionType type PrivateEndpointVNetPolicies string const ( - PrivateEndpointVNetPoliciesBasic PrivateEndpointVNetPolicies = "Basic" + // PrivateEndpointVNetPoliciesBasic - Basic + PrivateEndpointVNetPoliciesBasic PrivateEndpointVNetPolicies = "Basic" + // PrivateEndpointVNetPoliciesDisabled - Disabled PrivateEndpointVNetPoliciesDisabled PrivateEndpointVNetPolicies = "Disabled" ) @@ -3631,14 +4380,16 @@ func PossibleProbeNoHealthyBackendsBehaviorValues() []ProbeNoHealthyBackendsBeha } // ProbeProtocol - The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. -// If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required -// for the probe to be successful. +// If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. type ProbeProtocol string const ( - ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTP - Http + ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS - Https ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTCP ProbeProtocol = "Tcp" + // ProbeProtocolTCP - Tcp + ProbeProtocolTCP ProbeProtocol = "Tcp" ) // PossibleProbeProtocolValues returns the possible values for the ProbeProtocol const type. @@ -3654,8 +4405,10 @@ func PossibleProbeProtocolValues() []ProbeProtocol { type ProcessorArchitecture string const ( + // ProcessorArchitectureAmd64 - Amd64 ProcessorArchitectureAmd64 ProcessorArchitecture = "Amd64" - ProcessorArchitectureX86 ProcessorArchitecture = "X86" + // ProcessorArchitectureX86 - X86 + ProcessorArchitectureX86 ProcessorArchitecture = "X86" ) // PossibleProcessorArchitectureValues returns the possible values for the ProcessorArchitecture const type. @@ -3670,10 +4423,14 @@ func PossibleProcessorArchitectureValues() []ProcessorArchitecture { type Protocol string const ( - ProtocolHTTP Protocol = "Http" + // ProtocolHTTP - Http + ProtocolHTTP Protocol = "Http" + // ProtocolHTTPS - Https ProtocolHTTPS Protocol = "Https" - ProtocolIcmp Protocol = "Icmp" - ProtocolTCP Protocol = "Tcp" + // ProtocolIcmp - Icmp + ProtocolIcmp Protocol = "Icmp" + // ProtocolTCP - Tcp + ProtocolTCP Protocol = "Tcp" ) // PossibleProtocolValues returns the possible values for the Protocol const type. @@ -3690,15 +4447,24 @@ func PossibleProtocolValues() []Protocol { type ProtocolType string const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" + // ProtocolTypeAh - Ah + ProtocolTypeAh ProtocolType = "Ah" + // ProtocolTypeAll - All + ProtocolTypeAll ProtocolType = "All" + // ProtocolTypeDoNotUse - DoNotUse ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTCP ProtocolType = "Tcp" - ProtocolTypeUDP ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" + // ProtocolTypeEsp - Esp + ProtocolTypeEsp ProtocolType = "Esp" + // ProtocolTypeGre - Gre + ProtocolTypeGre ProtocolType = "Gre" + // ProtocolTypeIcmp - Icmp + ProtocolTypeIcmp ProtocolType = "Icmp" + // ProtocolTypeTCP - Tcp + ProtocolTypeTCP ProtocolType = "Tcp" + // ProtocolTypeUDP - Udp + ProtocolTypeUDP ProtocolType = "Udp" + // ProtocolTypeVxlan - Vxlan + ProtocolTypeVxlan ProtocolType = "Vxlan" ) // PossibleProtocolTypeValues returns the possible values for the ProtocolType const type. @@ -3720,12 +4486,18 @@ func PossibleProtocolTypeValues() []ProtocolType { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateCanceled - Canceled + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating - Creating + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting - Deleting + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Failed + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded - Succeeded ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateUpdating - Updating + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -3742,15 +4514,18 @@ func PossibleProvisioningStateValues() []ProvisioningState { // PublicIPAddressDNSSettingsDomainNameLabelScope - The domain name label scope. If a domain name label and a domain name // label scope are specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system with a hashed -// value -// includes in FQDN. +// value includes in FQDN. type PublicIPAddressDNSSettingsDomainNameLabelScope string const ( - PublicIPAddressDNSSettingsDomainNameLabelScopeNoReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "NoReuse" + // PublicIPAddressDNSSettingsDomainNameLabelScopeNoReuse - NoReuse + PublicIPAddressDNSSettingsDomainNameLabelScopeNoReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "NoReuse" + // PublicIPAddressDNSSettingsDomainNameLabelScopeResourceGroupReuse - ResourceGroupReuse PublicIPAddressDNSSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDNSSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "TenantReuse" + // PublicIPAddressDNSSettingsDomainNameLabelScopeSubscriptionReuse - SubscriptionReuse + PublicIPAddressDNSSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "SubscriptionReuse" + // PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse - TenantReuse + PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDNSSettingsDomainNameLabelScope = "TenantReuse" ) // PossiblePublicIPAddressDNSSettingsDomainNameLabelScopeValues returns the possible values for the PublicIPAddressDNSSettingsDomainNameLabelScope const type. @@ -3767,11 +4542,16 @@ func PossiblePublicIPAddressDNSSettingsDomainNameLabelScopeValues() []PublicIPAd type PublicIPAddressMigrationPhase string const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + // PublicIPAddressMigrationPhaseAbort - Abort + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + // PublicIPAddressMigrationPhaseCommit - Commit + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + // PublicIPAddressMigrationPhaseCommitted - Committed PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" + // PublicIPAddressMigrationPhaseNone - None + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + // PublicIPAddressMigrationPhasePrepare - Prepare + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" ) // PossiblePublicIPAddressMigrationPhaseValues returns the possible values for the PublicIPAddressMigrationPhase const type. @@ -3789,8 +4569,11 @@ func PossiblePublicIPAddressMigrationPhaseValues() []PublicIPAddressMigrationPha type PublicIPAddressSKUName string const ( - PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" - PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" + // PublicIPAddressSKUNameBasic - Basic + PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" + // PublicIPAddressSKUNameStandard - Standard + PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" + // PublicIPAddressSKUNameStandardV2 - StandardV2 PublicIPAddressSKUNameStandardV2 PublicIPAddressSKUName = "StandardV2" ) @@ -3807,7 +4590,9 @@ func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { type PublicIPAddressSKUTier string const ( - PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" + // PublicIPAddressSKUTierGlobal - Global + PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" + // PublicIPAddressSKUTierRegional - Regional PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" ) @@ -3823,7 +4608,9 @@ func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { type PublicIPPrefixSKUName string const ( - PublicIPPrefixSKUNameStandard PublicIPPrefixSKUName = "Standard" + // PublicIPPrefixSKUNameStandard - Standard + PublicIPPrefixSKUNameStandard PublicIPPrefixSKUName = "Standard" + // PublicIPPrefixSKUNameStandardV2 - StandardV2 PublicIPPrefixSKUNameStandardV2 PublicIPPrefixSKUName = "StandardV2" ) @@ -3839,7 +4626,9 @@ func PossiblePublicIPPrefixSKUNameValues() []PublicIPPrefixSKUName { type PublicIPPrefixSKUTier string const ( - PublicIPPrefixSKUTierGlobal PublicIPPrefixSKUTier = "Global" + // PublicIPPrefixSKUTierGlobal - Global + PublicIPPrefixSKUTierGlobal PublicIPPrefixSKUTier = "Global" + // PublicIPPrefixSKUTierRegional - Regional PublicIPPrefixSKUTierRegional PublicIPPrefixSKUTier = "Regional" ) @@ -3855,7 +4644,9 @@ func PossiblePublicIPPrefixSKUTierValues() []PublicIPPrefixSKUTier { type ResiliencyModel string const ( - ResiliencyModelMultiHomed ResiliencyModel = "MultiHomed" + // ResiliencyModelMultiHomed - MultiHomed + ResiliencyModelMultiHomed ResiliencyModel = "MultiHomed" + // ResiliencyModelSingleHomed - SingleHomed ResiliencyModelSingleHomed ResiliencyModel = "SingleHomed" ) @@ -3868,15 +4659,19 @@ func PossibleResiliencyModelValues() []ResiliencyModel { } // ResourceIdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both -// an implicitly created identity and a set of user assigned identities. The type 'None' will remove any -// identities from the virtual machine. +// an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the +// virtual machine. type ResourceIdentityType string const ( - ResourceIdentityTypeNone ResourceIdentityType = "None" - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeNone - None + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned - SystemAssigned + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned - SystemAssigned, UserAssigned ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" + // ResourceIdentityTypeUserAssigned - UserAssigned + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ) // PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. @@ -3893,6 +4688,7 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { type RouteFilterRuleType string const ( + // RouteFilterRuleTypeCommunity - Community RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" ) @@ -3908,10 +4704,15 @@ func PossibleRouteFilterRuleTypeValues() []RouteFilterRuleType { type RouteMapActionType string const ( - RouteMapActionTypeAdd RouteMapActionType = "Add" - RouteMapActionTypeDrop RouteMapActionType = "Drop" - RouteMapActionTypeRemove RouteMapActionType = "Remove" + // RouteMapActionTypeAdd - Add + RouteMapActionTypeAdd RouteMapActionType = "Add" + // RouteMapActionTypeDrop - Drop + RouteMapActionTypeDrop RouteMapActionType = "Drop" + // RouteMapActionTypeRemove - Remove + RouteMapActionTypeRemove RouteMapActionType = "Remove" + // RouteMapActionTypeReplace - Replace RouteMapActionTypeReplace RouteMapActionType = "Replace" + // RouteMapActionTypeUnknown - Unknown RouteMapActionTypeUnknown RouteMapActionType = "Unknown" ) @@ -3930,11 +4731,16 @@ func PossibleRouteMapActionTypeValues() []RouteMapActionType { type RouteMapMatchCondition string const ( - RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" - RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" + // RouteMapMatchConditionContains - Contains + RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" + // RouteMapMatchConditionEquals - Equals + RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" + // RouteMapMatchConditionNotContains - NotContains RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" - RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" - RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" + // RouteMapMatchConditionNotEquals - NotEquals + RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" + // RouteMapMatchConditionUnknown - Unknown + RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" ) // PossibleRouteMapMatchConditionValues returns the possible values for the RouteMapMatchCondition const type. @@ -3952,11 +4758,19 @@ func PossibleRouteMapMatchConditionValues() []RouteMapMatchCondition { type RouteNextHopType string const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + // RouteNextHopTypeInternet - Internet + RouteNextHopTypeInternet RouteNextHopType = "Internet" + // RouteNextHopTypeNone - No next hop type. + RouteNextHopTypeNone RouteNextHopType = "None" + // RouteNextHopTypeVirtualAppliance - VirtualAppliance + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + // RouteNextHopTypeVirtualApplianceEcmp - Routes traffic to virtual appliances using Equal-Cost Multi-Path (ECMP) routing + // with multiple next hop IP addresses. + RouteNextHopTypeVirtualApplianceEcmp RouteNextHopType = "VirtualApplianceEcmp" + // RouteNextHopTypeVirtualNetworkGateway - VirtualNetworkGateway RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" + // RouteNextHopTypeVnetLocal - VnetLocal + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" ) // PossibleRouteNextHopTypeValues returns the possible values for the RouteNextHopType const type. @@ -3965,6 +4779,7 @@ func PossibleRouteNextHopTypeValues() []RouteNextHopType { RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, + RouteNextHopTypeVirtualApplianceEcmp, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal, } @@ -4038,9 +4853,13 @@ func PossibleRoutingRuleNextHopTypeValues() []RoutingRuleNextHopType { type RoutingState string const ( - RoutingStateFailed RoutingState = "Failed" - RoutingStateNone RoutingState = "None" - RoutingStateProvisioned RoutingState = "Provisioned" + // RoutingStateFailed - Failed + RoutingStateFailed RoutingState = "Failed" + // RoutingStateNone - None + RoutingStateNone RoutingState = "None" + // RoutingStateProvisioned - Provisioned + RoutingStateProvisioned RoutingState = "Provisioned" + // RoutingStateProvisioning - Provisioning RoutingStateProvisioning RoutingState = "Provisioning" ) @@ -4058,11 +4877,16 @@ func PossibleRoutingStateValues() []RoutingState { type ScopeConnectionState string const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" + // ScopeConnectionStateConflict - Conflict + ScopeConnectionStateConflict ScopeConnectionState = "Conflict" + // ScopeConnectionStateConnected - Connected ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" + // ScopeConnectionStatePending - Pending + ScopeConnectionStatePending ScopeConnectionState = "Pending" + // ScopeConnectionStateRejected - Rejected + ScopeConnectionStateRejected ScopeConnectionState = "Rejected" + // ScopeConnectionStateRevoked - Revoked + ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" ) // PossibleScopeConnectionStateValues returns the possible values for the ScopeConnectionState const type. @@ -4081,7 +4905,9 @@ func PossibleScopeConnectionStateValues() []ScopeConnectionState { type ScrubbingRuleEntryMatchOperator string const ( - ScrubbingRuleEntryMatchOperatorEquals ScrubbingRuleEntryMatchOperator = "Equals" + // ScrubbingRuleEntryMatchOperatorEquals - Equals + ScrubbingRuleEntryMatchOperatorEquals ScrubbingRuleEntryMatchOperator = "Equals" + // ScrubbingRuleEntryMatchOperatorEqualsAny - EqualsAny ScrubbingRuleEntryMatchOperatorEqualsAny ScrubbingRuleEntryMatchOperator = "EqualsAny" ) @@ -4097,11 +4923,17 @@ func PossibleScrubbingRuleEntryMatchOperatorValues() []ScrubbingRuleEntryMatchOp type ScrubbingRuleEntryMatchVariable string const ( - ScrubbingRuleEntryMatchVariableRequestArgNames ScrubbingRuleEntryMatchVariable = "RequestArgNames" - ScrubbingRuleEntryMatchVariableRequestCookieNames ScrubbingRuleEntryMatchVariable = "RequestCookieNames" - ScrubbingRuleEntryMatchVariableRequestHeaderNames ScrubbingRuleEntryMatchVariable = "RequestHeaderNames" - ScrubbingRuleEntryMatchVariableRequestIPAddress ScrubbingRuleEntryMatchVariable = "RequestIPAddress" + // ScrubbingRuleEntryMatchVariableRequestArgNames - RequestArgNames + ScrubbingRuleEntryMatchVariableRequestArgNames ScrubbingRuleEntryMatchVariable = "RequestArgNames" + // ScrubbingRuleEntryMatchVariableRequestCookieNames - RequestCookieNames + ScrubbingRuleEntryMatchVariableRequestCookieNames ScrubbingRuleEntryMatchVariable = "RequestCookieNames" + // ScrubbingRuleEntryMatchVariableRequestHeaderNames - RequestHeaderNames + ScrubbingRuleEntryMatchVariableRequestHeaderNames ScrubbingRuleEntryMatchVariable = "RequestHeaderNames" + // ScrubbingRuleEntryMatchVariableRequestIPAddress - RequestIPAddress + ScrubbingRuleEntryMatchVariableRequestIPAddress ScrubbingRuleEntryMatchVariable = "RequestIPAddress" + // ScrubbingRuleEntryMatchVariableRequestJSONArgNames - RequestJSONArgNames ScrubbingRuleEntryMatchVariableRequestJSONArgNames ScrubbingRuleEntryMatchVariable = "RequestJSONArgNames" + // ScrubbingRuleEntryMatchVariableRequestPostArgNames - RequestPostArgNames ScrubbingRuleEntryMatchVariableRequestPostArgNames ScrubbingRuleEntryMatchVariable = "RequestPostArgNames" ) @@ -4121,8 +4953,10 @@ func PossibleScrubbingRuleEntryMatchVariableValues() []ScrubbingRuleEntryMatchVa type ScrubbingRuleEntryState string const ( + // ScrubbingRuleEntryStateDisabled - Disabled ScrubbingRuleEntryStateDisabled ScrubbingRuleEntryState = "Disabled" - ScrubbingRuleEntryStateEnabled ScrubbingRuleEntryState = "Enabled" + // ScrubbingRuleEntryStateEnabled - Enabled + ScrubbingRuleEntryStateEnabled ScrubbingRuleEntryState = "Enabled" ) // PossibleScrubbingRuleEntryStateValues returns the possible values for the ScrubbingRuleEntryState const type. @@ -4137,9 +4971,12 @@ func PossibleScrubbingRuleEntryStateValues() []ScrubbingRuleEntryState { type SecurityConfigurationRuleAccess string const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" + // SecurityConfigurationRuleAccessAllow - Allow + SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" + // SecurityConfigurationRuleAccessAlwaysAllow - AlwaysAllow SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" + // SecurityConfigurationRuleAccessDeny - Deny + SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" ) // PossibleSecurityConfigurationRuleAccessValues returns the possible values for the SecurityConfigurationRuleAccess const type. @@ -4156,7 +4993,9 @@ func PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRule type SecurityConfigurationRuleDirection string const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" + // SecurityConfigurationRuleDirectionInbound - Inbound + SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" + // SecurityConfigurationRuleDirectionOutbound - Outbound SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" ) @@ -4172,12 +5011,18 @@ func PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationR type SecurityConfigurationRuleProtocol string const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" + // SecurityConfigurationRuleProtocolAh - Ah + SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" + // SecurityConfigurationRuleProtocolAny - Any + SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" + // SecurityConfigurationRuleProtocolEsp - Esp + SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" + // SecurityConfigurationRuleProtocolIcmp - Icmp SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" + // SecurityConfigurationRuleProtocolTCP - Tcp + SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" + // SecurityConfigurationRuleProtocolUDP - Udp + SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" ) // PossibleSecurityConfigurationRuleProtocolValues returns the possible values for the SecurityConfigurationRuleProtocol const type. @@ -4196,10 +5041,14 @@ func PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRu type SecurityPartnerProviderConnectionStatus string const ( - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" + // SecurityPartnerProviderConnectionStatusConnected - Connected + SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" + // SecurityPartnerProviderConnectionStatusNotConnected - NotConnected + SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" + // SecurityPartnerProviderConnectionStatusPartiallyConnected - PartiallyConnected SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" + // SecurityPartnerProviderConnectionStatusUnknown - Unknown + SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" ) // PossibleSecurityPartnerProviderConnectionStatusValues returns the possible values for the SecurityPartnerProviderConnectionStatus const type. @@ -4216,9 +5065,12 @@ func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerPr type SecurityProviderName string const ( + // SecurityProviderNameCheckpoint - Checkpoint SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" - SecurityProviderNameIBoss SecurityProviderName = "IBoss" - SecurityProviderNameZScaler SecurityProviderName = "ZScaler" + // SecurityProviderNameIBoss - IBoss + SecurityProviderNameIBoss SecurityProviderName = "IBoss" + // SecurityProviderNameZScaler - ZScaler + SecurityProviderNameZScaler SecurityProviderName = "ZScaler" ) // PossibleSecurityProviderNameValues returns the possible values for the SecurityProviderName const type. @@ -4234,8 +5086,10 @@ func PossibleSecurityProviderNameValues() []SecurityProviderName { type SecurityRuleAccess string const ( + // SecurityRuleAccessAllow - Allow SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" + // SecurityRuleAccessDeny - Deny + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" ) // PossibleSecurityRuleAccessValues returns the possible values for the SecurityRuleAccess const type. @@ -4251,7 +5105,9 @@ func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { type SecurityRuleDirection string const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + // SecurityRuleDirectionInbound - Inbound + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + // SecurityRuleDirectionOutbound - Outbound SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" ) @@ -4267,12 +5123,18 @@ func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { type SecurityRuleProtocol string const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + // SecurityRuleProtocolAh - Ah + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + // SecurityRuleProtocolAsterisk - * SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" + // SecurityRuleProtocolEsp - Esp + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + // SecurityRuleProtocolIcmp - Icmp + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + // SecurityRuleProtocolTCP - Tcp + SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" + // SecurityRuleProtocolUDP - Udp + SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" ) // PossibleSecurityRuleProtocolValues returns the possible values for the SecurityRuleProtocol const type. @@ -4291,8 +5153,11 @@ func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { type SensitivityType string const ( - SensitivityTypeHigh SensitivityType = "High" - SensitivityTypeLow SensitivityType = "Low" + // SensitivityTypeHigh - High + SensitivityTypeHigh SensitivityType = "High" + // SensitivityTypeLow - Low + SensitivityTypeLow SensitivityType = "Low" + // SensitivityTypeMedium - Medium SensitivityTypeMedium SensitivityType = "Medium" ) @@ -4309,6 +5174,7 @@ func PossibleSensitivityTypeValues() []SensitivityType { type ServiceGatewaySKUName string const ( + // ServiceGatewaySKUNameStandard - Standard ServiceGatewaySKUNameStandard ServiceGatewaySKUName = "Standard" ) @@ -4323,6 +5189,7 @@ func PossibleServiceGatewaySKUNameValues() []ServiceGatewaySKUName { type ServiceGatewaySKUTier string const ( + // ServiceGatewaySKUTierRegional - Regional ServiceGatewaySKUTierRegional ServiceGatewaySKUTier = "Regional" ) @@ -4337,10 +5204,14 @@ func PossibleServiceGatewaySKUTierValues() []ServiceGatewaySKUTier { type ServiceProviderProvisioningState string const ( + // ServiceProviderProvisioningStateDeprovisioning - Deprovisioning ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" + // ServiceProviderProvisioningStateNotProvisioned - NotProvisioned ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" + // ServiceProviderProvisioningStateProvisioned - Provisioned + ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" + // ServiceProviderProvisioningStateProvisioning - Provisioning + ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" ) // PossibleServiceProviderProvisioningStateValues returns the possible values for the ServiceProviderProvisioningState const type. @@ -4357,9 +5228,12 @@ func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvision type ServiceType string const ( - ServiceTypeInbound ServiceType = "Inbound" + // ServiceTypeInbound - Inbound + ServiceTypeInbound ServiceType = "Inbound" + // ServiceTypeInboundOutbound - InboundOutbound ServiceTypeInboundOutbound ServiceType = "InboundOutbound" - ServiceTypeOutbound ServiceType = "Outbound" + // ServiceTypeOutbound - Outbound + ServiceTypeOutbound ServiceType = "Outbound" ) // PossibleServiceTypeValues returns the possible values for the ServiceType const type. @@ -4372,13 +5246,15 @@ func PossibleServiceTypeValues() []ServiceType { } // ServiceUpdateAction - Specifies the type of update operation to perform on services within the service gateway. -// * FullUpdate: Replaces all existing services with the new list provided in the request. Any previously defined services +// - FullUpdate: Replaces all existing services with the new list provided in the request. Any previously defined services // not included will be removed. -// * PartialUpdate: Updates only the specified services. +// - PartialUpdate: Updates only the specified services. type ServiceUpdateAction string const ( - ServiceUpdateActionFullUpdate ServiceUpdateAction = "FullUpdate" + // ServiceUpdateActionFullUpdate - FullUpdate + ServiceUpdateActionFullUpdate ServiceUpdateAction = "FullUpdate" + // ServiceUpdateActionPartialUpdate - PartialUpdate ServiceUpdateActionPartialUpdate ServiceUpdateAction = "PartialUpdate" ) @@ -4394,7 +5270,9 @@ func PossibleServiceUpdateActionValues() []ServiceUpdateAction { type Severity string const ( - SeverityError Severity = "Error" + // SeverityError - Error + SeverityError Severity = "Error" + // SeverityWarning - Warning SeverityWarning Severity = "Warning" ) @@ -4407,13 +5285,14 @@ func PossibleSeverityValues() []Severity { } // SharingScope - Set this property to Tenant to allow sharing subnet with other subscriptions in your AAD tenant. This property -// can only be set if defaultOutboundAccess is set to false, both properties can only be set -// if subnet is empty. +// can only be set if defaultOutboundAccess is set to false, both properties can only be set if subnet is empty. type SharingScope string const ( + // SharingScopeDelegatedServices - DelegatedServices SharingScopeDelegatedServices SharingScope = "DelegatedServices" - SharingScopeTenant SharingScope = "Tenant" + // SharingScopeTenant - Tenant + SharingScopeTenant SharingScope = "Tenant" ) // PossibleSharingScopeValues returns the possible values for the SharingScope const type. @@ -4428,8 +5307,10 @@ func PossibleSharingScopeValues() []SharingScope { type SlotType string const ( + // SlotTypeProduction - Production SlotTypeProduction SlotType = "Production" - SlotTypeStaging SlotType = "Staging" + // SlotTypeStaging - Staging + SlotTypeStaging SlotType = "Staging" ) // PossibleSlotTypeValues returns the possible values for the SlotType const type. @@ -4440,12 +5321,32 @@ func PossibleSlotTypeValues() []SlotType { } } +// SubgroupProfileScope - Scope of the subgroup profile. +type SubgroupProfileScope string + +const ( + // SubgroupProfileScopeNone - No subgroup profile scope. + SubgroupProfileScopeNone SubgroupProfileScope = "None" + // SubgroupProfileScopeVerticalConnect - VerticalConnect subgroup profile scope. + SubgroupProfileScopeVerticalConnect SubgroupProfileScope = "VerticalConnect" +) + +// PossibleSubgroupProfileScopeValues returns the possible values for the SubgroupProfileScope const type. +func PossibleSubgroupProfileScopeValues() []SubgroupProfileScope { + return []SubgroupProfileScope{ + SubgroupProfileScopeNone, + SubgroupProfileScopeVerticalConnect, + } +} + // SyncMode - Backend address synchronous mode for the backend pool type SyncMode string const ( + // SyncModeAutomatic - Automatic SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" + // SyncModeManual - Manual + SyncModeManual SyncMode = "Manual" ) // PossibleSyncModeValues returns the possible values for the SyncMode const type. @@ -4459,6 +5360,7 @@ func PossibleSyncModeValues() []SyncMode { type SyncRemoteAddressSpace string const ( + // SyncRemoteAddressSpaceTrue - true SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" ) @@ -4473,10 +5375,14 @@ func PossibleSyncRemoteAddressSpaceValues() []SyncRemoteAddressSpace { type TransportProtocol string const ( - TransportProtocolAll TransportProtocol = "All" + // TransportProtocolAll - All + TransportProtocolAll TransportProtocol = "All" + // TransportProtocolQuic - Quic TransportProtocolQuic TransportProtocol = "Quic" - TransportProtocolTCP TransportProtocol = "Tcp" - TransportProtocolUDP TransportProtocol = "Udp" + // TransportProtocolTCP - Tcp + TransportProtocolTCP TransportProtocol = "Tcp" + // TransportProtocolUDP - Udp + TransportProtocolUDP TransportProtocol = "Udp" ) // PossibleTransportProtocolValues returns the possible values for the TransportProtocol const type. @@ -4489,34 +5395,16 @@ func PossibleTransportProtocolValues() []TransportProtocol { } } -// TunnelConnectionStatus - The current state of the tunnel. -type TunnelConnectionStatus string - -const ( - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns the possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{ - TunnelConnectionStatusConnected, - TunnelConnectionStatusConnecting, - TunnelConnectionStatusNotConnected, - TunnelConnectionStatusUnknown, - } -} - // UpdateAction - Specifies the type of update operation to perform on address locations within the service gateway. -// * FullUpdate: Replaces all existing address location data with the new list provided in the request. Any previously defined +// - FullUpdate: Replaces all existing address location data with the new list provided in the request. Any previously defined // locations not included will be removed. -// * PartialUpdate: Updates only the specified address locations. +// - PartialUpdate: Updates only the specified address locations. type UpdateAction string const ( - UpdateActionFullUpdate UpdateAction = "FullUpdate" + // UpdateActionFullUpdate - FullUpdate + UpdateActionFullUpdate UpdateAction = "FullUpdate" + // UpdateActionPartialUpdate - PartialUpdate UpdateActionPartialUpdate UpdateAction = "PartialUpdate" ) @@ -4532,6 +5420,7 @@ func PossibleUpdateActionValues() []UpdateAction { type UsageUnit string const ( + // UsageUnitCount - Count UsageUnitCount UsageUnit = "Count" ) @@ -4546,8 +5435,10 @@ func PossibleUsageUnitValues() []UsageUnit { type UseHubGateway string const ( + // UseHubGatewayFalse - False UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" + // UseHubGatewayTrue - True + UseHubGatewayTrue UseHubGateway = "True" ) // PossibleUseHubGatewayValues returns the possible values for the UseHubGateway const type. @@ -4562,9 +5453,12 @@ func PossibleUseHubGatewayValues() []UseHubGateway { type VPNAuthenticationType string const ( - VPNAuthenticationTypeAAD VPNAuthenticationType = "AAD" + // VPNAuthenticationTypeAAD - AAD + VPNAuthenticationTypeAAD VPNAuthenticationType = "AAD" + // VPNAuthenticationTypeCertificate - Certificate VPNAuthenticationTypeCertificate VPNAuthenticationType = "Certificate" - VPNAuthenticationTypeRadius VPNAuthenticationType = "Radius" + // VPNAuthenticationTypeRadius - Radius + VPNAuthenticationTypeRadius VPNAuthenticationType = "Radius" ) // PossibleVPNAuthenticationTypeValues returns the possible values for the VPNAuthenticationType const type. @@ -4580,9 +5474,12 @@ func PossibleVPNAuthenticationTypeValues() []VPNAuthenticationType { type VPNClientProtocol string const ( - VPNClientProtocolIkeV2 VPNClientProtocol = "IkeV2" + // VPNClientProtocolIkeV2 - IkeV2 + VPNClientProtocolIkeV2 VPNClientProtocol = "IkeV2" + // VPNClientProtocolOpenVPN - OpenVPN VPNClientProtocolOpenVPN VPNClientProtocol = "OpenVPN" - VPNClientProtocolSSTP VPNClientProtocol = "SSTP" + // VPNClientProtocolSSTP - SSTP + VPNClientProtocolSSTP VPNClientProtocol = "SSTP" ) // PossibleVPNClientProtocolValues returns the possible values for the VPNClientProtocol const type. @@ -4598,10 +5495,14 @@ func PossibleVPNClientProtocolValues() []VPNClientProtocol { type VPNConnectionStatus string const ( - VPNConnectionStatusConnected VPNConnectionStatus = "Connected" - VPNConnectionStatusConnecting VPNConnectionStatus = "Connecting" + // VPNConnectionStatusConnected - Connected + VPNConnectionStatusConnected VPNConnectionStatus = "Connected" + // VPNConnectionStatusConnecting - Connecting + VPNConnectionStatusConnecting VPNConnectionStatus = "Connecting" + // VPNConnectionStatusNotConnected - NotConnected VPNConnectionStatusNotConnected VPNConnectionStatus = "NotConnected" - VPNConnectionStatusUnknown VPNConnectionStatus = "Unknown" + // VPNConnectionStatusUnknown - Unknown + VPNConnectionStatusUnknown VPNConnectionStatus = "Unknown" ) // PossibleVPNConnectionStatusValues returns the possible values for the VPNConnectionStatus const type. @@ -4618,9 +5519,12 @@ func PossibleVPNConnectionStatusValues() []VPNConnectionStatus { type VPNGatewayGeneration string const ( + // VPNGatewayGenerationGeneration1 - Generation1 VPNGatewayGenerationGeneration1 VPNGatewayGeneration = "Generation1" + // VPNGatewayGenerationGeneration2 - Generation2 VPNGatewayGenerationGeneration2 VPNGatewayGeneration = "Generation2" - VPNGatewayGenerationNone VPNGatewayGeneration = "None" + // VPNGatewayGenerationNone - None + VPNGatewayGenerationNone VPNGatewayGeneration = "None" ) // PossibleVPNGatewayGenerationValues returns the possible values for the VPNGatewayGeneration const type. @@ -4636,7 +5540,9 @@ func PossibleVPNGatewayGenerationValues() []VPNGatewayGeneration { type VPNGatewayTunnelingProtocol string const ( - VPNGatewayTunnelingProtocolIkeV2 VPNGatewayTunnelingProtocol = "IkeV2" + // VPNGatewayTunnelingProtocolIkeV2 - IkeV2 + VPNGatewayTunnelingProtocolIkeV2 VPNGatewayTunnelingProtocol = "IkeV2" + // VPNGatewayTunnelingProtocolOpenVPN - OpenVPN VPNGatewayTunnelingProtocolOpenVPN VPNGatewayTunnelingProtocol = "OpenVPN" ) @@ -4652,8 +5558,11 @@ func PossibleVPNGatewayTunnelingProtocolValues() []VPNGatewayTunnelingProtocol { type VPNLinkConnectionMode string const ( - VPNLinkConnectionModeDefault VPNLinkConnectionMode = "Default" + // VPNLinkConnectionModeDefault - Default + VPNLinkConnectionModeDefault VPNLinkConnectionMode = "Default" + // VPNLinkConnectionModeInitiatorOnly - InitiatorOnly VPNLinkConnectionModeInitiatorOnly VPNLinkConnectionMode = "InitiatorOnly" + // VPNLinkConnectionModeResponderOnly - ResponderOnly VPNLinkConnectionModeResponderOnly VPNLinkConnectionMode = "ResponderOnly" ) @@ -4670,7 +5579,9 @@ func PossibleVPNLinkConnectionModeValues() []VPNLinkConnectionMode { type VPNNatRuleMode string const ( - VPNNatRuleModeEgressSnat VPNNatRuleMode = "EgressSnat" + // VPNNatRuleModeEgressSnat - EgressSnat + VPNNatRuleModeEgressSnat VPNNatRuleMode = "EgressSnat" + // VPNNatRuleModeIngressSnat - IngressSnat VPNNatRuleModeIngressSnat VPNNatRuleMode = "IngressSnat" ) @@ -4686,8 +5597,10 @@ func PossibleVPNNatRuleModeValues() []VPNNatRuleMode { type VPNNatRuleType string const ( + // VPNNatRuleTypeDynamic - Dynamic VPNNatRuleTypeDynamic VPNNatRuleType = "Dynamic" - VPNNatRuleTypeStatic VPNNatRuleType = "Static" + // VPNNatRuleTypeStatic - Static + VPNNatRuleTypeStatic VPNNatRuleType = "Static" ) // PossibleVPNNatRuleTypeValues returns the possible values for the VPNNatRuleType const type. @@ -4702,8 +5615,11 @@ func PossibleVPNNatRuleTypeValues() []VPNNatRuleType { type VPNPolicyMemberAttributeType string const ( - VPNPolicyMemberAttributeTypeAADGroupID VPNPolicyMemberAttributeType = "AADGroupId" + // VPNPolicyMemberAttributeTypeAADGroupID - AADGroupId + VPNPolicyMemberAttributeTypeAADGroupID VPNPolicyMemberAttributeType = "AADGroupId" + // VPNPolicyMemberAttributeTypeCertificateGroupID - CertificateGroupId VPNPolicyMemberAttributeTypeCertificateGroupID VPNPolicyMemberAttributeType = "CertificateGroupId" + // VPNPolicyMemberAttributeTypeRadiusAzureGroupID - RadiusAzureGroupId VPNPolicyMemberAttributeTypeRadiusAzureGroupID VPNPolicyMemberAttributeType = "RadiusAzureGroupId" ) @@ -4720,8 +5636,10 @@ func PossibleVPNPolicyMemberAttributeTypeValues() []VPNPolicyMemberAttributeType type VPNType string const ( + // VPNTypePolicyBased - PolicyBased VPNTypePolicyBased VPNType = "PolicyBased" - VPNTypeRouteBased VPNType = "RouteBased" + // VPNTypeRouteBased - RouteBased + VPNTypeRouteBased VPNType = "RouteBased" ) // PossibleVPNTypeValues returns the possible values for the VPNType const type. @@ -4736,9 +5654,12 @@ func PossibleVPNTypeValues() []VPNType { type VerbosityLevel string const ( - VerbosityLevelFull VerbosityLevel = "Full" + // VerbosityLevelFull - Full + VerbosityLevelFull VerbosityLevel = "Full" + // VerbosityLevelMinimum - Minimum VerbosityLevelMinimum VerbosityLevel = "Minimum" - VerbosityLevelNormal VerbosityLevel = "Normal" + // VerbosityLevelNormal - Normal + VerbosityLevelNormal VerbosityLevel = "Normal" ) // PossibleVerbosityLevelValues returns the possible values for the VerbosityLevel const type. @@ -4750,13 +5671,33 @@ func PossibleVerbosityLevelValues() []VerbosityLevel { } } +// VirtualNetworkApplianceIPVersionType - IP address version. +type VirtualNetworkApplianceIPVersionType string + +const ( + // VirtualNetworkApplianceIPVersionTypeDualStack - Dual Stack version + VirtualNetworkApplianceIPVersionTypeDualStack VirtualNetworkApplianceIPVersionType = "DualStack" + // VirtualNetworkApplianceIPVersionTypeIPv4 - IPv4 version + VirtualNetworkApplianceIPVersionTypeIPv4 VirtualNetworkApplianceIPVersionType = "IPv4" +) + +// PossibleVirtualNetworkApplianceIPVersionTypeValues returns the possible values for the VirtualNetworkApplianceIPVersionType const type. +func PossibleVirtualNetworkApplianceIPVersionTypeValues() []VirtualNetworkApplianceIPVersionType { + return []VirtualNetworkApplianceIPVersionType{ + VirtualNetworkApplianceIPVersionTypeDualStack, + VirtualNetworkApplianceIPVersionTypeIPv4, + } +} + // VirtualNetworkEncryptionEnforcement - If the encrypted VNet allows VM that does not support encryption. This field is for // future support, AllowUnencrypted is the only supported value at general availability. type VirtualNetworkEncryptionEnforcement string const ( + // VirtualNetworkEncryptionEnforcementAllowUnencrypted - AllowUnencrypted VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" + // VirtualNetworkEncryptionEnforcementDropUnencrypted - DropUnencrypted + VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" ) // PossibleVirtualNetworkEncryptionEnforcementValues returns the possible values for the VirtualNetworkEncryptionEnforcement const type. @@ -4771,8 +5712,11 @@ func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncrypt type VirtualNetworkGatewayConnectionMode string const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" + // VirtualNetworkGatewayConnectionModeDefault - Default + VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" + // VirtualNetworkGatewayConnectionModeInitiatorOnly - InitiatorOnly VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" + // VirtualNetworkGatewayConnectionModeResponderOnly - ResponderOnly VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" ) @@ -4789,7 +5733,9 @@ func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGateway type VirtualNetworkGatewayConnectionProtocol string const ( + // VirtualNetworkGatewayConnectionProtocolIKEv1 - IKEv1 VirtualNetworkGatewayConnectionProtocolIKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + // VirtualNetworkGatewayConnectionProtocolIKEv2 - IKEv2 VirtualNetworkGatewayConnectionProtocolIKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" ) @@ -4805,10 +5751,14 @@ func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGat type VirtualNetworkGatewayConnectionStatus string const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + // VirtualNetworkGatewayConnectionStatusConnected - Connected + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + // VirtualNetworkGatewayConnectionStatusConnecting - Connecting + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + // VirtualNetworkGatewayConnectionStatusNotConnected - NotConnected VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" + // VirtualNetworkGatewayConnectionStatusUnknown - Unknown + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" ) // PossibleVirtualNetworkGatewayConnectionStatusValues returns the possible values for the VirtualNetworkGatewayConnectionStatus const type. @@ -4825,10 +5775,14 @@ func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatew type VirtualNetworkGatewayConnectionType string const ( + // VirtualNetworkGatewayConnectionTypeExpressRoute - ExpressRoute VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" + // VirtualNetworkGatewayConnectionTypeIPsec - IPsec + VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" + // VirtualNetworkGatewayConnectionTypeVPNClient - VPNClient + VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + // VirtualNetworkGatewayConnectionTypeVnet2Vnet - Vnet2Vnet + VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" ) // PossibleVirtualNetworkGatewayConnectionTypeValues returns the possible values for the VirtualNetworkGatewayConnectionType const type. @@ -4889,10 +5843,14 @@ func PossibleVirtualNetworkGatewayMigrationPhaseValues() []VirtualNetworkGateway type VirtualNetworkGatewayMigrationState string const ( - VirtualNetworkGatewayMigrationStateFailed VirtualNetworkGatewayMigrationState = "Failed" + // VirtualNetworkGatewayMigrationStateFailed - Failed + VirtualNetworkGatewayMigrationStateFailed VirtualNetworkGatewayMigrationState = "Failed" + // VirtualNetworkGatewayMigrationStateInProgress - InProgress VirtualNetworkGatewayMigrationStateInProgress VirtualNetworkGatewayMigrationState = "InProgress" - VirtualNetworkGatewayMigrationStateNone VirtualNetworkGatewayMigrationState = "None" - VirtualNetworkGatewayMigrationStateSucceeded VirtualNetworkGatewayMigrationState = "Succeeded" + // VirtualNetworkGatewayMigrationStateNone - None + VirtualNetworkGatewayMigrationStateNone VirtualNetworkGatewayMigrationState = "None" + // VirtualNetworkGatewayMigrationStateSucceeded - Succeeded + VirtualNetworkGatewayMigrationStateSucceeded VirtualNetworkGatewayMigrationState = "Succeeded" ) // PossibleVirtualNetworkGatewayMigrationStateValues returns the possible values for the VirtualNetworkGatewayMigrationState const type. @@ -4925,24 +5883,42 @@ func PossibleVirtualNetworkGatewayMigrationTypeValues() []VirtualNetworkGatewayM type VirtualNetworkGatewaySKUName string const ( - VirtualNetworkGatewaySKUNameBasic VirtualNetworkGatewaySKUName = "Basic" - VirtualNetworkGatewaySKUNameErGw1AZ VirtualNetworkGatewaySKUName = "ErGw1AZ" - VirtualNetworkGatewaySKUNameErGw2AZ VirtualNetworkGatewaySKUName = "ErGw2AZ" - VirtualNetworkGatewaySKUNameErGw3AZ VirtualNetworkGatewaySKUName = "ErGw3AZ" - VirtualNetworkGatewaySKUNameErGwScale VirtualNetworkGatewaySKUName = "ErGwScale" - VirtualNetworkGatewaySKUNameHighPerformance VirtualNetworkGatewaySKUName = "HighPerformance" - VirtualNetworkGatewaySKUNameStandard VirtualNetworkGatewaySKUName = "Standard" + // VirtualNetworkGatewaySKUNameBasic - Basic + VirtualNetworkGatewaySKUNameBasic VirtualNetworkGatewaySKUName = "Basic" + // VirtualNetworkGatewaySKUNameErGw1AZ - ErGw1AZ + VirtualNetworkGatewaySKUNameErGw1AZ VirtualNetworkGatewaySKUName = "ErGw1AZ" + // VirtualNetworkGatewaySKUNameErGw2AZ - ErGw2AZ + VirtualNetworkGatewaySKUNameErGw2AZ VirtualNetworkGatewaySKUName = "ErGw2AZ" + // VirtualNetworkGatewaySKUNameErGw3AZ - ErGw3AZ + VirtualNetworkGatewaySKUNameErGw3AZ VirtualNetworkGatewaySKUName = "ErGw3AZ" + // VirtualNetworkGatewaySKUNameErGwScale - ErGwScale + VirtualNetworkGatewaySKUNameErGwScale VirtualNetworkGatewaySKUName = "ErGwScale" + // VirtualNetworkGatewaySKUNameHighPerformance - HighPerformance + VirtualNetworkGatewaySKUNameHighPerformance VirtualNetworkGatewaySKUName = "HighPerformance" + // VirtualNetworkGatewaySKUNameStandard - Standard + VirtualNetworkGatewaySKUNameStandard VirtualNetworkGatewaySKUName = "Standard" + // VirtualNetworkGatewaySKUNameUltraPerformance - UltraPerformance VirtualNetworkGatewaySKUNameUltraPerformance VirtualNetworkGatewaySKUName = "UltraPerformance" - VirtualNetworkGatewaySKUNameVPNGw1 VirtualNetworkGatewaySKUName = "VpnGw1" - VirtualNetworkGatewaySKUNameVPNGw1AZ VirtualNetworkGatewaySKUName = "VpnGw1AZ" - VirtualNetworkGatewaySKUNameVPNGw2 VirtualNetworkGatewaySKUName = "VpnGw2" - VirtualNetworkGatewaySKUNameVPNGw2AZ VirtualNetworkGatewaySKUName = "VpnGw2AZ" - VirtualNetworkGatewaySKUNameVPNGw3 VirtualNetworkGatewaySKUName = "VpnGw3" - VirtualNetworkGatewaySKUNameVPNGw3AZ VirtualNetworkGatewaySKUName = "VpnGw3AZ" - VirtualNetworkGatewaySKUNameVPNGw4 VirtualNetworkGatewaySKUName = "VpnGw4" - VirtualNetworkGatewaySKUNameVPNGw4AZ VirtualNetworkGatewaySKUName = "VpnGw4AZ" - VirtualNetworkGatewaySKUNameVPNGw5 VirtualNetworkGatewaySKUName = "VpnGw5" - VirtualNetworkGatewaySKUNameVPNGw5AZ VirtualNetworkGatewaySKUName = "VpnGw5AZ" + // VirtualNetworkGatewaySKUNameVPNGw1 - VpnGw1 + VirtualNetworkGatewaySKUNameVPNGw1 VirtualNetworkGatewaySKUName = "VpnGw1" + // VirtualNetworkGatewaySKUNameVPNGw1AZ - VpnGw1AZ + VirtualNetworkGatewaySKUNameVPNGw1AZ VirtualNetworkGatewaySKUName = "VpnGw1AZ" + // VirtualNetworkGatewaySKUNameVPNGw2 - VpnGw2 + VirtualNetworkGatewaySKUNameVPNGw2 VirtualNetworkGatewaySKUName = "VpnGw2" + // VirtualNetworkGatewaySKUNameVPNGw2AZ - VpnGw2AZ + VirtualNetworkGatewaySKUNameVPNGw2AZ VirtualNetworkGatewaySKUName = "VpnGw2AZ" + // VirtualNetworkGatewaySKUNameVPNGw3 - VpnGw3 + VirtualNetworkGatewaySKUNameVPNGw3 VirtualNetworkGatewaySKUName = "VpnGw3" + // VirtualNetworkGatewaySKUNameVPNGw3AZ - VpnGw3AZ + VirtualNetworkGatewaySKUNameVPNGw3AZ VirtualNetworkGatewaySKUName = "VpnGw3AZ" + // VirtualNetworkGatewaySKUNameVPNGw4 - VpnGw4 + VirtualNetworkGatewaySKUNameVPNGw4 VirtualNetworkGatewaySKUName = "VpnGw4" + // VirtualNetworkGatewaySKUNameVPNGw4AZ - VpnGw4AZ + VirtualNetworkGatewaySKUNameVPNGw4AZ VirtualNetworkGatewaySKUName = "VpnGw4AZ" + // VirtualNetworkGatewaySKUNameVPNGw5 - VpnGw5 + VirtualNetworkGatewaySKUNameVPNGw5 VirtualNetworkGatewaySKUName = "VpnGw5" + // VirtualNetworkGatewaySKUNameVPNGw5AZ - VpnGw5AZ + VirtualNetworkGatewaySKUNameVPNGw5AZ VirtualNetworkGatewaySKUName = "VpnGw5AZ" ) // PossibleVirtualNetworkGatewaySKUNameValues returns the possible values for the VirtualNetworkGatewaySKUName const type. @@ -4973,24 +5949,42 @@ func PossibleVirtualNetworkGatewaySKUNameValues() []VirtualNetworkGatewaySKUName type VirtualNetworkGatewaySKUTier string const ( - VirtualNetworkGatewaySKUTierBasic VirtualNetworkGatewaySKUTier = "Basic" - VirtualNetworkGatewaySKUTierErGw1AZ VirtualNetworkGatewaySKUTier = "ErGw1AZ" - VirtualNetworkGatewaySKUTierErGw2AZ VirtualNetworkGatewaySKUTier = "ErGw2AZ" - VirtualNetworkGatewaySKUTierErGw3AZ VirtualNetworkGatewaySKUTier = "ErGw3AZ" - VirtualNetworkGatewaySKUTierErGwScale VirtualNetworkGatewaySKUTier = "ErGwScale" - VirtualNetworkGatewaySKUTierHighPerformance VirtualNetworkGatewaySKUTier = "HighPerformance" - VirtualNetworkGatewaySKUTierStandard VirtualNetworkGatewaySKUTier = "Standard" + // VirtualNetworkGatewaySKUTierBasic - Basic + VirtualNetworkGatewaySKUTierBasic VirtualNetworkGatewaySKUTier = "Basic" + // VirtualNetworkGatewaySKUTierErGw1AZ - ErGw1AZ + VirtualNetworkGatewaySKUTierErGw1AZ VirtualNetworkGatewaySKUTier = "ErGw1AZ" + // VirtualNetworkGatewaySKUTierErGw2AZ - ErGw2AZ + VirtualNetworkGatewaySKUTierErGw2AZ VirtualNetworkGatewaySKUTier = "ErGw2AZ" + // VirtualNetworkGatewaySKUTierErGw3AZ - ErGw3AZ + VirtualNetworkGatewaySKUTierErGw3AZ VirtualNetworkGatewaySKUTier = "ErGw3AZ" + // VirtualNetworkGatewaySKUTierErGwScale - ErGwScale + VirtualNetworkGatewaySKUTierErGwScale VirtualNetworkGatewaySKUTier = "ErGwScale" + // VirtualNetworkGatewaySKUTierHighPerformance - HighPerformance + VirtualNetworkGatewaySKUTierHighPerformance VirtualNetworkGatewaySKUTier = "HighPerformance" + // VirtualNetworkGatewaySKUTierStandard - Standard + VirtualNetworkGatewaySKUTierStandard VirtualNetworkGatewaySKUTier = "Standard" + // VirtualNetworkGatewaySKUTierUltraPerformance - UltraPerformance VirtualNetworkGatewaySKUTierUltraPerformance VirtualNetworkGatewaySKUTier = "UltraPerformance" - VirtualNetworkGatewaySKUTierVPNGw1 VirtualNetworkGatewaySKUTier = "VpnGw1" - VirtualNetworkGatewaySKUTierVPNGw1AZ VirtualNetworkGatewaySKUTier = "VpnGw1AZ" - VirtualNetworkGatewaySKUTierVPNGw2 VirtualNetworkGatewaySKUTier = "VpnGw2" - VirtualNetworkGatewaySKUTierVPNGw2AZ VirtualNetworkGatewaySKUTier = "VpnGw2AZ" - VirtualNetworkGatewaySKUTierVPNGw3 VirtualNetworkGatewaySKUTier = "VpnGw3" - VirtualNetworkGatewaySKUTierVPNGw3AZ VirtualNetworkGatewaySKUTier = "VpnGw3AZ" - VirtualNetworkGatewaySKUTierVPNGw4 VirtualNetworkGatewaySKUTier = "VpnGw4" - VirtualNetworkGatewaySKUTierVPNGw4AZ VirtualNetworkGatewaySKUTier = "VpnGw4AZ" - VirtualNetworkGatewaySKUTierVPNGw5 VirtualNetworkGatewaySKUTier = "VpnGw5" - VirtualNetworkGatewaySKUTierVPNGw5AZ VirtualNetworkGatewaySKUTier = "VpnGw5AZ" + // VirtualNetworkGatewaySKUTierVPNGw1 - VpnGw1 + VirtualNetworkGatewaySKUTierVPNGw1 VirtualNetworkGatewaySKUTier = "VpnGw1" + // VirtualNetworkGatewaySKUTierVPNGw1AZ - VpnGw1AZ + VirtualNetworkGatewaySKUTierVPNGw1AZ VirtualNetworkGatewaySKUTier = "VpnGw1AZ" + // VirtualNetworkGatewaySKUTierVPNGw2 - VpnGw2 + VirtualNetworkGatewaySKUTierVPNGw2 VirtualNetworkGatewaySKUTier = "VpnGw2" + // VirtualNetworkGatewaySKUTierVPNGw2AZ - VpnGw2AZ + VirtualNetworkGatewaySKUTierVPNGw2AZ VirtualNetworkGatewaySKUTier = "VpnGw2AZ" + // VirtualNetworkGatewaySKUTierVPNGw3 - VpnGw3 + VirtualNetworkGatewaySKUTierVPNGw3 VirtualNetworkGatewaySKUTier = "VpnGw3" + // VirtualNetworkGatewaySKUTierVPNGw3AZ - VpnGw3AZ + VirtualNetworkGatewaySKUTierVPNGw3AZ VirtualNetworkGatewaySKUTier = "VpnGw3AZ" + // VirtualNetworkGatewaySKUTierVPNGw4 - VpnGw4 + VirtualNetworkGatewaySKUTierVPNGw4 VirtualNetworkGatewaySKUTier = "VpnGw4" + // VirtualNetworkGatewaySKUTierVPNGw4AZ - VpnGw4AZ + VirtualNetworkGatewaySKUTierVPNGw4AZ VirtualNetworkGatewaySKUTier = "VpnGw4AZ" + // VirtualNetworkGatewaySKUTierVPNGw5 - VpnGw5 + VirtualNetworkGatewaySKUTierVPNGw5 VirtualNetworkGatewaySKUTier = "VpnGw5" + // VirtualNetworkGatewaySKUTierVPNGw5AZ - VpnGw5AZ + VirtualNetworkGatewaySKUTierVPNGw5AZ VirtualNetworkGatewaySKUTier = "VpnGw5AZ" ) // PossibleVirtualNetworkGatewaySKUTierValues returns the possible values for the VirtualNetworkGatewaySKUTier const type. @@ -5021,9 +6015,12 @@ func PossibleVirtualNetworkGatewaySKUTierValues() []VirtualNetworkGatewaySKUTier type VirtualNetworkGatewayType string const ( + // VirtualNetworkGatewayTypeExpressRoute - ExpressRoute VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + // VirtualNetworkGatewayTypeLocalGateway - LocalGateway VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVPN VirtualNetworkGatewayType = "Vpn" + // VirtualNetworkGatewayTypeVPN - Vpn + VirtualNetworkGatewayTypeVPN VirtualNetworkGatewayType = "Vpn" ) // PossibleVirtualNetworkGatewayTypeValues returns the possible values for the VirtualNetworkGatewayType const type. @@ -5039,10 +6036,14 @@ func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { type VirtualNetworkPeeringLevel string const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" + // VirtualNetworkPeeringLevelFullyInSync - FullyInSync + VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" + // VirtualNetworkPeeringLevelLocalAndRemoteNotInSync - LocalAndRemoteNotInSync VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" + // VirtualNetworkPeeringLevelLocalNotInSync - LocalNotInSync + VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" + // VirtualNetworkPeeringLevelRemoteNotInSync - RemoteNotInSync + VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" ) // PossibleVirtualNetworkPeeringLevelValues returns the possible values for the VirtualNetworkPeeringLevel const type. @@ -5059,9 +6060,12 @@ func PossibleVirtualNetworkPeeringLevelValues() []VirtualNetworkPeeringLevel { type VirtualNetworkPeeringState string const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + // VirtualNetworkPeeringStateConnected - Connected + VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + // VirtualNetworkPeeringStateDisconnected - Disconnected VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" + // VirtualNetworkPeeringStateInitiated - Initiated + VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" ) // PossibleVirtualNetworkPeeringStateValues returns the possible values for the VirtualNetworkPeeringState const type. @@ -5077,10 +6081,14 @@ func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { type VirtualNetworkPrivateEndpointNetworkPolicies string const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" + // VirtualNetworkPrivateEndpointNetworkPoliciesDisabled - Disabled + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + // VirtualNetworkPrivateEndpointNetworkPoliciesEnabled - Enabled + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" + // VirtualNetworkPrivateEndpointNetworkPoliciesNetworkSecurityGroupEnabled - NetworkSecurityGroupEnabled VirtualNetworkPrivateEndpointNetworkPoliciesNetworkSecurityGroupEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "NetworkSecurityGroupEnabled" - VirtualNetworkPrivateEndpointNetworkPoliciesRouteTableEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "RouteTableEnabled" + // VirtualNetworkPrivateEndpointNetworkPoliciesRouteTableEnabled - RouteTableEnabled + VirtualNetworkPrivateEndpointNetworkPoliciesRouteTableEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "RouteTableEnabled" ) // PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateEndpointNetworkPolicies const type. @@ -5098,8 +6106,10 @@ func PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetwo type VirtualNetworkPrivateLinkServiceNetworkPolicies string const ( + // VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled - Disabled VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" + // VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled - Enabled + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" ) // PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateLinkServiceNetworkPolicies const type. @@ -5114,8 +6124,10 @@ func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNe type VirtualWanSecurityProviderType string const ( + // VirtualWanSecurityProviderTypeExternal - External VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" + // VirtualWanSecurityProviderTypeNative - Native + VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" ) // PossibleVirtualWanSecurityProviderTypeValues returns the possible values for the VirtualWanSecurityProviderType const type. @@ -5131,8 +6143,10 @@ func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProvider type VnetLocalRouteOverrideCriteria string const ( + // VnetLocalRouteOverrideCriteriaContains - Contains VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" + // VnetLocalRouteOverrideCriteriaEqual - Equal + VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" ) // PossibleVnetLocalRouteOverrideCriteriaValues returns the possible values for the VnetLocalRouteOverrideCriteria const type. @@ -5147,11 +6161,16 @@ func PossibleVnetLocalRouteOverrideCriteriaValues() []VnetLocalRouteOverrideCrit type WebApplicationFirewallAction string const ( - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - WebApplicationFirewallActionCAPTCHA WebApplicationFirewallAction = "CAPTCHA" + // WebApplicationFirewallActionAllow - Allow + WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" + // WebApplicationFirewallActionBlock - Block + WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" + // WebApplicationFirewallActionCAPTCHA - CAPTCHA + WebApplicationFirewallActionCAPTCHA WebApplicationFirewallAction = "CAPTCHA" + // WebApplicationFirewallActionJSChallenge - JSChallenge WebApplicationFirewallActionJSChallenge WebApplicationFirewallAction = "JSChallenge" - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" + // WebApplicationFirewallActionLog - Log + WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" ) // PossibleWebApplicationFirewallActionValues returns the possible values for the WebApplicationFirewallAction const type. @@ -5169,8 +6188,10 @@ func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction type WebApplicationFirewallEnabledState string const ( + // WebApplicationFirewallEnabledStateDisabled - Disabled WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" + // WebApplicationFirewallEnabledStateEnabled - Enabled + WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" ) // PossibleWebApplicationFirewallEnabledStateValues returns the possible values for the WebApplicationFirewallEnabledState const type. @@ -5185,14 +6206,22 @@ func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewall type WebApplicationFirewallMatchVariable string const ( - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // WebApplicationFirewallMatchVariablePostArgs - PostArgs + WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" + // WebApplicationFirewallMatchVariableQueryString - QueryString + WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" + // WebApplicationFirewallMatchVariableRemoteAddr - RemoteAddr + WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + // WebApplicationFirewallMatchVariableRequestBody - RequestBody + WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // WebApplicationFirewallMatchVariableRequestCookies - RequestCookies WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + // WebApplicationFirewallMatchVariableRequestHeaders - RequestHeaders WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" + // WebApplicationFirewallMatchVariableRequestMethod - RequestMethod + WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + // WebApplicationFirewallMatchVariableRequestURI - RequestUri + WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" ) // PossibleWebApplicationFirewallMatchVariableValues returns the possible values for the WebApplicationFirewallMatchVariable const type. @@ -5213,7 +6242,9 @@ func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewal type WebApplicationFirewallMode string const ( - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + // WebApplicationFirewallModeDetection - Detection + WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + // WebApplicationFirewallModePrevention - Prevention WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" ) @@ -5229,18 +6260,30 @@ func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { type WebApplicationFirewallOperator string const ( - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + // WebApplicationFirewallOperatorAny - Any + WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" + // WebApplicationFirewallOperatorBeginsWith - BeginsWith + WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" + // WebApplicationFirewallOperatorContains - Contains + WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" + // WebApplicationFirewallOperatorEndsWith - EndsWith + WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" + // WebApplicationFirewallOperatorEqual - Equal + WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" + // WebApplicationFirewallOperatorGeoMatch - GeoMatch + WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" + // WebApplicationFirewallOperatorGreaterThan - GreaterThan + WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + // WebApplicationFirewallOperatorGreaterThanOrEqual - GreaterThanOrEqual WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" + // WebApplicationFirewallOperatorIPMatch - IPMatch + WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" + // WebApplicationFirewallOperatorLessThan - LessThan + WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" + // WebApplicationFirewallOperatorLessThanOrEqual - LessThanOrEqual + WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" + // WebApplicationFirewallOperatorRegex - Regex + WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" ) // PossibleWebApplicationFirewallOperatorValues returns the possible values for the WebApplicationFirewallOperator const type. @@ -5265,12 +6308,18 @@ func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOper type WebApplicationFirewallPolicyResourceState string const ( - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + // WebApplicationFirewallPolicyResourceStateCreating - Creating + WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" + // WebApplicationFirewallPolicyResourceStateDeleting - Deleting + WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" + // WebApplicationFirewallPolicyResourceStateDisabled - Disabled + WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + // WebApplicationFirewallPolicyResourceStateDisabling - Disabling WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" + // WebApplicationFirewallPolicyResourceStateEnabled - Enabled + WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" + // WebApplicationFirewallPolicyResourceStateEnabling - Enabling + WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" ) // PossibleWebApplicationFirewallPolicyResourceStateValues returns the possible values for the WebApplicationFirewallPolicyResourceState const type. @@ -5289,8 +6338,11 @@ func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationF type WebApplicationFirewallRuleType string const ( - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" + // WebApplicationFirewallRuleTypeInvalid - Invalid + WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" + // WebApplicationFirewallRuleTypeMatchRule - MatchRule + WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" + // WebApplicationFirewallRuleTypeRateLimitRule - RateLimitRule WebApplicationFirewallRuleTypeRateLimitRule WebApplicationFirewallRuleType = "RateLimitRule" ) @@ -5307,8 +6359,10 @@ func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRule type WebApplicationFirewallScrubbingState string const ( + // WebApplicationFirewallScrubbingStateDisabled - Disabled WebApplicationFirewallScrubbingStateDisabled WebApplicationFirewallScrubbingState = "Disabled" - WebApplicationFirewallScrubbingStateEnabled WebApplicationFirewallScrubbingState = "Enabled" + // WebApplicationFirewallScrubbingStateEnabled - Enabled + WebApplicationFirewallScrubbingStateEnabled WebApplicationFirewallScrubbingState = "Enabled" ) // PossibleWebApplicationFirewallScrubbingStateValues returns the possible values for the WebApplicationFirewallScrubbingState const type. @@ -5324,8 +6378,10 @@ func PossibleWebApplicationFirewallScrubbingStateValues() []WebApplicationFirewa type WebApplicationFirewallState string const ( + // WebApplicationFirewallStateDisabled - Disabled WebApplicationFirewallStateDisabled WebApplicationFirewallState = "Disabled" - WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" + // WebApplicationFirewallStateEnabled - Enabled + WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" ) // PossibleWebApplicationFirewallStateValues returns the possible values for the WebApplicationFirewallState const type. @@ -5340,13 +6396,20 @@ func PossibleWebApplicationFirewallStateValues() []WebApplicationFirewallState { type WebApplicationFirewallTransform string const ( + // WebApplicationFirewallTransformHTMLEntityDecode - HtmlEntityDecode WebApplicationFirewallTransformHTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" - WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" + // WebApplicationFirewallTransformLowercase - Lowercase + WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" + // WebApplicationFirewallTransformRemoveNulls - RemoveNulls + WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + // WebApplicationFirewallTransformTrim - Trim + WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + // WebApplicationFirewallTransformURLDecode - UrlDecode + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + // WebApplicationFirewallTransformURLEncode - UrlEncode + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" + // WebApplicationFirewallTransformUppercase - Uppercase + WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" ) // PossibleWebApplicationFirewallTransformValues returns the possible values for the WebApplicationFirewallTransform const type. diff --git a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go index f58b2eed3d6f..2f570145886b 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go index 042cd88c1c32..0c8897adc425 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // CustomIPPrefixesClient contains the methods for the CustomIPPrefixes group. // Don't use this type directly, use NewCustomIPPrefixesClient() instead. +// +// Generated from API version 2025-07-01 type CustomIPPrefixesClient struct { internal *arm.Client subscriptionID string } // NewCustomIPPrefixesClient creates a new instance of CustomIPPrefixesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewCustomIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomIPPrefixesClient, error) { @@ -43,9 +43,7 @@ func NewCustomIPPrefixesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to the create or update custom IP prefix operation. // - options - CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *CustomIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomIPPrefixesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *CustomIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *CustomIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *CustomIPPrefixesClient) createOrUpdate(ctx context.Context, resour // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, _ *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter customIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,10 +120,8 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - customIPPrefixName - The name of the CustomIpPrefix. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - customIPPrefixName - The name of the custom IP prefix. // - options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete // method. func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[CustomIPPrefixesClientDeleteResponse], error) { @@ -137,8 +131,7 @@ func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomIPPrefixesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, _ *CustomIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter customIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified custom IP prefix in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - customIPPrefixName - The name of the custom IP prefix. // - options - CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. func (client *CustomIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (CustomIPPrefixesClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *CustomIPPrefixesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter customIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (Cu } // NewListPager - Gets all custom IP prefixes in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager // method. func (client *CustomIPPrefixesClient) NewListPager(resourceGroupName string, options *CustomIPPrefixesClientListOptions) *runtime.Pager[CustomIPPrefixesClientListResponse] { @@ -298,21 +284,21 @@ func (client *CustomIPPrefixesClient) NewListPager(resourceGroupName string, opt // listCreateRequest creates the List request. func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *CustomIPPrefixesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -327,8 +313,6 @@ func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (C } // NewListAllPager - Gets all the custom IP prefixes in a subscription. -// -// Generated from API version 2025-05-01 // - options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager // method. func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { @@ -366,8 +350,8 @@ func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -383,9 +367,7 @@ func (client *CustomIPPrefixesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates custom IP prefix tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to update custom IP prefix tags. // - options - CustomIPPrefixesClientUpdateTagsOptions contains the optional parameters for the CustomIPPrefixesClient.UpdateTags @@ -415,6 +397,10 @@ func (client *CustomIPPrefixesClient) UpdateTags(ctx context.Context, resourceGr // updateTagsCreateRequest creates the UpdateTags request. func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject, _ *CustomIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -423,18 +409,15 @@ func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, errors.New("parameter customIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go index d396e87be406..56af5b037b6c 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go @@ -1,197 +1,153 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixDelete.json -func ExampleCustomIPPrefixesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/CustomIpPrefixCreateCustomizedValues.json +func ExampleCustomIPPrefixesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewCustomIPPrefixesClient().BeginDelete(ctx, "rg1", "test-customipprefix", nil) + poller, err := clientFactory.NewCustomIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-customipprefix", armnetwork.CustomIPPrefix{ + Location: to.Ptr("westus"), + Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + Cidr: to.Ptr("0.0.0.0/24"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixGet.json -func ExampleCustomIPPrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomIPPrefixesClient().Get(ctx, "rg1", "test-customipprefix", &armnetwork.CustomIPPrefixesClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // res = armnetwork.CustomIPPrefixesClientCreateOrUpdateResponse{ + // CustomIPPrefix: armnetwork.CustomIPPrefix{ + // Name: to.Ptr("test-customipprefix"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("192.168.254.2/24"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), + // FailedReason: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // Zones: []*string{ + // to.Ptr("1"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixCreateCustomizedValues.json -func ExampleCustomIPPrefixesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/CustomIpPrefixDelete.json +func ExampleCustomIPPrefixesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewCustomIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-customipprefix", armnetwork.CustomIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - Cidr: to.Ptr("0.0.0.0/24"), - }, - }, nil) + poller, err := clientFactory.NewCustomIPPrefixesClient().BeginDelete(ctx, "rg1", "test-customipprefix", 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) + log.Fatalf("failed to poll 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.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("192.168.254.2/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // FailedReason: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } + // res = armnetwork.CustomIPPrefixesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixUpdateTags.json -func ExampleCustomIPPrefixesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/CustomIpPrefixGet.json +func ExampleCustomIPPrefixesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewCustomIPPrefixesClient().UpdateTags(ctx, "rg1", "test-customipprefix", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewCustomIPPrefixesClient().Get(ctx, "rg1", "test-customipprefix", 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.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("192.168.254.2/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // FailedReason: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // res = armnetwork.CustomIPPrefixesClientGetResponse{ + // CustomIPPrefix: armnetwork.CustomIPPrefix{ + // Name: to.Ptr("test-customipprefix"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.0.0/24"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixListAll.json -func ExampleCustomIPPrefixesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/CustomIpPrefixList.json +func ExampleCustomIPPrefixesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewCustomIPPrefixesClient().NewListAllPager(nil) + pager := clientFactory.NewCustomIPPrefixesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -202,296 +158,143 @@ func ExampleCustomIPPrefixesClient_NewListAllPager() { _ = 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.CustomIPPrefixListResult = armnetwork.CustomIPPrefixListResult{ - // Value: []*armnetwork.CustomIPPrefix{ - // { - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // page = armnetwork.CustomIPPrefixesClientListResponse{ + // CustomIPPrefixListResult: armnetwork.CustomIPPrefixListResult{ + // Value: []*armnetwork.CustomIPPrefix{ + // { + // Name: to.Ptr("test-customipprefix"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.0.0/24"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix2"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix2"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.1.0/30"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.2.0/23"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix3"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix3"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix4"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // CustomIPPrefixParent: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), + // }, + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.4.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix4"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix5"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), + // }, + // }, + // Cidr: to.Ptr("2607:f0d1:1002::/48"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // CustomIPPrefixParent: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // }, - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix5"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // }}, - // Cidr: to.Ptr("2607:f0d1:1002::/48"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix6"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.5.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedState("ProvisionFailed")), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr("CustomerSignatureNotVerified"), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix7"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.6.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // Asn: to.Ptr("11"), - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // Geo: to.Ptr(armnetwork.GeoGLOBAL), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(true), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(true), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // PrefixType: to.Ptr(armnetwork.CustomIPPrefixTypeParent), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }}, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CustomIpPrefixList.json -func ExampleCustomIPPrefixesClient_NewListPager() { +// Generated from example definition: 2025-07-01/CustomIpPrefixListAll.json +func ExampleCustomIPPrefixesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewCustomIPPrefixesClient().NewListPager("rg1", nil) + pager := clientFactory.NewCustomIPPrefixesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -502,123 +305,338 @@ func ExampleCustomIPPrefixesClient_NewListPager() { _ = 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.CustomIPPrefixListResult = armnetwork.CustomIPPrefixListResult{ - // Value: []*armnetwork.CustomIPPrefix{ - // { - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // page = armnetwork.CustomIPPrefixesClientListAllResponse{ + // CustomIPPrefixListResult: armnetwork.CustomIPPrefixListResult{ + // Value: []*armnetwork.CustomIPPrefix{ + // { + // Name: to.Ptr("test-customipprefix"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.0.0/24"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // { + // Name: to.Ptr("test-customipprefix2"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.2.0/23"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix2"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix3"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix3"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.4.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.1.0/30"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // { + // Name: to.Ptr("test-customipprefix4"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), + // CustomIPPrefixParent: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), + // }, + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix4"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix5"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), + // }, + // }, + // Cidr: to.Ptr("2607:f0d1:1002::/48"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // CustomIPPrefixParent: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), + // }, + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix6"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.5.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedState("ProvisionFailed")), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr("CustomerSignatureNotVerified"), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateFailed), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix7"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.6.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix5"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // }}, - // Cidr: to.Ptr("2607:f0d1:1002::/48"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // Asn: to.Ptr("11"), + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(false), + // FailedReason: to.Ptr(""), + // Geo: to.Ptr(armnetwork.GeoGLOBAL), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), + // }, + // }, + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(true), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), + // }, + // }, + // { + // Name: to.Ptr("test-customipprefix6"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("0.0.7.0/22"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), + // ExpressRouteAdvertise: to.Ptr(true), + // FailedReason: to.Ptr(""), + // NoInternetAdvertise: to.Ptr(false), + // PrefixType: to.Ptr(armnetwork.CustomIPPrefixTypeParent), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/CustomIpPrefixUpdateTags.json +func ExampleCustomIPPrefixesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewCustomIPPrefixesClient().UpdateTags(ctx, "rg1", "test-customipprefix", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.CustomIPPrefixesClientUpdateTagsResponse{ + // CustomIPPrefix: armnetwork.CustomIPPrefix{ + // Name: to.Ptr("test-customipprefix"), + // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ + // AuthorizationMessage: to.Ptr("authorizationMessage"), + // ChildCustomIPPrefixes: []*armnetwork.SubResource{ + // }, + // Cidr: to.Ptr("192.168.254.2/24"), + // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), + // FailedReason: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPPrefixes: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // SignedMessage: to.Ptr("signedMessage"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go index 09d6aace8c8f..c44907163036 100644 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // DdosCustomPoliciesClient contains the methods for the DdosCustomPolicies group. // Don't use this type directly, use NewDdosCustomPoliciesClient() instead. +// +// Generated from API version 2025-07-01 type DdosCustomPoliciesClient struct { internal *arm.Client subscriptionID string } // NewDdosCustomPoliciesClient creates a new instance of DdosCustomPoliciesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewDdosCustomPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosCustomPoliciesClient, error) { @@ -43,9 +43,7 @@ func NewDdosCustomPoliciesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to the create or update operation. // - options - DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *DdosCustomPoliciesClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosCustomPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *DdosCustomPoliciesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DdosCustomPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *DdosCustomPoliciesClient) createOrUpdate(ctx context.Context, reso // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, _ *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *DdosCustomPoliciesClient) BeginDelete(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosCustomPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *DdosCustomPoliciesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, res // deleteCreateRequest creates the Delete request. func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, _ *DdosCustomPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. func (client *DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (DdosCustomPoliciesClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, _ *DdosCustomPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, re return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -263,11 +251,120 @@ func (client *DdosCustomPoliciesClient) getHandleResponse(resp *http.Response) ( return result, nil } +// NewListPager - Gets all the DDoS custom policies in a resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - DdosCustomPoliciesClientListOptions contains the optional parameters for the DdosCustomPoliciesClient.NewListPager +// method. +func (client *DdosCustomPoliciesClient) NewListPager(resourceGroupName string, options *DdosCustomPoliciesClientListOptions) *runtime.Pager[DdosCustomPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DdosCustomPoliciesClientListResponse]{ + More: func(page DdosCustomPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DdosCustomPoliciesClientListResponse) (DdosCustomPoliciesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DdosCustomPoliciesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return DdosCustomPoliciesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *DdosCustomPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *DdosCustomPoliciesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DdosCustomPoliciesClient) listHandleResponse(resp *http.Response) (DdosCustomPoliciesClientListResponse, error) { + result := DdosCustomPoliciesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicyListResult); err != nil { + return DdosCustomPoliciesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the DDoS custom policies in a subscription. +// - options - DdosCustomPoliciesClientListAllOptions contains the optional parameters for the DdosCustomPoliciesClient.NewListAllPager +// method. +func (client *DdosCustomPoliciesClient) NewListAllPager(options *DdosCustomPoliciesClientListAllOptions) *runtime.Pager[DdosCustomPoliciesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[DdosCustomPoliciesClientListAllResponse]{ + More: func(page DdosCustomPoliciesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DdosCustomPoliciesClientListAllResponse) (DdosCustomPoliciesClientListAllResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DdosCustomPoliciesClient.NewListAllPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listAllCreateRequest(ctx, options) + }, nil) + if err != nil { + return DdosCustomPoliciesClientListAllResponse{}, err + } + return client.listAllHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *DdosCustomPoliciesClient) listAllCreateRequest(ctx context.Context, _ *DdosCustomPoliciesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosCustomPolicies" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *DdosCustomPoliciesClient) listAllHandleResponse(resp *http.Response) (DdosCustomPoliciesClientListAllResponse, error) { + result := DdosCustomPoliciesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicyListResult); err != nil { + return DdosCustomPoliciesClientListAllResponse{}, err + } + return result, nil +} + // UpdateTags - Update a DDoS custom policy tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to update DDoS custom policy resource tags. // - options - DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags @@ -297,6 +394,10 @@ func (client *DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resource // updateTagsCreateRequest creates the UpdateTags request. func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject, _ *DdosCustomPoliciesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -305,18 +406,15 @@ func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Cont return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go index 3c2ad9d2eb6d..73388a784a75 100644 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go @@ -1,28 +1,93 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosCustomPolicyDelete.json +// Generated from example definition: 2025-07-01/DdosCustomPolicyCreate.json +func ExampleDdosCustomPoliciesClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDdosCustomPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ddos-custom-policy", armnetwork.DdosCustomPolicy{ + Location: to.Ptr("centraluseuap"), + Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + DetectionRules: []*armnetwork.DdosDetectionRule{ + { + Name: to.Ptr("detectionRuleTcp"), + Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + PacketsPerSecond: to.Ptr[int32](1000000), + TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + }, + }, + }, + }, + }, + }, 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 poll 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 = armnetwork.DdosCustomPoliciesClientCreateOrUpdateResponse{ + // DdosCustomPolicy: armnetwork.DdosCustomPolicy{ + // Name: to.Ptr("test-ddos-custom-policy"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // DetectionRules: []*armnetwork.DdosDetectionRule{ + // { + // Name: to.Ptr("detectionRuleTcp"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), + // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + // PacketsPerSecond: to.Ptr[int32](1000000), + // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/DdosCustomPolicyDelete.json func ExampleDdosCustomPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,20 +95,25 @@ func ExampleDdosCustomPoliciesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.DdosCustomPoliciesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosCustomPolicyGet.json +// Generated from example definition: 2025-07-01/DdosCustomPolicyGet.json func ExampleDdosCustomPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -54,105 +124,178 @@ func ExampleDdosCustomPoliciesClient_Get() { // 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.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // DetectionRules: []*armnetwork.DdosDetectionRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), - // Name: to.Ptr("detectionRuleTcp"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ - // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ - // PacketsPerSecond: to.Ptr[int32](1000000), - // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // res = armnetwork.DdosCustomPoliciesClientGetResponse{ + // DdosCustomPolicy: armnetwork.DdosCustomPolicy{ + // Name: to.Ptr("test-ddos-custom-policy"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // DetectionRules: []*armnetwork.DdosDetectionRule{ + // { + // Name: to.Ptr("detectionRuleTcp"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), + // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + // PacketsPerSecond: to.Ptr[int32](1000000), + // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosCustomPolicyCreate.json -func ExampleDdosCustomPoliciesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/DdosCustomPolicyList.json +func ExampleDdosCustomPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDdosCustomPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ddos-custom-policy", armnetwork.DdosCustomPolicy{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - DetectionRules: []*armnetwork.DdosDetectionRule{ - { - Name: to.Ptr("detectionRuleTcp"), - Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ - DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), - TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ - PacketsPerSecond: to.Ptr[int32](1000000), - TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), - }, - }, - }}, - }, - }, nil) + pager := clientFactory.NewDdosCustomPoliciesClient().NewListPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.DdosCustomPoliciesClientListResponse{ + // DdosCustomPolicyListResult: armnetwork.DdosCustomPolicyListResult{ + // Value: []*armnetwork.DdosCustomPolicy{ + // { + // Name: to.Ptr("test-ddos-custom-policy"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // DetectionRules: []*armnetwork.DdosDetectionRule{ + // { + // Name: to.Ptr("detectionRuleTcp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), + // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // PacketsPerSecond: to.Ptr[int32](1000000), + // }, + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("test-ddos-custom-policy-2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy-2"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/DdosCustomPolicyListAll.json +func ExampleDdosCustomPoliciesClient_NewListAllPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDdosCustomPoliciesClient().NewListAllPager(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 = armnetwork.DdosCustomPoliciesClientListAllResponse{ + // DdosCustomPolicyListResult: armnetwork.DdosCustomPolicyListResult{ + // Value: []*armnetwork.DdosCustomPolicy{ + // { + // Name: to.Ptr("test-ddos-custom-policy"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // DetectionRules: []*armnetwork.DdosDetectionRule{ + // { + // Name: to.Ptr("detectionRuleTcp"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), + // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // PacketsPerSecond: to.Ptr[int32](1000000), + // }, + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("test-ddos-custom-policy-2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy-2"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } - // 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.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // DetectionRules: []*armnetwork.DdosDetectionRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), - // Name: to.Ptr("detectionRuleTcp"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ - // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ - // PacketsPerSecond: to.Ptr[int32](1000000), - // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosCustomPolicyUpdateTags.json +// Generated from example definition: 2025-07-01/DdosCustomPolicyUpdateTags.json func ExampleDdosCustomPoliciesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -168,33 +311,36 @@ func ExampleDdosCustomPoliciesClient_UpdateTags() { // 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.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // DetectionRules: []*armnetwork.DdosDetectionRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), - // Name: to.Ptr("detectionRuleTcp"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ - // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ - // PacketsPerSecond: to.Ptr[int32](1000000), - // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // res = armnetwork.DdosCustomPoliciesClientUpdateTagsResponse{ + // DdosCustomPolicy: armnetwork.DdosCustomPolicy{ + // Name: to.Ptr("test-ddos-custom-policy"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ + // DetectionRules: []*armnetwork.DdosDetectionRule{ + // { + // Name: to.Ptr("detectionRuleTcp"), + // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies/ddosDetectionRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy/ddosDetectionRules/detectionRuleTcp"), + // Properties: &armnetwork.DdosDetectionRulePropertiesFormat{ + // DetectionMode: to.Ptr(armnetwork.DdosDetectionModeTrafficThreshold), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TrafficDetectionRule: &armnetwork.TrafficDetectionRule{ + // PacketsPerSecond: to.Ptr[int32](1000000), + // TrafficType: to.Ptr(armnetwork.DdosTrafficTypeTCP), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go index a42f8ecec306..c2a527bcc344 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go index 3a143382dbb0..18bb7fbb4f59 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // DdosProtectionPlansClient contains the methods for the DdosProtectionPlans group. // Don't use this type directly, use NewDdosProtectionPlansClient() instead. +// +// Generated from API version 2025-07-01 type DdosProtectionPlansClient struct { internal *arm.Client subscriptionID string } // NewDdosProtectionPlansClient creates a new instance of DdosProtectionPlansClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewDdosProtectionPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosProtectionPlansClient, error) { @@ -43,9 +43,7 @@ func NewDdosProtectionPlansClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the create or update operation. // - options - DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *DdosProtectionPlansClient) BeginCreateOrUpdate(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosProtectionPlansClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *DdosProtectionPlansClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DdosProtectionPlansClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *DdosProtectionPlansClient) createOrUpdate(ctx context.Context, res // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, _ *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *DdosProtectionPlansClient) BeginDelete(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosProtectionPlansClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *DdosProtectionPlansClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, re // deleteCreateRequest creates the Delete request. func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, _ *DdosProtectionPlansClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. func (client *DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (DdosProtectionPlansClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupN // getCreateRequest creates the Get request. func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, _ *DdosProtectionPlansClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,8 +252,6 @@ func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) } // NewListPager - Gets all DDoS protection plans in a subscription. -// -// Generated from API version 2025-05-01 // - options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager // method. func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { @@ -303,8 +289,8 @@ func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -319,9 +305,7 @@ func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) } // NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager // method. func (client *DdosProtectionPlansClient) NewListByResourceGroupPager(resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) *runtime.Pager[DdosProtectionPlansClientListByResourceGroupResponse] { @@ -350,21 +334,21 @@ func (client *DdosProtectionPlansClient) NewListByResourceGroupPager(resourceGro // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *DdosProtectionPlansClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -380,9 +364,7 @@ func (client *DdosProtectionPlansClient) listByResourceGroupHandleResponse(resp // UpdateTags - Update a DDoS protection plan tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the update DDoS protection plan resource tags. // - options - DdosProtectionPlansClientUpdateTagsOptions contains the optional parameters for the DdosProtectionPlansClient.UpdateTags @@ -412,6 +394,10 @@ func (client *DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourc // updateTagsCreateRequest creates the UpdateTags request. func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject, _ *DdosProtectionPlansClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -420,18 +406,15 @@ func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Con return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go index ebd16eb110c3..b26ce5e23228 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go @@ -1,171 +1,136 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanDelete.json -func ExampleDdosProtectionPlansClient_BeginDelete() { +// Generated from example definition: 2025-07-01/DdosProtectionPlanCreate.json +func ExampleDdosProtectionPlansClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDdosProtectionPlansClient().BeginDelete(ctx, "rg1", "test-plan", nil) + poller, err := clientFactory.NewDdosProtectionPlansClient().BeginCreateOrUpdate(ctx, "rg1", "test-plan", armnetwork.DdosProtectionPlan{ + Location: to.Ptr("westus"), + Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{}, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanGet.json -func ExampleDdosProtectionPlansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosProtectionPlansClient().Get(ctx, "rg1", "test-plan", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, + // res = armnetwork.DdosProtectionPlansClientCreateOrUpdateResponse{ + // DdosProtectionPlan: armnetwork.DdosProtectionPlan{ + // Name: to.Ptr("test-plan"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanCreate.json -func ExampleDdosProtectionPlansClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/DdosProtectionPlanDelete.json +func ExampleDdosProtectionPlansClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDdosProtectionPlansClient().BeginCreateOrUpdate(ctx, "rg1", "test-plan", armnetwork.DdosProtectionPlan{ - Location: to.Ptr("westus"), - Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{}, - }, nil) + poller, err := clientFactory.NewDdosProtectionPlansClient().BeginDelete(ctx, "rg1", "test-plan", 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) + log.Fatalf("failed to poll 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.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // }, - // }, + // res = armnetwork.DdosProtectionPlansClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanUpdateTags.json -func ExampleDdosProtectionPlansClient_UpdateTags() { +// Generated from example definition: 2025-07-01/DdosProtectionPlanGet.json +func ExampleDdosProtectionPlansClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewDdosProtectionPlansClient().UpdateTags(ctx, "rg1", "test-plan", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewDdosProtectionPlansClient().Get(ctx, "rg1", "test-plan", 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.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ + // res = armnetwork.DdosProtectionPlansClientGetResponse{ + // DdosProtectionPlan: armnetwork.DdosProtectionPlan{ + // Name: to.Ptr("test-plan"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // }, // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanListAll.json +// Generated from example definition: 2025-07-01/DdosProtectionPlanListAll.json func ExampleDdosProtectionPlansClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -180,62 +145,69 @@ func ExampleDdosProtectionPlansClient_NewListPager() { _ = 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.DdosProtectionPlanListResult = armnetwork.DdosProtectionPlanListResult{ - // Value: []*armnetwork.DdosProtectionPlan{ - // { - // Name: to.Ptr("plan1"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet1"), - // }}, + // page = armnetwork.DdosProtectionPlansClientListResponse{ + // DdosProtectionPlanListResult: armnetwork.DdosProtectionPlanListResult{ + // Value: []*armnetwork.DdosProtectionPlan{ + // { + // Name: to.Ptr("plan1"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet1"), + // }, + // }, + // }, // }, - // }, - // { - // Name: to.Ptr("plan2"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), + // { + // Name: to.Ptr("plan2"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip3"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet2"), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet3"), - // }}, + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DdosProtectionPlanList.json +// Generated from example definition: 2025-07-01/DdosProtectionPlanList.json func ExampleDdosProtectionPlansClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -250,44 +222,96 @@ func ExampleDdosProtectionPlansClient_NewListByResourceGroupPager() { _ = 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.DdosProtectionPlanListResult = armnetwork.DdosProtectionPlanListResult{ - // Value: []*armnetwork.DdosProtectionPlan{ - // { - // Name: to.Ptr("plan1"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, + // page = armnetwork.DdosProtectionPlansClientListByResourceGroupResponse{ + // DdosProtectionPlanListResult: armnetwork.DdosProtectionPlanListResult{ + // Value: []*armnetwork.DdosProtectionPlan{ + // { + // Name: to.Ptr("plan1"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // }, + // }, // }, - // }, - // { - // Name: to.Ptr("plan2"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, + // { + // Name: to.Ptr("plan2"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // }, + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/DdosProtectionPlanUpdateTags.json +func ExampleDdosProtectionPlansClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDdosProtectionPlansClient().UpdateTags(ctx, "rg1", "test-plan", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.DdosProtectionPlansClientUpdateTagsResponse{ + // DdosProtectionPlan: armnetwork.DdosProtectionPlan{ + // Name: to.Ptr("test-plan"), + // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualNetworks: []*armnetwork.SubResource{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go index 7255892c3ddc..cb181444f5d2 100644 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // DefaultSecurityRulesClient contains the methods for the DefaultSecurityRules group. // Don't use this type directly, use NewDefaultSecurityRulesClient() instead. +// +// Generated from API version 2025-07-01 type DefaultSecurityRulesClient struct { internal *arm.Client subscriptionID string } // NewDefaultSecurityRulesClient creates a new instance of DefaultSecurityRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewDefaultSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DefaultSecurityRulesClient, error) { @@ -43,9 +43,7 @@ func NewDefaultSecurityRulesClient(subscriptionID string, credential azcore.Toke // Get - Get the specified default network security rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - defaultSecurityRuleName - The name of the default security rule. // - options - DefaultSecurityRulesClientGetOptions contains the optional parameters for the DefaultSecurityRulesClient.Get @@ -75,6 +73,10 @@ func (client *DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string, _ *DefaultSecurityRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter defaultSecurityRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{defaultSecurityRuleName}", url.PathEscape(defaultSecurityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -112,9 +110,7 @@ func (client *DefaultSecurityRulesClient) getHandleResponse(resp *http.Response) } // NewListPager - Gets all default security rules in a network security group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - options - DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.NewListPager // method. @@ -144,6 +140,10 @@ func (client *DefaultSecurityRulesClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, _ *DefaultSecurityRulesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -152,17 +152,13 @@ func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go index 53dfb6c1b651..65ea6b800166 100644 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go @@ -1,27 +1,70 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DefaultSecurityRuleList.json +// Generated from example definition: 2025-07-01/DefaultSecurityRuleGet.json +func ExampleDefaultSecurityRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDefaultSecurityRulesClient().Get(ctx, "testrg", "nsg1", "AllowVnetInBound", 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 = armnetwork.DefaultSecurityRulesClientGetResponse{ + // SecurityRule: armnetwork.SecurityRule{ + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/DefaultSecurityRuleList.json func ExampleDefaultSecurityRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,196 +79,155 @@ func ExampleDefaultSecurityRulesClient_NewListPager() { _ = 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.SecurityRuleListResult = armnetwork.SecurityRuleListResult{ - // Value: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ + // page = armnetwork.DefaultSecurityRulesClientListResponse{ + // SecurityRuleListResult: armnetwork.SecurityRuleListResult{ + // Value: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourceAddressPrefixes: []*string{ + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationAddressPrefixes: []*string{ + // }, + // DestinationPortRange: to.Ptr("*"), + // DestinationPortRanges: []*string{ + // }, + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourceAddressPrefixes: []*string{ + // }, + // SourcePortRange: to.Ptr("*"), + // SourcePortRanges: []*string{ + // }, + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DefaultSecurityRuleGet.json -func ExampleDefaultSecurityRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefaultSecurityRulesClient().Get(ctx, "testrg", "nsg1", "AllowVnetInBound", 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.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go index 782ba56a661c..fc60c41e9cda 100644 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // DscpConfigurationClient contains the methods for the DscpConfiguration group. // Don't use this type directly, use NewDscpConfigurationClient() instead. +// +// Generated from API version 2025-07-01 type DscpConfigurationClient struct { internal *arm.Client subscriptionID string } // NewDscpConfigurationClient creates a new instance of DscpConfigurationClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewDscpConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DscpConfigurationClient, error) { @@ -43,11 +43,9 @@ func NewDscpConfigurationClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dscpConfigurationName - The name of the resource. -// - parameters - Parameters supplied to the create or update dscp configuration operation. +// - parameters - Parameters supplied to the create or update DscpConfiguration operation. // - options - DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate // method. func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*runtime.Poller[DscpConfigurationClientCreateOrUpdateResponse], error) { @@ -57,8 +55,7 @@ func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DscpConfigurationClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DscpConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *DscpConfigurationClient) createOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, _ *DscpConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C return nil, errors.New("parameter dscpConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *DscpConfigurationClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DscpConfigurationClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *DscpConfigurationClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, _ *DscpConfigurationClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter dscpConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. func (client *DscpConfigurationClient) Get(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (DscpConfigurationClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *DscpConfigurationClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, _ *DscpConfigurationClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, res return nil, errors.New("parameter dscpConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,9 +252,7 @@ func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (D } // NewListPager - Gets a DSCP Configuration. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager // method. func (client *DscpConfigurationClient) NewListPager(resourceGroupName string, options *DscpConfigurationClientListOptions) *runtime.Pager[DscpConfigurationClientListResponse] { @@ -295,21 +281,21 @@ func (client *DscpConfigurationClient) NewListPager(resourceGroupName string, op // listCreateRequest creates the List request. func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *DscpConfigurationClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -324,8 +310,6 @@ func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) ( } // NewListAllPager - Gets all dscp configurations in a subscription. -// -// Generated from API version 2025-05-01 // - options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager // method. func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { @@ -363,8 +347,8 @@ func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go index 15a2835b80ab..9e0e34c41268 100644 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DscpConfigurationCreate.json +// Generated from example definition: 2025-07-01/DscpConfigurationCreate.json func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,19 +32,23 @@ func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { { EndIP: to.Ptr("127.0.10.2"), StartIP: to.Ptr("127.0.10.1"), - }}, + }, + }, DestinationPortRanges: []*armnetwork.QosPortRange{ { End: to.Ptr[int32](15), Start: to.Ptr[int32](15), - }}, + }, + }, Markings: []*int32{ - to.Ptr[int32](1)}, + to.Ptr[int32](1), + }, SourceIPRanges: []*armnetwork.QosIPRange{ { EndIP: to.Ptr("127.0.0.2"), StartIP: to.Ptr("127.0.0.1"), - }}, + }, + }, SourcePortRanges: []*armnetwork.QosPortRange{ { End: to.Ptr[int32](11), @@ -56,7 +57,8 @@ func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { { End: to.Ptr[int32](21), Start: to.Ptr[int32](20), - }}, + }, + }, Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), }, { @@ -64,26 +66,32 @@ func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { { EndIP: to.Ptr("12.0.10.2"), StartIP: to.Ptr("12.0.10.1"), - }}, + }, + }, DestinationPortRanges: []*armnetwork.QosPortRange{ { End: to.Ptr[int32](52), Start: to.Ptr[int32](51), - }}, + }, + }, Markings: []*int32{ - to.Ptr[int32](2)}, + to.Ptr[int32](2), + }, SourceIPRanges: []*armnetwork.QosIPRange{ { EndIP: to.Ptr("12.0.0.2"), StartIP: to.Ptr("12.0.0.1"), - }}, + }, + }, SourcePortRanges: []*armnetwork.QosPortRange{ { End: to.Ptr[int32](12), Start: to.Ptr[int32](11), - }}, + }, + }, Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - }}, + }, + }, }, }, nil) if err != nil { @@ -91,45 +99,51 @@ func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.DscpConfiguration = armnetwork.DscpConfiguration{ - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, + // res = armnetwork.DscpConfigurationClientCreateOrUpdateResponse{ + // DscpConfiguration: armnetwork.DscpConfiguration{ + // Name: to.Ptr("mydscpConfig"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, // SourceIPRanges: []*armnetwork.QosIPRange{ // { // EndIP: to.Ptr("127.0.0.2"), // StartIP: to.Ptr("127.0.0.1"), - // }}, + // }, + // }, // SourcePortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](12), // Start: to.Ptr[int32](11), - // }}, + // }, + // }, // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), // }, // { @@ -137,38 +151,45 @@ func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { // { // EndIP: to.Ptr("12.0.10.2"), // StartIP: to.Ptr("12.0.10.1"), - // }}, + // }, + // }, // DestinationPortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](52), // Start: to.Ptr[int32](51), - // }}, + // }, + // }, // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DscpConfigurationDelete.json +// Generated from example definition: 2025-07-01/DscpConfigurationDelete.json func ExampleDscpConfigurationClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -176,20 +197,25 @@ func ExampleDscpConfigurationClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.DscpConfigurationClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DscpConfigurationGet.json +// Generated from example definition: 2025-07-01/DscpConfigurationGet.json func ExampleDscpConfigurationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -200,45 +226,52 @@ func ExampleDscpConfigurationClient_Get() { // 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.DscpConfiguration = armnetwork.DscpConfiguration{ - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // res = armnetwork.DscpConfigurationClientGetResponse{ + // DscpConfiguration: armnetwork.DscpConfiguration{ + // Name: to.Ptr("mydscpConfig"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, // SourceIPRanges: []*armnetwork.QosIPRange{ // { // EndIP: to.Ptr("127.0.0.2"), // StartIP: to.Ptr("127.0.0.1"), - // }}, + // }, + // }, // SourcePortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](12), // Start: to.Ptr[int32](11), - // }}, + // }, + // }, // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), // }, // { @@ -246,38 +279,45 @@ func ExampleDscpConfigurationClient_Get() { // { // EndIP: to.Ptr("12.0.10.2"), // StartIP: to.Ptr("12.0.10.1"), - // }}, + // }, + // }, // DestinationPortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](52), // Start: to.Ptr[int32](51), - // }}, + // }, + // }, // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DscpConfigurationList.json +// Generated from example definition: 2025-07-01/DscpConfigurationList.json func ExampleDscpConfigurationClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -292,47 +332,134 @@ func ExampleDscpConfigurationClient_NewListPager() { _ = 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.DscpConfigurationListResult = armnetwork.DscpConfigurationListResult{ - // Value: []*armnetwork.DscpConfiguration{ - // { - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // page = armnetwork.DscpConfigurationClientListResponse{ + // DscpConfigurationListResult: armnetwork.DscpConfigurationListResult{ + // Value: []*armnetwork.DscpConfiguration{ + // { + // Name: to.Ptr("mydscpConfig"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.0.2"), + // StartIP: to.Ptr("127.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), + // }, + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.10.2"), + // StartIP: to.Ptr("12.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](52), + // Start: to.Ptr[int32](51), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("mydscpConfig2"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic3"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic4"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, // SourceIPRanges: []*armnetwork.QosIPRange{ // { // EndIP: to.Ptr("127.0.0.2"), // StartIP: to.Ptr("127.0.0.1"), - // }}, + // }, + // }, // SourcePortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](12), // Start: to.Ptr[int32](11), - // }}, + // }, + // }, // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), // }, // { @@ -340,108 +467,48 @@ func ExampleDscpConfigurationClient_NewListPager() { // { // EndIP: to.Ptr("12.0.10.2"), // StartIP: to.Ptr("12.0.10.1"), - // }}, + // }, + // }, // DestinationPortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](52), // Start: to.Ptr[int32](51), - // }}, + // }, + // }, // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, // }, // }, - // { - // Name: to.Ptr("mydscpConfig2"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic4"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }}, - // } + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/DscpConfigurationListAll.json +// Generated from example definition: 2025-07-01/DscpConfigurationListAll.json func ExampleDscpConfigurationClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -456,47 +523,134 @@ func ExampleDscpConfigurationClient_NewListAllPager() { _ = 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.DscpConfigurationListResult = armnetwork.DscpConfigurationListResult{ - // Value: []*armnetwork.DscpConfiguration{ - // { - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // page = armnetwork.DscpConfigurationClientListAllResponse{ + // DscpConfigurationListResult: armnetwork.DscpConfigurationListResult{ + // Value: []*armnetwork.DscpConfiguration{ + // { + // Name: to.Ptr("mydscpConfig"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.0.2"), + // StartIP: to.Ptr("127.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), + // }, + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.10.2"), + // StartIP: to.Ptr("12.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](52), + // Start: to.Ptr[int32](51), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, + // }, + // }, + // { + // Name: to.Ptr("mydscpConfig2"), + // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ + // AssociatedNetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic3"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic4"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), + // QosDefinitionCollection: []*armnetwork.QosDefinition{ + // { + // DestinationIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("127.0.10.2"), + // StartIP: to.Ptr("127.0.10.1"), + // }, + // }, + // DestinationPortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](62), + // Start: to.Ptr[int32](61), + // }, + // }, + // Markings: []*int32{ + // to.Ptr[int32](1), + // }, // SourceIPRanges: []*armnetwork.QosIPRange{ // { // EndIP: to.Ptr("127.0.0.2"), // StartIP: to.Ptr("127.0.0.1"), - // }}, + // }, + // }, // SourcePortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](12), // Start: to.Ptr[int32](11), - // }}, + // }, + // }, // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), // }, // { @@ -504,96 +658,36 @@ func ExampleDscpConfigurationClient_NewListAllPager() { // { // EndIP: to.Ptr("12.0.10.2"), // StartIP: to.Ptr("12.0.10.1"), - // }}, + // }, + // }, // DestinationPortRanges: []*armnetwork.QosPortRange{ // { // End: to.Ptr[int32](52), // Start: to.Ptr[int32](51), - // }}, + // }, + // }, // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, + // to.Ptr[int32](2), + // }, + // SourceIPRanges: []*armnetwork.QosIPRange{ + // { + // EndIP: to.Ptr("12.0.0.2"), + // StartIP: to.Ptr("12.0.0.1"), + // }, + // }, + // SourcePortRanges: []*armnetwork.QosPortRange{ + // { + // End: to.Ptr[int32](12), + // Start: to.Ptr[int32](11), + // }, + // }, + // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), + // }, // }, // }, - // { - // Name: to.Ptr("mydscpConfig2"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic4"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go b/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go index d5c29e6b9931..b4ca0b6c6d03 100644 --- a/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go index 32d301aa2152..1bddf3ba2242 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go index 2496477a1cda..931831ac6a97 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteCircuitAuthorizationsClient contains the methods for the ExpressRouteCircuitAuthorizations group. // Don't use this type directly, use NewExpressRouteCircuitAuthorizationsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCircuitAuthorizationsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCircuitAuthorizationsClient creates a new instance of ExpressRouteCircuitAuthorizationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitAuthorizationsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string, credentia // BeginCreateOrUpdate - Creates or updates an authorization in the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - authorizationName - The name of the authorization. // - authorizationParameters - Parameters supplied to the create or update express route circuit authorization operation. // - options - ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate @@ -58,8 +56,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginCreateOrUpdate(ctx c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginCreateOrUpdate(ctx c // CreateOrUpdate - Creates or updates an authorization in the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdate(ctx contex // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, _ *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { return nil, err } @@ -129,10 +125,8 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque // BeginDelete - Deletes the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - authorizationName - The name of the authorization. // - options - ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete // method. @@ -143,8 +137,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginDelete(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginDelete(ctx context.C // Delete - Deletes the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitAuthorizationsClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx conte // deleteCreateRequest creates the Delete request. func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, _ *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,27 +189,20 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - authorizationName - The name of the authorization. // - options - ExpressRouteCircuitAuthorizationsClientGetOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.Get // method. @@ -243,6 +231,10 @@ func (client *ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, // getCreateRequest creates the Get request. func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, _ *ExpressRouteCircuitAuthorizationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx cont return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +268,8 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *h } // NewListPager - Gets all authorizations in an express route circuit. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager // method. func (client *ExpressRouteCircuitAuthorizationsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) *runtime.Pager[ExpressRouteCircuitAuthorizationsClientListResponse] { @@ -312,6 +298,10 @@ func (client *ExpressRouteCircuitAuthorizationsClient) NewListPager(resourceGrou // listCreateRequest creates the List request. func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, _ *ExpressRouteCircuitAuthorizationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx con return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go index 7a6f4d257778..99eae4d61058 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go @@ -1,114 +1,120 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitAuthorizationDelete.json -func ExampleExpressRouteCircuitAuthorizationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitAuthorizationCreate.json +func ExampleExpressRouteCircuitAuthorizationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginDelete(ctx, "rg1", "circuitName", "authorizationName", nil) + poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "authorizatinName", armnetwork.ExpressRouteCircuitAuthorization{ + Properties: &armnetwork.AuthorizationPropertiesFormat{}, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse{ + // ExpressRouteCircuitAuthorization: armnetwork.ExpressRouteCircuitAuthorization{ + // Name: to.Ptr("authorizationName"), + // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitAuthorizationGet.json -func ExampleExpressRouteCircuitAuthorizationsClient_Get() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitAuthorizationDelete.json +func ExampleExpressRouteCircuitAuthorizationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().Get(ctx, "rg1", "circuitName", "authorizationName", nil) + poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginDelete(ctx, "rg1", "circuitName", "authorizationName", 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 poll 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.ExpressRouteCircuitAuthorization = armnetwork.ExpressRouteCircuitAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.ExpressRouteCircuitAuthorizationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitAuthorizationCreate.json -func ExampleExpressRouteCircuitAuthorizationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitAuthorizationGet.json +func ExampleExpressRouteCircuitAuthorizationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "authorizatinName", armnetwork.ExpressRouteCircuitAuthorization{ - Properties: &armnetwork.AuthorizationPropertiesFormat{}, - }, nil) + res, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().Get(ctx, "rg1", "circuitName", "authorizationName", 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.ExpressRouteCircuitAuthorization = armnetwork.ExpressRouteCircuitAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.ExpressRouteCircuitAuthorizationsClientGetResponse{ + // ExpressRouteCircuitAuthorization: armnetwork.ExpressRouteCircuitAuthorization{ + // Name: to.Ptr("MyAuthorization1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/authorizations"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authKey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitAuthorizationList.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitAuthorizationList.json func ExampleExpressRouteCircuitAuthorizationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -123,18 +129,21 @@ func ExampleExpressRouteCircuitAuthorizationsClient_NewListPager() { _ = 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.AuthorizationListResult = armnetwork.AuthorizationListResult{ - // Value: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.ExpressRouteCircuitAuthorizationsClientListResponse{ + // AuthorizationListResult: armnetwork.AuthorizationListResult{ + // Value: []*armnetwork.ExpressRouteCircuitAuthorization{ + // { + // Name: to.Ptr("MyAuthorization1"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authKey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go index 8e910d7e3b17..5e02e687eb94 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteCircuitConnectionsClient contains the methods for the ExpressRouteCircuitConnections group. // Don't use this type directly, use NewExpressRouteCircuitConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCircuitConnectionsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCircuitConnectionsClient creates a new instance of ExpressRouteCircuitConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitConnectionsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRouteCircuitConnectionsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - connectionName - The name of the express route circuit connection. // - expressRouteCircuitConnectionParameters - Parameters supplied to the create or update express route circuit connection @@ -60,8 +58,7 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginCreateOrUpdate(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,8 +70,6 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate" @@ -99,6 +94,10 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdate(ctx context.C // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, _ *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -115,18 +114,15 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters); err != nil { return nil, err } @@ -135,10 +131,8 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( // BeginDelete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - connectionName - The name of the express route circuit connection. // - options - ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete @@ -150,8 +144,7 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginDelete(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -163,8 +156,6 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginDelete(ctx context.Cont // Delete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitConnectionsClient.BeginDelete" @@ -189,6 +180,10 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteOperation(ctx context. // deleteCreateRequest creates the Delete request. func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, _ *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -205,27 +200,20 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - connectionName - The name of the express route circuit connection. // - options - ExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.Get @@ -255,6 +243,10 @@ func (client *ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, res // getCreateRequest creates the Get request. func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, _ *ExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -271,17 +263,13 @@ func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -296,10 +284,8 @@ func (client *ExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http } // NewListPager - Gets all global reach connections associated with a private peering in an express route circuit. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - options - ExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.NewListPager // method. @@ -329,6 +315,10 @@ func (client *ExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupNa // listCreateRequest creates the List request. func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, _ *ExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -341,17 +331,13 @@ func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx contex return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go index 341ab0df2d2c..a402751ef8d1 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go @@ -1,150 +1,156 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitConnectionDelete.json -func ExampleExpressRouteCircuitConnectionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitConnectionCreate.json +func ExampleExpressRouteCircuitConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginDelete(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", nil) + poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", armnetwork.ExpressRouteCircuitConnection{ + Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/29"), + AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), + ExpressRouteCircuitPeering: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), + }, + IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ + AddressPrefix: to.Ptr("aa:bb::/125"), + }, + PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse{ + // ExpressRouteCircuitConnection: armnetwork.ExpressRouteCircuitConnection{ + // Name: to.Ptr("circuitConnectionUSAUS"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), + // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/24"), + // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), + // }, + // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ + // AddressPrefix: to.Ptr("aa:bb::1/125"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitConnectionGet.json -func ExampleExpressRouteCircuitConnectionsClient_Get() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitConnectionDelete.json +func ExampleExpressRouteCircuitConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", nil) + poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginDelete(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", 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 poll 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.ExpressRouteCircuitConnection = armnetwork.ExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings/connections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.ExpressRouteCircuitConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitConnectionCreate.json -func ExampleExpressRouteCircuitConnectionsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitConnectionGet.json +func ExampleExpressRouteCircuitConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", armnetwork.ExpressRouteCircuitConnection{ - Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/29"), - AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - ExpressRouteCircuitPeering: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - }, - IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - AddressPrefix: to.Ptr("aa:bb::/125"), - }, - PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - }, - }, - }, nil) + res, err := clientFactory.NewExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", 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.ExpressRouteCircuitConnection = armnetwork.ExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), + // res = armnetwork.ExpressRouteCircuitConnectionsClientGetResponse{ + // ExpressRouteCircuitConnection: armnetwork.ExpressRouteCircuitConnection{ + // Name: to.Ptr("circuitConnectionUSAUS"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings/connections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), + // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/24"), + // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), + // }, + // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ + // AddressPrefix: to.Ptr("aa:bb::1/125"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitConnectionList.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitConnectionList.json func ExampleExpressRouteCircuitConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -159,45 +165,48 @@ func ExampleExpressRouteCircuitConnectionsClient_NewListPager() { _ = 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.ExpressRouteCircuitConnectionListResult = armnetwork.ExpressRouteCircuitConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCircuitConnection{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), + // page = armnetwork.ExpressRouteCircuitConnectionsClientListResponse{ + // ExpressRouteCircuitConnectionListResult: armnetwork.ExpressRouteCircuitConnectionListResult{ + // Value: []*armnetwork.ExpressRouteCircuitConnection{ + // { + // Name: to.Ptr("circuitConnectionUSAUS"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), + // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/24"), + // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), + // }, + // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ + // AddressPrefix: to.Ptr("aa:bb::1/125"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSEUR"), - // Name: to.Ptr("circuitConnectionUSEUR"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/24"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharckteurope/providers/Microsoft.Network/expressRouteCircuits/dedharcktams/peerings/AzurePrivatePeering"), + // { + // Name: to.Ptr("circuitConnectionUSEUR"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSEUR"), + // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("20.0.0.0/24"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dedharckteurope/providers/Microsoft.Network/expressRouteCircuits/dedharcktams/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go index 8a8f8fd73254..12b5ed21c8ba 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteCircuitPeeringsClient contains the methods for the ExpressRouteCircuitPeerings group. // Don't use this type directly, use NewExpressRouteCircuitPeeringsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCircuitPeeringsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCircuitPeeringsClient creates a new instance of ExpressRouteCircuitPeeringsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCircuitPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitPeeringsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRouteCircuitPeeringsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates a peering in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - peeringParameters - Parameters supplied to the create or update express route circuit peering operation. // - options - ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate @@ -58,8 +56,7 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginCreateOrUpdate(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates a peering in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdate(ctx context.Cont // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, _ *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { return nil, err } @@ -129,10 +125,8 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specified peering from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - options - ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete // method. @@ -143,8 +137,7 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginDelete(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginDelete(ctx context.Context // Delete - Deletes the specified peering from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitPeeringsClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteOperation(ctx context.Con // deleteCreateRequest creates the Delete request. func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, _ *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,27 +189,20 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified peering for the express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - options - ExpressRouteCircuitPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.Get // method. @@ -243,6 +231,10 @@ func (client *ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resour // getCreateRequest creates the Get request. func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, _ *ExpressRouteCircuitPeeringsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Co return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +268,8 @@ func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Re } // NewListPager - Gets all peerings in a specified express route circuit. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.NewListPager // method. func (client *ExpressRouteCircuitPeeringsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) *runtime.Pager[ExpressRouteCircuitPeeringsClientListResponse] { @@ -312,6 +298,10 @@ func (client *ExpressRouteCircuitPeeringsClient) NewListPager(resourceGroupName // listCreateRequest creates the List request. func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, _ *ExpressRouteCircuitPeeringsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.C return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go index 5a6afca132de..4d86f66976fa 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go @@ -1,28 +1,82 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitPeeringDelete.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitPeeringCreate.json +func ExampleExpressRouteCircuitPeeringsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "AzurePrivatePeering", armnetwork.ExpressRouteCircuitPeering{ + Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ + PeerASN: to.Ptr[int64](200), + PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + VlanID: to.Ptr[int32](200), + }, + }, 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 poll 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 = armnetwork.ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse{ + // ExpressRouteCircuitPeering: armnetwork.ExpressRouteCircuitPeering{ + // Name: to.Ptr("AzurePrivatePeering"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), + // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr(""), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // }, + // LastModifiedBy: to.Ptr("Customer"), + // PeerASN: to.Ptr[int64](200), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), + // PrimaryAzurePort: to.Ptr(""), + // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr(""), + // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](200), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitPeeringDelete.json func ExampleExpressRouteCircuitPeeringsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,20 +84,25 @@ func ExampleExpressRouteCircuitPeeringsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteCircuitPeeringsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitPeeringGet.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitPeeringGet.json func ExampleExpressRouteCircuitPeeringsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -54,20 +113,22 @@ func ExampleExpressRouteCircuitPeeringsClient_Get() { // 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.ExpressRouteCircuitPeering = armnetwork.ExpressRouteCircuitPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), - // Name: to.Ptr("MicrosoftPeering"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("3FFE:FFFF:0:CD31::/120")}, + // res = armnetwork.ExpressRouteCircuitPeeringsClientGetResponse{ + // ExpressRouteCircuitPeering: armnetwork.ExpressRouteCircuitPeering{ + // Name: to.Ptr("MicrosoftPeering"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings"), + // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), + // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr("103"), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ + // AdvertisedCommunities: []*string{ + // }, + // AdvertisedPublicPrefixes: []*string{ + // to.Ptr("3FFE:FFFF:0:CD31::/120"), + // }, // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), // CustomerASN: to.Ptr[int32](23), // LegacyMode: to.Ptr[int32](0), @@ -82,93 +143,38 @@ func ExampleExpressRouteCircuitPeeringsClient_Get() { // AdvertisedCommunities: []*string{ // }, // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("123.1.0.0/24")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), + // to.Ptr("123.1.0.0/24"), // }, - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilter: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // }, - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](300), + // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), + // CustomerASN: to.Ptr[int32](23), + // LegacyMode: to.Ptr[int32](0), + // RoutingRegistryName: to.Ptr("ARIN"), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitPeeringCreate.json -func ExampleExpressRouteCircuitPeeringsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "AzurePrivatePeering", armnetwork.ExpressRouteCircuitPeering{ - Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - PeerASN: to.Ptr[int64](200), - PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - VlanID: to.Ptr[int32](200), - }, - }, 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.ExpressRouteCircuitPeering = armnetwork.ExpressRouteCircuitPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // }, - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // PeerASN: to.Ptr[int64](100), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), + // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), + // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RouteFilter: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // }, + // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), + // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](300), // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitPeeringList.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitPeeringList.json func ExampleExpressRouteCircuitPeeringsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -183,23 +189,23 @@ func ExampleExpressRouteCircuitPeeringsClient_NewListPager() { _ = 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.ExpressRouteCircuitPeeringListResult = armnetwork.ExpressRouteCircuitPeeringListResult{ - // Value: []*armnetwork.ExpressRouteCircuitPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), - // Name: to.Ptr("MicrosoftPeering"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // }, - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("3FFE:FFFF:0:CD31::/120")}, + // page = armnetwork.ExpressRouteCircuitPeeringsClientListResponse{ + // ExpressRouteCircuitPeeringListResult: armnetwork.ExpressRouteCircuitPeeringListResult{ + // Value: []*armnetwork.ExpressRouteCircuitPeering{ + // { + // Name: to.Ptr("MicrosoftPeering"), + // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), + // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr("103"), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ + // AdvertisedCommunities: []*string{ + // }, + // AdvertisedPublicPrefixes: []*string{ + // to.Ptr("3FFE:FFFF:0:CD31::/120"), + // }, // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), // CustomerASN: to.Ptr[int32](23), // LegacyMode: to.Ptr[int32](0), @@ -214,50 +220,53 @@ func ExampleExpressRouteCircuitPeeringsClient_NewListPager() { // AdvertisedCommunities: []*string{ // }, // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("123.1.0.0/24")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), + // to.Ptr("123.1.0.0/24"), // }, - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](300), + // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), + // CustomerASN: to.Ptr[int32](23), + // LegacyMode: to.Ptr[int32](0), + // RoutingRegistryName: to.Ptr("ARIN"), // }, + // PeerASN: to.Ptr[int64](100), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), + // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), + // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), + // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](300), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // }, - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("10.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("10.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), + // }, + // { + // Name: to.Ptr("AzurePrivatePeering"), + // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), + // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ + // AzureASN: to.Ptr[int32](12076), + // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), // }, - // }}, - // } + // GatewayManagerEtag: to.Ptr("103"), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // }, + // LastModifiedBy: to.Ptr("Customer"), + // PeerASN: to.Ptr[int64](100), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), + // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), + // PrimaryPeerAddressPrefix: to.Ptr("10.0.0.0/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), + // SecondaryPeerAddressPrefix: to.Ptr("10.0.0.4/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](200), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go index 21099141b9b2..4308daa06fe2 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -14,19 +13,21 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) // ExpressRouteCircuitsClient contains the methods for the ExpressRouteCircuits group. // Don't use this type directly, use NewExpressRouteCircuitsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCircuitsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCircuitsClient creates a new instance of ExpressRouteCircuitsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCircuitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitsClient, error) { @@ -43,10 +44,8 @@ func NewExpressRouteCircuitsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates an express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - parameters - Parameters supplied to the create or update express route circuit operation. // - options - ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate // method. @@ -57,8 +56,7 @@ func (client *ExpressRouteCircuitsClient) BeginCreateOrUpdate(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +68,6 @@ func (client *ExpressRouteCircuitsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates an express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginCreateOrUpdate" @@ -96,6 +92,10 @@ func (client *ExpressRouteCircuitsClient) createOrUpdate(ctx context.Context, re // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, _ *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +104,15 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,10 +121,8 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete // method. func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitsClientDeleteResponse], error) { @@ -137,8 +132,7 @@ func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +144,6 @@ func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginDelete" @@ -176,6 +168,10 @@ func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, r // deleteCreateRequest creates the Delete request. func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, _ *ExpressRouteCircuitsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +180,19 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get // method. @@ -232,6 +221,10 @@ func (client *ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, _ *ExpressRouteCircuitsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +233,13 @@ func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,12 +253,170 @@ func (client *ExpressRouteCircuitsClient) getHandleResponse(resp *http.Response) return result, nil } +// BeginGetCircuitLinkFailoverAllTestsDetails - Retrieves the details of all the link failover tests performed on the express +// route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. +// - options - ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions contains the optional parameters +// for the ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails method. +func (client *ExpressRouteCircuitsClient) BeginGetCircuitLinkFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions) (*runtime.Poller[ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getCircuitLinkFailoverAllTestsDetails(ctx, resourceGroupName, circuitName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetCircuitLinkFailoverAllTestsDetails - Retrieves the details of all the link failover tests performed on the express route +// circuit. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteCircuitsClient) getCircuitLinkFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCircuitLinkFailoverAllTestsDetailsCreateRequest(ctx, resourceGroupName, circuitName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getCircuitLinkFailoverAllTestsDetailsCreateRequest creates the GetCircuitLinkFailoverAllTestsDetails request. +func (client *ExpressRouteCircuitsClient) getCircuitLinkFailoverAllTestsDetailsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/getCircuitLinkFailoverAllTestsDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + if options != nil && options.FailoverTestType != nil { + reqQP.Set("failoverTestType", *options.FailoverTestType) + } + if options != nil && options.FetchLatest != nil { + reqQP.Set("fetchLatest", strconv.FormatBool(*options.FetchLatest)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetCircuitLinkFailoverSingleTestDetails - Retrieves the details of a particular link failover test performed on the +// express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. +// - linkType - The link type. +// - circuitTestCategory - The circuit test category. +// - failoverTestID - The unique Guid value which identifies the test. +// - options - ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions contains the optional parameters +// for the ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails method. +func (client *ExpressRouteCircuitsClient) BeginGetCircuitLinkFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, failoverTestID string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions) (*runtime.Poller[ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getCircuitLinkFailoverSingleTestDetails(ctx, resourceGroupName, circuitName, linkType, circuitTestCategory, failoverTestID, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetCircuitLinkFailoverSingleTestDetails - Retrieves the details of a particular link failover test performed on the express +// route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteCircuitsClient) getCircuitLinkFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, failoverTestID string, options *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCircuitLinkFailoverSingleTestDetailsCreateRequest(ctx, resourceGroupName, circuitName, linkType, circuitTestCategory, failoverTestID, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getCircuitLinkFailoverSingleTestDetailsCreateRequest creates the GetCircuitLinkFailoverSingleTestDetails request. +func (client *ExpressRouteCircuitsClient) getCircuitLinkFailoverSingleTestDetailsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, failoverTestID string, _ *ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/getCircuitLinkFailoverSingleTestDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + reqQP.Set("circuitTestCategory", circuitTestCategory) + reqQP.Set("failoverTestId", failoverTestID) + reqQP.Set("linkType", linkType) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // GetPeeringStats - Gets all stats from an express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - options - ExpressRouteCircuitsClientGetPeeringStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetPeeringStats // method. @@ -298,6 +445,10 @@ func (client *ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, r // getPeeringStatsCreateRequest creates the GetPeeringStats request. func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, _ *ExpressRouteCircuitsClientGetPeeringStatsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -310,17 +461,13 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx conte return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -336,10 +483,8 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsHandleResponse(resp *ht // GetStats - Gets all the stats from an express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats // method. func (client *ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (ExpressRouteCircuitsClientGetStatsResponse, error) { @@ -367,6 +512,10 @@ func (client *ExpressRouteCircuitsClient) GetStats(ctx context.Context, resource // getStatsCreateRequest creates the GetStats request. func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, _ *ExpressRouteCircuitsClientGetStatsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -375,17 +524,13 @@ func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Cont return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -400,9 +545,7 @@ func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Resp } // NewListPager - Gets all the express route circuits in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager // method. func (client *ExpressRouteCircuitsClient) NewListPager(resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) *runtime.Pager[ExpressRouteCircuitsClientListResponse] { @@ -431,21 +574,21 @@ func (client *ExpressRouteCircuitsClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *ExpressRouteCircuitsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -460,8 +603,6 @@ func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response } // NewListAllPager - Gets all the express route circuits in a subscription. -// -// Generated from API version 2025-05-01 // - options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager // method. func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { @@ -499,8 +640,8 @@ func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -516,12 +657,10 @@ func (client *ExpressRouteCircuitsClient) listAllHandleResponse(resp *http.Respo // BeginListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of the express route port. // - peeringName - The name of the peering. -// - devicePath - The path of the device. +// - devicePath - The name of the arpTables. // - options - ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable // method. func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListArpTableResponse], error) { @@ -531,8 +670,7 @@ func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListArpTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -544,8 +682,6 @@ func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, // ListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitsClient) listArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListArpTable" @@ -570,6 +706,10 @@ func (client *ExpressRouteCircuitsClient) listArpTable(ctx context.Context, reso // listArpTableCreateRequest creates the ListArpTable request. func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, _ *ExpressRouteCircuitsClientBeginListArpTableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -586,17 +726,13 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -604,12 +740,10 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. // BeginListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of the express route port. // - peeringName - The name of the peering. -// - devicePath - The path of the device. +// - devicePath - The name of the routeTables. // - options - ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable // method. func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableResponse], error) { @@ -619,8 +753,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -632,8 +765,6 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Conte // ListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitsClient) listRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListRoutesTable" @@ -658,6 +789,10 @@ func (client *ExpressRouteCircuitsClient) listRoutesTable(ctx context.Context, r // listRoutesTableCreateRequest creates the ListRoutesTable request. func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, _ *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -674,17 +809,13 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -692,12 +823,10 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte // BeginListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit // in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of the express route port. // - peeringName - The name of the peering. -// - devicePath - The path of the device. +// - devicePath - The name of the routeTablesSummary. // - options - ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary // method. func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableSummaryResponse], error) { @@ -707,8 +836,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableSummaryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -721,8 +849,6 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx contex // ListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit in // a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCircuitsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListRoutesTableSummary" @@ -747,6 +873,10 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummary(ctx context.Con // listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, _ *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -763,27 +893,176 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStartCircuitLinkFailoverTest - Starts link failover simulation on the express route circuit for the specified link +// type and test category. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. +// - linkType - The link type. +// - circuitTestCategory - The circuit test category. +// - options - ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest +// method. +func (client *ExpressRouteCircuitsClient) BeginStartCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, options *ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions) (*runtime.Poller[ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startCircuitLinkFailoverTest(ctx, resourceGroupName, circuitName, linkType, circuitTestCategory, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartCircuitLinkFailoverTest - Starts link failover simulation on the express route circuit for the specified link type +// and test category. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteCircuitsClient) startCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, options *ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startCircuitLinkFailoverTestCreateRequest(ctx, resourceGroupName, circuitName, linkType, circuitTestCategory, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startCircuitLinkFailoverTestCreateRequest creates the StartCircuitLinkFailoverTest request. +func (client *ExpressRouteCircuitsClient) startCircuitLinkFailoverTestCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, _ *ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/startCircuitLinkFailoverTest" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + reqQP.Set("circuitTestCategory", circuitTestCategory) + reqQP.Set("linkType", linkType) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginStopCircuitLinkFailoverTest - Stops link failover simulation on the express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. +// - stopParameters - The content of the action request +// - options - ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest +// method. +func (client *ExpressRouteCircuitsClient) BeginStopCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, stopParameters ExpressRouteLinkFailoverStopAPIParameters, options *ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions) (*runtime.Poller[ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopCircuitLinkFailoverTest(ctx, resourceGroupName, circuitName, stopParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StopCircuitLinkFailoverTest - Stops link failover simulation on the express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteCircuitsClient) stopCircuitLinkFailoverTest(ctx context.Context, resourceGroupName string, circuitName string, stopParameters ExpressRouteLinkFailoverStopAPIParameters, options *ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopCircuitLinkFailoverTestCreateRequest(ctx, resourceGroupName, circuitName, stopParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopCircuitLinkFailoverTestCreateRequest creates the StopCircuitLinkFailoverTest request. +func (client *ExpressRouteCircuitsClient) stopCircuitLinkFailoverTestCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, stopParameters ExpressRouteLinkFailoverStopAPIParameters, _ *ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stopCircuitLinkFailoverTest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, stopParameters); err != nil { + return nil, err + } + return req, nil +} + // UpdateTags - Updates an express route circuit tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - parameters - Parameters supplied to update express route circuit tags. // - options - ExpressRouteCircuitsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCircuitsClient.UpdateTags // method. @@ -812,6 +1091,10 @@ func (client *ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resour // updateTagsCreateRequest creates the UpdateTags request. func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject, _ *ExpressRouteCircuitsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -820,18 +1103,15 @@ func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Co return nil, errors.New("parameter circuitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go index 0f47a2e6fc63..b6026fbd8a3e 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go @@ -1,97 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitDelete.json -func ExampleExpressRouteCircuitsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginDelete(ctx, "rg1", "circuitName", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitGet.json -func ExampleExpressRouteCircuitsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitsClient().Get(ctx, "rg1", "circuitName", 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.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("circuitName"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitCreate.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitCreate.json func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCircuit() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -118,49 +46,51 @@ func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCir } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("circuitName"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // Location: to.Ptr("Brazil South"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // res = armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse{ + // ExpressRouteCircuit: armnetwork.ExpressRouteCircuit{ + // Name: to.Ptr("circuitName"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), + // Location: to.Ptr("Brazil South"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("Silicon Valley"), + // ServiceProviderName: to.Ptr("Equinix"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("Silicon Valley"), - // ServiceProviderName: to.Ptr("Equinix"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitCreateOnExpressRoutePort.json func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCircuitOnExpressRoutePort() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -171,7 +101,7 @@ func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCir BandwidthInGbps: to.Ptr[float32](10), EnableDirectPortRateLimit: to.Ptr(false), ExpressRoutePort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), }, }, SKU: &armnetwork.ExpressRouteCircuitSKU{ @@ -185,261 +115,304 @@ func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCir } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("expressRouteCircuit1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuit1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // AuthorizationKey: to.Ptr("b0be57f5-1fba-463b-adec-ffe767354cdd"), - // AuthorizationStatus: to.Ptr("Enabled"), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // res = armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse{ + // ExpressRouteCircuit: armnetwork.ExpressRouteCircuit{ + // Name: to.Ptr("expressRouteCircuit1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuit1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // AuthorizationKey: to.Ptr("b0be57f5-1fba-463b-adec-ffe767354cdd"), + // AuthorizationStatus: to.Ptr("Enabled"), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // }, + // BandwidthInGbps: to.Ptr[float32](10), + // CircuitProvisioningState: to.Ptr("Enabled"), + // EnableDirectPortRateLimit: to.Ptr(false), + // ExpressRoutePort: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // }, + // GatewayManagerEtag: to.Ptr("20"), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("d281f746-ee01-4d00-8b0a-edec4833772b"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), // }, - // BandwidthInGbps: to.Ptr[float32](10), - // CircuitProvisioningState: to.Ptr("Enabled"), - // EnableDirectPortRateLimit: to.Ptr(false), - // ExpressRoutePort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Premium_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierPremium), // }, - // GatewayManagerEtag: to.Ptr("20"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("d281f746-ee01-4d00-8b0a-edec4833772b"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Premium_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierPremium), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitUpdateTags.json -func ExampleExpressRouteCircuitsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitDelete.json +func ExampleExpressRouteCircuitsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCircuitsClient().UpdateTags(ctx, "ertest", "er1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginDelete(ctx, "rg1", "circuitName", 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 poll 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.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("er1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("0b392c2e-1e9d-46d7-b5e0-9ce90ca6b60c"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // PeeringLocation: to.Ptr("Silicon Valley"), - // ServiceProviderName: to.Ptr("Equinix"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, + // res = armnetwork.ExpressRouteCircuitsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitARPTableList.json -func ExampleExpressRouteCircuitsClient_BeginListArpTable() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitGet.json +func ExampleExpressRouteCircuitsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListArpTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) + res, err := clientFactory.NewExpressRouteCircuitsClient().Get(ctx, "rg1", "circuitName", 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.ExpressRouteCircuitsArpTableListResult = armnetwork.ExpressRouteCircuitsArpTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitArpTable{ - // { - // Age: to.Ptr[int32](0), - // Interface: to.Ptr("Microsoft"), - // IPAddress: to.Ptr("IPAddress"), - // MacAddress: to.Ptr("macAddress"), - // }}, + // res = armnetwork.ExpressRouteCircuitsClientGetResponse{ + // ExpressRouteCircuit: armnetwork.ExpressRouteCircuit{ + // Name: to.Ptr("circuitName"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("peeringLocation"), + // ServiceProviderName: to.Ptr("providerName"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + // }, + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitRouteTableList.json -func ExampleExpressRouteCircuitsClient_BeginListRoutesTable() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitGetCircuitLinkFailoverAllTestsDetails.json +func ExampleExpressRouteCircuitsClient_BeginGetCircuitLinkFailoverAllTestsDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginGetCircuitLinkFailoverAllTestsDetails(ctx, "rg1", "circuit1", &armnetwork.ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions{ + FailoverTestType: to.Ptr("SingleSiteFailover"), + FetchLatest: to.Ptr(true)}) 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) + log.Fatalf("failed to poll 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.ExpressRouteCircuitsRoutesTableListResult = armnetwork.ExpressRouteCircuitsRoutesTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ + // res = armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse{ + // ExpressRouteLinkFailoverAllTestsDetailsArray: []*armnetwork.ExpressRouteLinkFailoverAllTestsDetails{ // { - // Path: to.Ptr(""), - // LocPrf: to.Ptr(""), - // Network: to.Ptr(""), - // NextHop: to.Ptr(""), - // Weight: to.Ptr[int32](0), - // }}, + // Status: to.Ptr(armnetwork.FailoverTestStatusCompleted), + // StartTime: to.Ptr("2025-01-01T00:00:00Z"), + // EndTime: to.Ptr("2025-01-01T01:00:00Z"), + // TestGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // TestType: to.Ptr(armnetwork.FailoverTestTypeSingleSiteFailover), + // Issues: []*string{ + // }, + // WasSimulationSuccessful: to.Ptr(true), + // CircuitTestCategory: to.Ptr(armnetwork.MaintenanceTestCategoryBgpDisconnect), + // LinkType: to.Ptr(armnetwork.ExpressRouteFailoverLinkTypePrimary), + // BgpStatus: []*armnetwork.ExpressRouteLinkFailoverTestBgpStatus{ + // { + // Type: to.Ptr(armnetwork.ExpressRouteFailoverBgpStatusAddressFamilyIPv4), + // Link: to.Ptr(armnetwork.ExpressRouteFailoverLinkTypePrimary), + // Status: to.Ptr(armnetwork.ExpressRouteLinkFailoverBgpStatusConnected), + // CheckTimeUTC: to.Ptr("2025-01-01T00:30:00Z"), + // }, + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitRouteTableSummaryList.json -func ExampleExpressRouteCircuitsClient_BeginListRoutesTableSummary() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitGetCircuitLinkFailoverSingleTestDetails.json +func ExampleExpressRouteCircuitsClient_BeginGetCircuitLinkFailoverSingleTestDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTableSummary(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginGetCircuitLinkFailoverSingleTestDetails(ctx, "rg1", "circuit1", "Primary", "BgpDisconnect", "00000000-0000-0000-0000-000000000001", 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) + log.Fatalf("failed to poll 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.ExpressRouteCircuitsRoutesTableSummaryListResult = armnetwork.ExpressRouteCircuitsRoutesTableSummaryListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTableSummary{ + // res = armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse{ + // ExpressRouteLinkFailoverSingleTestDetailsArray: []*armnetwork.ExpressRouteLinkFailoverSingleTestDetails{ // { - // As: to.Ptr[int32](9583), - // Neighbor: to.Ptr("100.65.171.1"), - // StatePfxRcd: to.Ptr("Idle"), - // UpDown: to.Ptr("never"), - // V: to.Ptr[int32](4), - // }}, + // StartTimeUTC: to.Ptr("2025-01-01T00:00:00Z"), + // EndTimeUTC: to.Ptr("2025-01-01T01:00:00Z"), + // Status: to.Ptr(armnetwork.FailoverTestStatusCompleted), + // WasSimulationSuccessful: to.Ptr(true), + // LinkType: to.Ptr(armnetwork.ExpressRouteFailoverLinkTypePrimary), + // CircuitTestCategory: to.Ptr(armnetwork.MaintenanceTestCategoryBgpDisconnect), + // IsSimulationVerified: to.Ptr(true), + // RedundantRoutes: &armnetwork.ExpressRouteLinkFailoverRouteList{ + // BeforeSimulation: []*armnetwork.ExpressRouteLinkFailoverRoute{ + // { + // Route: to.Ptr("10.0.0.0/24"), + // NextHop: to.Ptr("10.0.0.1"), + // PrimaryASPath: to.Ptr("65000 65001"), + // SecondaryASPath: to.Ptr("65000 65002"), + // }, + // }, + // DuringSimulation: []*armnetwork.ExpressRouteLinkFailoverRoute{ + // { + // Route: to.Ptr("10.0.0.0/24"), + // NextHop: to.Ptr("10.0.0.2"), + // PrimaryASPath: to.Ptr("65000 65001"), + // SecondaryASPath: to.Ptr("65000 65002"), + // }, + // }, + // }, + // NonRedundantRoutes: &armnetwork.ExpressRouteLinkFailoverRouteList{ + // BeforeSimulation: []*armnetwork.ExpressRouteLinkFailoverRoute{ + // }, + // DuringSimulation: []*armnetwork.ExpressRouteLinkFailoverRoute{ + // }, + // }, + // BgpStatus: []*armnetwork.ExpressRouteLinkFailoverTestBgpStatus{ + // { + // Type: to.Ptr(armnetwork.ExpressRouteFailoverBgpStatusAddressFamilyIPv4), + // Link: to.Ptr(armnetwork.ExpressRouteFailoverLinkTypePrimary), + // Status: to.Ptr(armnetwork.ExpressRouteLinkFailoverBgpStatusConnected), + // CheckTimeUTC: to.Ptr("2025-01-01T00:30:00Z"), + // }, + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitStats.json -func ExampleExpressRouteCircuitsClient_GetStats() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitPeeringStats.json +func ExampleExpressRouteCircuitsClient_GetPeeringStats() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCircuitsClient().GetStats(ctx, "rg1", "circuitName", nil) + res, err := clientFactory.NewExpressRouteCircuitsClient().GetPeeringStats(ctx, "rg1", "circuitName", "peeringName", 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.ExpressRouteCircuitStats = armnetwork.ExpressRouteCircuitStats{ - // PrimarybytesIn: to.Ptr[int64](537408), - // PrimarybytesOut: to.Ptr[int64](44032550), - // SecondarybytesIn: to.Ptr[int64](0), - // SecondarybytesOut: to.Ptr[int64](39002500), + // res = armnetwork.ExpressRouteCircuitsClientGetPeeringStatsResponse{ + // ExpressRouteCircuitStats: armnetwork.ExpressRouteCircuitStats{ + // PrimarybytesIn: to.Ptr[int64](537408), + // PrimarybytesOut: to.Ptr[int64](44032550), + // SecondarybytesIn: to.Ptr[int64](0), + // SecondarybytesOut: to.Ptr[int64](39002500), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitPeeringStats.json -func ExampleExpressRouteCircuitsClient_GetPeeringStats() { +// Generated from example definition: 2025-07-01/ExpressRouteCircuitStats.json +func ExampleExpressRouteCircuitsClient_GetStats() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCircuitsClient().GetPeeringStats(ctx, "rg1", "circuitName", "peeringName", nil) + res, err := clientFactory.NewExpressRouteCircuitsClient().GetStats(ctx, "rg1", "circuitName", 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.ExpressRouteCircuitStats = armnetwork.ExpressRouteCircuitStats{ - // PrimarybytesIn: to.Ptr[int64](537408), - // PrimarybytesOut: to.Ptr[int64](44032550), - // SecondarybytesIn: to.Ptr[int64](0), - // SecondarybytesOut: to.Ptr[int64](39002500), + // res = armnetwork.ExpressRouteCircuitsClientGetStatsResponse{ + // ExpressRouteCircuitStats: armnetwork.ExpressRouteCircuitStats{ + // PrimarybytesIn: to.Ptr[int64](537408), + // PrimarybytesOut: to.Ptr[int64](44032550), + // SecondarybytesIn: to.Ptr[int64](0), + // SecondarybytesOut: to.Ptr[int64](39002500), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitListByResourceGroup.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitListByResourceGroup.json func ExampleExpressRouteCircuitsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -454,96 +427,101 @@ func ExampleExpressRouteCircuitsClient_NewListPager() { _ = 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.ExpressRouteCircuitListResult = armnetwork.ExpressRouteCircuitListResult{ - // Value: []*armnetwork.ExpressRouteCircuit{ - // { - // Name: to.Ptr("circuitName1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.ExpressRouteCircuitsClientListResponse{ + // ExpressRouteCircuitListResult: armnetwork.ExpressRouteCircuitListResult{ + // Value: []*armnetwork.ExpressRouteCircuit{ + // { + // Name: to.Ptr("circuitName1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // { + // Name: to.Ptr("MyAuthorization1"), + // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authkey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr("113"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // GatewayManagerEtag: to.Ptr("113"), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("peeringLocation"), + // ServiceProviderName: to.Ptr("providerName"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // }, - // { - // Name: to.Ptr("circuitName2"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), - // Name: to.Ptr("MyAuthorization2"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("circuitName2"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // { + // Name: to.Ptr("MyAuthorization2"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authkey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // GatewayManagerEtag: to.Ptr(""), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("peeringLocation"), + // ServiceProviderName: to.Ptr("providerName"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCircuitListBySubscription.json +// Generated from example definition: 2025-07-01/ExpressRouteCircuitListBySubscription.json func ExampleExpressRouteCircuitsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -558,84 +536,317 @@ func ExampleExpressRouteCircuitsClient_NewListAllPager() { _ = 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.ExpressRouteCircuitListResult = armnetwork.ExpressRouteCircuitListResult{ - // Value: []*armnetwork.ExpressRouteCircuit{ - // { - // Name: to.Ptr("circuitName1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.ExpressRouteCircuitsClientListAllResponse{ + // ExpressRouteCircuitListResult: armnetwork.ExpressRouteCircuitListResult{ + // Value: []*armnetwork.ExpressRouteCircuit{ + // { + // Name: to.Ptr("circuitName1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // { + // Name: to.Ptr("MyAuthorization1"), + // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authkey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr("113"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // GatewayManagerEtag: to.Ptr("113"), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("peeringLocation"), + // ServiceProviderName: to.Ptr("providerName"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // }, - // { - // Name: to.Ptr("circuitName2"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), - // Name: to.Ptr("MyAuthorization2"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("circuitName2"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // { + // Name: to.Ptr("MyAuthorization2"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), + // Properties: &armnetwork.AuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authkey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // GatewayManagerEtag: to.Ptr(""), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](200), + // PeeringLocation: to.Ptr("peeringLocation"), + // ServiceProviderName: to.Ptr("providerName"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitARPTableList.json +func ExampleExpressRouteCircuitsClient_BeginListArpTable() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListArpTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", 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 poll 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 = armnetwork.ExpressRouteCircuitsClientListArpTableResponse{ + // ExpressRouteCircuitsArpTableListResult: armnetwork.ExpressRouteCircuitsArpTableListResult{ + // Value: []*armnetwork.ExpressRouteCircuitArpTable{ + // { + // Age: to.Ptr[int32](0), + // Interface: to.Ptr("Microsoft"), + // IPAddress: to.Ptr("IPAddress"), + // MacAddress: to.Ptr("macAddress"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitRouteTableList.json +func ExampleExpressRouteCircuitsClient_BeginListRoutesTable() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", 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 poll 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 = armnetwork.ExpressRouteCircuitsClientListRoutesTableResponse{ + // ExpressRouteCircuitsRoutesTableListResult: armnetwork.ExpressRouteCircuitsRoutesTableListResult{ + // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ + // { + // Path: to.Ptr(""), + // LocPrf: to.Ptr(""), + // Network: to.Ptr(""), + // NextHop: to.Ptr(""), + // Weight: to.Ptr[int32](0), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitRouteTableSummaryList.json +func ExampleExpressRouteCircuitsClient_BeginListRoutesTableSummary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTableSummary(ctx, "rg1", "circuitName", "peeringName", "devicePath", 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 poll 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 = armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse{ + // ExpressRouteCircuitsRoutesTableSummaryListResult: armnetwork.ExpressRouteCircuitsRoutesTableSummaryListResult{ + // Value: []*armnetwork.ExpressRouteCircuitRoutesTableSummary{ + // { + // As: to.Ptr[int32](9583), + // Neighbor: to.Ptr("100.65.171.1"), + // StatePfxRcd: to.Ptr("Idle"), + // UpDown: to.Ptr("never"), + // V: to.Ptr[int32](4), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitStartCircuitLinkFailoverTest.json +func ExampleExpressRouteCircuitsClient_BeginStartCircuitLinkFailoverTest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginStartCircuitLinkFailoverTest(ctx, "rg1", "circuit1", "Primary", "BgpDisconnect", 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 poll 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 = armnetwork.ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse{ + // Value: to.Ptr(""), + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitStopCircuitLinkFailoverTest.json +func ExampleExpressRouteCircuitsClient_BeginStopCircuitLinkFailoverTest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginStopCircuitLinkFailoverTest(ctx, "rg1", "circuit1", armnetwork.ExpressRouteLinkFailoverStopAPIParameters{ + CircuitTestCategory: to.Ptr("BgpDisconnect"), + LinkType: to.Ptr("Primary"), + WasSimulationSuccessful: to.Ptr(true), + IsVerified: to.Ptr(true), + }, 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 poll 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 = armnetwork.ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse{ + // Value: to.Ptr(""), + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCircuitUpdateTags.json +func ExampleExpressRouteCircuitsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewExpressRouteCircuitsClient().UpdateTags(ctx, "ertest", "er1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ExpressRouteCircuitsClientUpdateTagsResponse{ + // ExpressRouteCircuit: armnetwork.ExpressRouteCircuit{ + // Name: to.Ptr("er1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ + // AllowClassicOperations: to.Ptr(false), + // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ + // }, + // CircuitProvisioningState: to.Ptr("Enabled"), + // GatewayManagerEtag: to.Ptr(""), + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateFailed), + // ServiceKey: to.Ptr("0b392c2e-1e9d-46d7-b5e0-9ce90ca6b60c"), + // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // PeeringLocation: to.Ptr("Silicon Valley"), + // ServiceProviderName: to.Ptr("Equinix"), + // }, + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + // }, + // SKU: &armnetwork.ExpressRouteCircuitSKU{ + // Name: to.Ptr("Standard_MeteredData"), + // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), + // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go index 66640e938bf1..cccaa9af0f0b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteConnectionsClient contains the methods for the ExpressRouteConnections group. // Don't use this type directly, use NewExpressRouteConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteConnectionsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteConnectionsClient creates a new instance of ExpressRouteConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteConnectionsClient, error) { @@ -43,11 +43,9 @@ func NewExpressRouteConnectionsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRouteGatewayName - The name of the ExpressRoute gateway. -// - connectionName - The name of the connection subresource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the express route gateway. +// - connectionName - The name of the express route connection. // - putExpressRouteConnectionParameters - Parameters required in an ExpressRouteConnection PUT operation. // - options - ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate // method. @@ -71,8 +69,6 @@ func (client *ExpressRouteConnectionsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteConnectionsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *ExpressRouteConnectionsClient) createOrUpdate(ctx context.Context, // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, _ *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters); err != nil { return nil, err } @@ -129,11 +126,9 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a connection to a ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRouteGatewayName - The name of the ExpressRoute gateway. -// - connectionName - The name of the connection subresource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the express route gateway. +// - connectionName - The name of the express route connection. // - options - ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete // method. func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteConnectionsClientDeleteResponse], error) { @@ -143,8 +138,7 @@ func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +150,6 @@ func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a connection to a ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteConnectionsClient.BeginDelete" @@ -182,6 +174,10 @@ func (client *ExpressRouteConnectionsClient) deleteOperation(ctx context.Context // deleteCreateRequest creates the Delete request. func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, _ *ExpressRouteConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +190,21 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified ExpressRouteConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRouteGatewayName - The name of the ExpressRoute gateway. -// - connectionName - The name of the ExpressRoute connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the express route gateway. +// - connectionName - The name of the express route connection. // - options - ExpressRouteConnectionsClientGetOptions contains the optional parameters for the ExpressRouteConnectionsClient.Get // method. func (client *ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientGetOptions) (ExpressRouteConnectionsClientGetResponse, error) { @@ -243,6 +232,10 @@ func (client *ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGr // getCreateRequest creates the Get request. func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, _ *ExpressRouteConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +248,13 @@ func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Contex return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -281,9 +270,7 @@ func (client *ExpressRouteConnectionsClient) getHandleResponse(resp *http.Respon // List - Lists ExpressRouteConnections. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List // method. @@ -312,6 +299,10 @@ func (client *ExpressRouteConnectionsClient) List(ctx context.Context, resourceG // listCreateRequest creates the List request. func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, _ *ExpressRouteConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +311,13 @@ func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Conte return nil, errors.New("parameter expressRouteGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go index d0edc21a482c..ea0f1b3b4d94 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go @@ -1,63 +1,62 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteConnectionCreate.json +// Generated from example definition: 2025-07-01/ExpressRouteConnectionCreate.json func ExampleExpressRouteConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "gateway-2", "connectionName", armnetwork.ExpressRouteConnection{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), Name: to.Ptr("connectionName"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), Properties: &armnetwork.ExpressRouteConnectionProperties{ AuthorizationKey: to.Ptr("authorizationKey"), ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), }, RoutingConfiguration: &armnetwork.RoutingConfiguration{ AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), }, InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), }, OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), }, PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ IDs: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + }, + }, Labels: []*string{ to.Ptr("label1"), - to.Ptr("label2")}, + to.Ptr("label2"), + }, }, }, RoutingWeight: to.Ptr[int32](2), @@ -68,144 +67,157 @@ func ExampleExpressRouteConnectionsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ExpressRouteConnection = armnetwork.ExpressRouteConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // res = armnetwork.ExpressRouteConnectionsClientCreateOrUpdateResponse{ + // ExpressRouteConnection: armnetwork.ExpressRouteConnection{ + // Name: to.Ptr("connectionName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), + // Properties: &armnetwork.ExpressRouteConnectionProperties{ + // AuthorizationKey: to.Ptr("authorizationKey"), + // EnableInternetSecurity: to.Ptr(false), + // EnablePrivateLinkFastPath: to.Ptr(false), + // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // ExpressRouteGatewayBypass: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Provisioned")), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, // }, // }, // RoutingWeight: to.Ptr[int32](2), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteConnectionGet.json -func ExampleExpressRouteConnectionsClient_Get() { +// Generated from example definition: 2025-07-01/ExpressRouteConnectionDelete.json +func ExampleExpressRouteConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteConnectionsClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", nil) + poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", 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 poll 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.ExpressRouteConnection = armnetwork.ExpressRouteConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // } + // res = armnetwork.ExpressRouteConnectionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteConnectionDelete.json -func ExampleExpressRouteConnectionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRouteConnectionGet.json +func ExampleExpressRouteConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", nil) + res, err := clientFactory.NewExpressRouteConnectionsClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", 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) - } + // 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 = armnetwork.ExpressRouteConnectionsClientGetResponse{ + // ExpressRouteConnection: armnetwork.ExpressRouteConnection{ + // Name: to.Ptr("connectionName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), + // Properties: &armnetwork.ExpressRouteConnectionProperties{ + // AuthorizationKey: to.Ptr("authorizationKey"), + // EnableInternetSecurity: to.Ptr(false), + // EnablePrivateLinkFastPath: to.Ptr(false), + // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), + // }, + // ExpressRouteGatewayBypass: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Provisioned")), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](1), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteConnectionList.json +// Generated from example definition: 2025-07-01/ExpressRouteConnectionList.json func ExampleExpressRouteConnectionsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -216,48 +228,53 @@ func ExampleExpressRouteConnectionsClient_List() { // 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.ExpressRouteConnectionList = armnetwork.ExpressRouteConnectionList{ - // Value: []*armnetwork.ExpressRouteConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // res = armnetwork.ExpressRouteConnectionsClientListResponse{ + // ExpressRouteConnectionList: armnetwork.ExpressRouteConnectionList{ + // Value: []*armnetwork.ExpressRouteConnection{ + // { + // Name: to.Ptr("connectionName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), + // Properties: &armnetwork.ExpressRouteConnectionProperties{ + // AuthorizationKey: to.Ptr("authorizationKey"), + // EnableInternetSecurity: to.Ptr(false), + // EnablePrivateLinkFastPath: to.Ptr(false), + // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // ExpressRouteGatewayBypass: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Provisioned")), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, // }, // }, // RoutingWeight: to.Ptr[int32](1), // }, - // }}, - // } + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go index ad4e1fe2f012..ddf7c993f982 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteCrossConnectionPeeringsClient contains the methods for the ExpressRouteCrossConnectionPeerings group. // Don't use this type directly, use NewExpressRouteCrossConnectionPeeringsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCrossConnectionPeeringsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCrossConnectionPeeringsClient creates a new instance of ExpressRouteCrossConnectionPeeringsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionPeeringsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string, credent // BeginCreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - Name for the express route cross connection. // - peeringName - The name of the peering. // - peeringParameters - Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. // - options - ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the @@ -71,8 +69,6 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdate(ctx cont // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, _ *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { return nil, err } @@ -129,10 +126,8 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq // BeginDelete - Deletes the specified peering from the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - Name for the express route cross connection. // - peeringName - The name of the peering. // - options - ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete // method. @@ -143,8 +138,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) BeginDelete(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +150,6 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) BeginDelete(ctx context // Delete - Deletes the specified peering from the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionPeeringsClient.BeginDelete" @@ -182,6 +174,10 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx con // deleteCreateRequest creates the Delete request. func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, _ *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,27 +190,20 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified peering for the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - Name for the express route cross connection. // - peeringName - The name of the peering. // - options - ExpressRouteCrossConnectionPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.Get // method. @@ -243,6 +232,10 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context // getCreateRequest creates the Get request. func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, _ *ExpressRouteCrossConnectionPeeringsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +248,13 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx co return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +269,8 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp } // NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager // method. func (client *ExpressRouteCrossConnectionPeeringsClient) NewListPager(resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionPeeringsClientListResponse] { @@ -312,6 +299,10 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) NewListPager(resourceGr // listCreateRequest creates the List request. func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, _ *ExpressRouteCrossConnectionPeeringsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +311,13 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx c return nil, errors.New("parameter crossConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go index d9e0d9054dba..9c18bf9bc777 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go @@ -1,80 +1,86 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionBgpPeeringList.json -func ExampleExpressRouteCrossConnectionPeeringsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionBgpPeeringCreate.json +func ExampleExpressRouteCrossConnectionPeeringsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().NewListPager("CrossConnection-SiliconValley", "", 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.ExpressRouteCrossConnectionPeeringList = armnetwork.ExpressRouteCrossConnectionPeeringList{ - // Value: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // }}, - // } + poller, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", armnetwork.ExpressRouteCrossConnectionPeering{ + Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ + IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + }, + PeerASN: to.Ptr[int64](200), + PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + VlanID: to.Ptr[int32](200), + }, + }, 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 poll 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 = armnetwork.ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse{ + // ExpressRouteCrossConnectionPeering: armnetwork.ExpressRouteCrossConnectionPeering{ + // Name: to.Ptr("AzurePrivatePeering"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), + // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr(""), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // }, + // LastModifiedBy: to.Ptr("Customer"), + // PeerASN: to.Ptr[int64](200), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), + // PrimaryAzurePort: to.Ptr(""), + // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr(""), + // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](200), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionBgpPeeringDelete.json +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionBgpPeeringDelete.json func ExampleExpressRouteCrossConnectionPeeringsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -82,20 +88,25 @@ func ExampleExpressRouteCrossConnectionPeeringsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteCrossConnectionPeeringsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionBgpPeeringGet.json +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionBgpPeeringGet.json func ExampleExpressRouteCrossConnectionPeeringsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -106,87 +117,85 @@ func ExampleExpressRouteCrossConnectionPeeringsClient_Get() { // 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.ExpressRouteCrossConnectionPeering = armnetwork.ExpressRouteCrossConnectionPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // res = armnetwork.ExpressRouteCrossConnectionPeeringsClientGetResponse{ + // ExpressRouteCrossConnectionPeering: armnetwork.ExpressRouteCrossConnectionPeering{ + // Name: to.Ptr("AzurePrivatePeering"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), + // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr(""), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // }, + // LastModifiedBy: to.Ptr("Customer"), + // PeerASN: to.Ptr[int64](200), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), + // PrimaryAzurePort: to.Ptr(""), + // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr(""), + // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](200), // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionBgpPeeringCreate.json -func ExampleExpressRouteCrossConnectionPeeringsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionBgpPeeringList.json +func ExampleExpressRouteCrossConnectionPeeringsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", armnetwork.ExpressRouteCrossConnectionPeering{ - Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - }, - PeerASN: to.Ptr[int64](200), - PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - VlanID: to.Ptr[int32](200), - }, - }, 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) + pager := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().NewListPager("CrossConnection-SiliconValley", "", 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 = armnetwork.ExpressRouteCrossConnectionPeeringsClientListResponse{ + // ExpressRouteCrossConnectionPeeringList: armnetwork.ExpressRouteCrossConnectionPeeringList{ + // Value: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // { + // Name: to.Ptr("AzurePrivatePeering"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), + // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ + // AzureASN: to.Ptr[int32](12076), + // GatewayManagerEtag: to.Ptr(""), + // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ + // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), + // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), + // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), + // }, + // LastModifiedBy: to.Ptr("Customer"), + // PeerASN: to.Ptr[int64](200), + // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), + // PrimaryAzurePort: to.Ptr(""), + // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecondaryAzurePort: to.Ptr(""), + // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), + // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), + // VlanID: to.Ptr[int32](200), + // }, + // }, + // }, + // }, + // } } - // 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.ExpressRouteCrossConnectionPeering = armnetwork.ExpressRouteCrossConnectionPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go index 6056b5572c96..0baf5aebbd7a 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteCrossConnectionsClient contains the methods for the ExpressRouteCrossConnections group. // Don't use this type directly, use NewExpressRouteCrossConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteCrossConnectionsClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteCrossConnectionsClient creates a new instance of ExpressRouteCrossConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteCrossConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRouteCrossConnectionsClient(subscriptionID string, credential azc // BeginCreateOrUpdate - Update the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - parameters - Parameters supplied to the update express route crossConnection operation. // - options - ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate // method. @@ -57,8 +55,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginCreateOrUpdate(ctx contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ExpressRouteCrossConnectionsClient) BeginCreateOrUpdate(ctx contex // CreateOrUpdate - Update the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdate(ctx context.Con // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, _ *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct return nil, errors.New("parameter crossConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct // Get - Gets details about the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group (peering location of the circuit). +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - options - ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get // method. @@ -155,6 +149,10 @@ func (client *ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resou // getCreateRequest creates the Get request. func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, _ *ExpressRouteCrossConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -163,17 +161,13 @@ func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.C return nil, errors.New("parameter crossConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -188,8 +182,6 @@ func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.R } // NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. -// -// Generated from API version 2025-05-01 // - options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager // method. func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { @@ -230,8 +222,8 @@ func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context. if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -248,10 +240,8 @@ func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http. // BeginListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - peeringName - The name of the peering. // - devicePath - The path of the device. // - options - ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable @@ -263,8 +253,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListArpTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -277,8 +266,6 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context. // ListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionsClient) listArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListArpTable" @@ -303,6 +290,10 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTable(ctx context.Conte // listArpTableCreateRequest creates the ListArpTable request. func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, _ *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -319,25 +310,19 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager // method. func (client *ExpressRouteCrossConnectionsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListByResourceGroupResponse] { @@ -366,21 +351,21 @@ func (client *ExpressRouteCrossConnectionsClient) NewListByResourceGroupPager(re // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -397,10 +382,8 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleRespo // BeginListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in // a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - peeringName - The name of the peering. // - devicePath - The path of the device. // - options - ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable @@ -412,8 +395,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -426,8 +408,6 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx conte // ListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionsClient) listRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListRoutesTable" @@ -452,6 +432,10 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTable(ctx context.Co // listRoutesTableCreateRequest creates the ListRoutesTable request. func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, _ *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -468,17 +452,13 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -486,10 +466,8 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c // BeginListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - peeringName - The name of the peering. // - devicePath - The path of the device. // - options - ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the @@ -501,8 +479,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -515,8 +492,6 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ct // ListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary" @@ -541,6 +516,10 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummary(ctx con // listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, _ *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -557,27 +536,21 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe return nil, errors.New("parameter devicePath cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // UpdateTags - Updates an express route cross connection tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - crossConnectionName - The name of the cross connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - crossConnectionParameters - Parameters supplied to update express route cross connection tags. // - options - ExpressRouteCrossConnectionsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.UpdateTags // method. @@ -606,6 +579,10 @@ func (client *ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context // updateTagsCreateRequest creates the UpdateTags request. func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject, _ *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -614,18 +591,15 @@ func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx co return nil, errors.New("parameter crossConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, crossConnectionParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go index 64994a124e4e..c1f79655150f 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go @@ -1,124 +1,75 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionList.json -func ExampleExpressRouteCrossConnectionsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionUpdate.json +func ExampleExpressRouteCrossConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewExpressRouteCrossConnectionsClient().NewListPager(&armnetwork.ExpressRouteCrossConnectionsClientListOptions{Filter: 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.ExpressRouteCrossConnectionListResult = armnetwork.ExpressRouteCrossConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnection{ - // { - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionListByResourceGroup.json -func ExampleExpressRouteCrossConnectionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", armnetwork.ExpressRouteCrossConnection{ + Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + }, + }, nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCrossConnectionsClient().NewListByResourceGroupPager("CrossConnection-SiliconValley", 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.ExpressRouteCrossConnectionListResult = armnetwork.ExpressRouteCrossConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnection{ - // { - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSilicon-Valley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteCrossConnectionsClientCreateOrUpdateResponse{ + // ExpressRouteCrossConnection: armnetwork.ExpressRouteCrossConnection{ + // Name: to.Ptr(""), + // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // }, + // PeeringLocation: to.Ptr("SiliconValley"), + // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // }, + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Enabled")), + // STag: to.Ptr[int32](2), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionGet.json +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionGet.json func ExampleExpressRouteCrossConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -129,167 +80,221 @@ func ExampleExpressRouteCrossConnectionsClient_Get() { // 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.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // res = armnetwork.ExpressRouteCrossConnectionsClientGetResponse{ + // ExpressRouteCrossConnection: armnetwork.ExpressRouteCrossConnection{ + // Name: to.Ptr(""), + // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), + // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // }, + // PeeringLocation: to.Ptr("SiliconValley"), + // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // }, + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Enabled")), + // STag: to.Ptr[int32](2), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionUpdate.json -func ExampleExpressRouteCrossConnectionsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionList.json +func ExampleExpressRouteCrossConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", armnetwork.ExpressRouteCrossConnection{ - Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - }, - }, nil) + pager := clientFactory.NewExpressRouteCrossConnectionsClient().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 = armnetwork.ExpressRouteCrossConnectionsClientListResponse{ + // ExpressRouteCrossConnectionListResult: armnetwork.ExpressRouteCrossConnectionListResult{ + // Value: []*armnetwork.ExpressRouteCrossConnection{ + // { + // Name: to.Ptr(""), + // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // }, + // PeeringLocation: to.Ptr("SiliconValley"), + // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // }, + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Enabled")), + // STag: to.Ptr[int32](2), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionsArpTable.json +func ExampleExpressRouteCrossConnectionsClient_BeginListArpTable() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListArpTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", 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) + log.Fatalf("failed to poll 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.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // res = armnetwork.ExpressRouteCrossConnectionsClientListArpTableResponse{ + // ExpressRouteCircuitsArpTableListResult: armnetwork.ExpressRouteCircuitsArpTableListResult{ + // Value: []*armnetwork.ExpressRouteCircuitArpTable{ + // { + // Age: to.Ptr[int32](0), + // Interface: to.Ptr("Microsoft"), + // IPAddress: to.Ptr("192.116.14.254"), + // MacAddress: to.Ptr("885a.9269.9110"), + // }, // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionUpdateTags.json -func ExampleExpressRouteCrossConnectionsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionListByResourceGroup.json +func ExampleExpressRouteCrossConnectionsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteCrossConnectionsClient().UpdateTags(ctx, "CrossConnection-SiliconValley", "", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewExpressRouteCrossConnectionsClient().NewListByResourceGroupPager("CrossConnection-SiliconValley", 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 = armnetwork.ExpressRouteCrossConnectionsClientListByResourceGroupResponse{ + // ExpressRouteCrossConnectionListResult: armnetwork.ExpressRouteCrossConnectionListResult{ + // Value: []*armnetwork.ExpressRouteCrossConnection{ + // { + // Name: to.Ptr(""), + // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnectionSilicon-Valley/providers/Microsoft.Network/expressRouteCrossConnections/"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // }, + // PeeringLocation: to.Ptr("SiliconValley"), + // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // }, + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Enabled")), + // STag: to.Ptr[int32](2), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), + // }, + // }, + // }, + // }, + // } } - // 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.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr("er1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionsArpTable.json -func ExampleExpressRouteCrossConnectionsClient_BeginListArpTable() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionsRouteTable.json +func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListArpTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", nil) + poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListRoutesTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", 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) + log.Fatalf("failed to poll 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.ExpressRouteCircuitsArpTableListResult = armnetwork.ExpressRouteCircuitsArpTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitArpTable{ - // { - // Age: to.Ptr[int32](0), - // Interface: to.Ptr("Microsoft"), - // IPAddress: to.Ptr("192.116.14.254"), - // MacAddress: to.Ptr("885a.9269.9110"), - // }}, + // res = armnetwork.ExpressRouteCrossConnectionsClientListRoutesTableResponse{ + // ExpressRouteCircuitsRoutesTableListResult: armnetwork.ExpressRouteCircuitsRoutesTableListResult{ + // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ + // { + // Path: to.Ptr("65514"), + // LocPrf: to.Ptr(""), + // Network: to.Ptr("10.6.0.0/16"), + // NextHop: to.Ptr("10.6.1.12"), + // Weight: to.Ptr[int32](0), + // }, + // { + // Path: to.Ptr("65514"), + // LocPrf: to.Ptr(""), + // Network: to.Ptr("10.7.0.0/16"), + // NextHop: to.Ptr("10.7.1.13"), + // Weight: to.Ptr[int32](0), + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionsRouteTableSummary.json +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionsRouteTableSummary.json func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTableSummary() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -299,65 +304,78 @@ func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTableSummary() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ExpressRouteCrossConnectionsRoutesTableSummaryListResult = armnetwork.ExpressRouteCrossConnectionsRoutesTableSummaryListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnectionRoutesTableSummary{ - // { - // Asn: to.Ptr[int32](65514), - // Neighbor: to.Ptr("10.6.1.112"), - // StateOrPrefixesReceived: to.Ptr("Active"), - // UpDown: to.Ptr("1d14h"), + // res = armnetwork.ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse{ + // ExpressRouteCrossConnectionsRoutesTableSummaryListResult: armnetwork.ExpressRouteCrossConnectionsRoutesTableSummaryListResult{ + // Value: []*armnetwork.ExpressRouteCrossConnectionRoutesTableSummary{ + // { + // Asn: to.Ptr[int32](65514), + // Neighbor: to.Ptr("10.6.1.112"), + // StateOrPrefixesReceived: to.Ptr("Active"), + // UpDown: to.Ptr("1d14h"), + // }, + // { + // Asn: to.Ptr[int32](65514), + // Neighbor: to.Ptr("10.6.1.113"), + // StateOrPrefixesReceived: to.Ptr("1"), + // UpDown: to.Ptr("1d14h"), + // }, // }, - // { - // Asn: to.Ptr[int32](65514), - // Neighbor: to.Ptr("10.6.1.113"), - // StateOrPrefixesReceived: to.Ptr("1"), - // UpDown: to.Ptr("1d14h"), - // }}, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteCrossConnectionsRouteTable.json -func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTable() { +// Generated from example definition: 2025-07-01/ExpressRouteCrossConnectionUpdateTags.json +func ExampleExpressRouteCrossConnectionsClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListRoutesTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", nil) + res, err := clientFactory.NewExpressRouteCrossConnectionsClient().UpdateTags(ctx, "CrossConnection-SiliconValley", "", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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.ExpressRouteCircuitsRoutesTableListResult = armnetwork.ExpressRouteCircuitsRoutesTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ - // { - // Path: to.Ptr("65514"), - // LocPrf: to.Ptr(""), - // Network: to.Ptr("10.6.0.0/16"), - // NextHop: to.Ptr("10.6.1.12"), - // Weight: to.Ptr[int32](0), + // res = armnetwork.ExpressRouteCrossConnectionsClientUpdateTagsResponse{ + // ExpressRouteCrossConnection: armnetwork.ExpressRouteCrossConnection{ + // Name: to.Ptr("er1"), + // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ + // BandwidthInMbps: to.Ptr[int32](1000), + // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), + // }, + // PeeringLocation: to.Ptr("SiliconValley"), + // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ + // }, + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateFailed), + // STag: to.Ptr[int32](2), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), // }, - // { - // Path: to.Ptr("65514"), - // LocPrf: to.Ptr(""), - // Network: to.Ptr("10.7.0.0/16"), - // NextHop: to.Ptr("10.7.1.13"), - // Weight: to.Ptr[int32](0), - // }}, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go index 19c8e1b709a3..857a38633f12 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -14,19 +13,21 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) // ExpressRouteGatewaysClient contains the methods for the ExpressRouteGateways group. // Don't use this type directly, use NewExpressRouteGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteGatewaysClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteGatewaysClient creates a new instance of ExpressRouteGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteGatewaysClient, error) { @@ -43,9 +44,7 @@ func NewExpressRouteGatewaysClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. // - options - ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate @@ -57,8 +56,7 @@ func (client *ExpressRouteGatewaysClient) BeginCreateOrUpdate(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +68,6 @@ func (client *ExpressRouteGatewaysClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginCreateOrUpdate" @@ -96,6 +92,10 @@ func (client *ExpressRouteGatewaysClient) createOrUpdate(ctx context.Context, re // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, _ *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +104,15 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, errors.New("parameter expressRouteGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters); err != nil { return nil, err } @@ -125,9 +122,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only // be deleted when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete // method. @@ -138,8 +133,7 @@ func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -152,8 +146,6 @@ func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted // when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginDelete" @@ -178,6 +170,10 @@ func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, r // deleteCreateRequest creates the Delete request. func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, _ *ExpressRouteGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -186,26 +182,19 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, errors.New("parameter expressRouteGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Fetches the details of a ExpressRoute gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get // method. @@ -234,6 +223,10 @@ func (client *ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, _ *ExpressRouteGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -242,17 +235,13 @@ func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter expressRouteGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -266,11 +255,317 @@ func (client *ExpressRouteGatewaysClient) getHandleResponse(resp *http.Response) return result, nil } +// BeginGetFailoverAllTestsDetails - Retrieves the details of all the failover tests performed on the ExpressRoute gateway +// for different peering locations. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails +// method. +func (client *ExpressRouteGatewaysClient) BeginGetFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getFailoverAllTestsDetails(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetFailoverAllTestsDetails - Retrieves the details of all the failover tests performed on the ExpressRoute gateway for +// different peering locations. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) getFailoverAllTestsDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getFailoverAllTestsDetailsCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getFailoverAllTestsDetailsCreateRequest creates the GetFailoverAllTestsDetails request. +func (client *ExpressRouteGatewaysClient) getFailoverAllTestsDetailsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/getFailoverAllTestsDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + if options != nil && options.FetchLatest != nil { + reqQP.Set("fetchLatest", strconv.FormatBool(*options.FetchLatest)) + } + if options != nil && options.Type != nil { + reqQP.Set("type", *options.Type) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetFailoverSingleTestDetails - Retrieves the details of a particular failover test performed on the ExpressRoute gateway +// based on the test Guid. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - peeringLocation - Peering location of the test. +// - failoverTestID - The unique Guid value which identifies the test. +// - options - ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails +// method. +func (client *ExpressRouteGatewaysClient) BeginGetFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, failoverTestID string, options *ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getFailoverSingleTestDetails(ctx, resourceGroupName, expressRouteGatewayName, peeringLocation, failoverTestID, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetFailoverSingleTestDetails - Retrieves the details of a particular failover test performed on the ExpressRoute gateway +// based on the test Guid. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) getFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, failoverTestID string, options *ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getFailoverSingleTestDetailsCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, peeringLocation, failoverTestID, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getFailoverSingleTestDetailsCreateRequest creates the GetFailoverSingleTestDetails request. +func (client *ExpressRouteGatewaysClient) getFailoverSingleTestDetailsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, failoverTestID string, _ *ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/getFailoverSingleTestDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + reqQP.Set("failoverTestId", failoverTestID) + reqQP.Set("peeringLocation", peeringLocation) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetResiliencyInformation - Retrieves the resiliency information for the ExpressRoute gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetResiliencyInformation +// method. +func (client *ExpressRouteGatewaysClient) BeginGetResiliencyInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetResiliencyInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getResiliencyInformation(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientGetResiliencyInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientGetResiliencyInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetResiliencyInformation - Retrieves the resiliency information for the ExpressRoute gateway. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) getResiliencyInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginGetResiliencyInformation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getResiliencyInformationCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getResiliencyInformationCreateRequest creates the GetResiliencyInformation request. +func (client *ExpressRouteGatewaysClient) getResiliencyInformationCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/getResiliencyInformation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + if options != nil && options.AttemptRefresh != nil { + reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetRoutesInformation - Retrieves the route sets information for the ExpressRoute gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteGatewaysClientBeginGetRoutesInformationOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetRoutesInformation +// method. +func (client *ExpressRouteGatewaysClient) BeginGetRoutesInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetRoutesInformationOptions) (*runtime.Poller[ExpressRouteGatewaysClientGetRoutesInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getRoutesInformation(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientGetRoutesInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientGetRoutesInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetRoutesInformation - Retrieves the route sets information for the ExpressRoute gateway. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) getRoutesInformation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetRoutesInformationOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginGetRoutesInformation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getRoutesInformationCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getRoutesInformationCreateRequest creates the GetRoutesInformation request. +func (client *ExpressRouteGatewaysClient) getRoutesInformationCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginGetRoutesInformationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/getRoutesInformation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + if options != nil && options.AttemptRefresh != nil { + reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // ListByResourceGroup - Lists ExpressRoute gateways in a given resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup // method. func (client *ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (ExpressRouteGatewaysClientListByResourceGroupResponse, error) { @@ -298,21 +593,21 @@ func (client *ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Contex // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ExpressRouteGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -328,8 +623,6 @@ func (client *ExpressRouteGatewaysClient) listByResourceGroupHandleResponse(resp // ListBySubscription - Lists ExpressRoute gateways under a given subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription // method. func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { @@ -366,8 +659,8 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,12 +674,161 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionHandleResponse(resp return result, nil } +// BeginStartSiteFailoverTest - Starts failover simulation on the ExpressRoute gateway for the specified peering location. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - peeringLocation - Peering location of the test. +// - options - ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginStartSiteFailoverTest +// method. +func (client *ExpressRouteGatewaysClient) BeginStartSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, options *ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions) (*runtime.Poller[ExpressRouteGatewaysClientStartSiteFailoverTestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startSiteFailoverTest(ctx, resourceGroupName, expressRouteGatewayName, peeringLocation, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientStartSiteFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientStartSiteFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartSiteFailoverTest - Starts failover simulation on the ExpressRoute gateway for the specified peering location. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) startSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, options *ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginStartSiteFailoverTest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startSiteFailoverTestCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, peeringLocation, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startSiteFailoverTestCreateRequest creates the StartSiteFailoverTest request. +func (client *ExpressRouteGatewaysClient) startSiteFailoverTestCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, _ *ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/startSiteFailoverTest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + reqQP.Set("peeringLocation", peeringLocation) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStopSiteFailoverTest - Stops failover simulation on the ExpressRoute gateway for the specified peering location. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - stopParameters - The content of the action request +// - options - ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginStopSiteFailoverTest +// method. +func (client *ExpressRouteGatewaysClient) BeginStopSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions) (*runtime.Poller[ExpressRouteGatewaysClientStopSiteFailoverTestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopSiteFailoverTest(ctx, resourceGroupName, expressRouteGatewayName, stopParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientStopSiteFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExpressRouteGatewaysClientStopSiteFailoverTestResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StopSiteFailoverTest - Stops failover simulation on the ExpressRoute gateway for the specified peering location. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ExpressRouteGatewaysClient) stopSiteFailoverTest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions) (*http.Response, error) { + var err error + const operationName = "ExpressRouteGatewaysClient.BeginStopSiteFailoverTest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopSiteFailoverTestCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, stopParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopSiteFailoverTestCreateRequest creates the StopSiteFailoverTest request. +func (client *ExpressRouteGatewaysClient) stopSiteFailoverTestCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, _ *ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/stopSiteFailoverTest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, stopParameters); err != nil { + return nil, err + } + return req, nil +} + // BeginUpdateTags - Updates express route gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the ExpressRouteGateway. -// - expressRouteGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. // - expressRouteGatewayParameters - Parameters supplied to update a virtual wan express route gateway tags. // - options - ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags // method. @@ -397,8 +839,7 @@ func (client *ExpressRouteGatewaysClient) BeginUpdateTags(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -410,8 +851,6 @@ func (client *ExpressRouteGatewaysClient) BeginUpdateTags(ctx context.Context, r // UpdateTags - Updates express route gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRouteGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginUpdateTags" @@ -453,9 +892,10 @@ func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteGatewayParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go index 71b48567fdea..0c04052a4ff7 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go @@ -1,108 +1,407 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayListBySubscription.json -func ExampleExpressRouteGatewaysClient_ListBySubscription() { +// Generated from example definition: 2025-07-01/ExpressRouteGatewayCreate.json +func ExampleExpressRouteGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteGatewaysClient().ListBySubscription(ctx, nil) + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "gateway-2", armnetwork.ExpressRouteGateway{ + Location: to.Ptr("westus"), + Properties: &armnetwork.ExpressRouteGatewayProperties{ + AllowNonVirtualWanTraffic: to.Ptr(false), + AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ + Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + Min: to.Ptr[int32](3), + }, + }, + VirtualHub: &armnetwork.VirtualHubID{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName"), + }, + }, + }, 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 poll 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 = armnetwork.ExpressRouteGatewaysClientCreateOrUpdateResponse{ + // ExpressRouteGateway: armnetwork.ExpressRouteGateway{ + // Name: to.Ptr("gateway-2"), + // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteGatewayProperties{ + // AllowNonVirtualWanTraffic: to.Ptr(false), + // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ + // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + // Min: to.Ptr[int32](3), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.VirtualHubID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayDelete.json +func ExampleExpressRouteGatewaysClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", 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 poll 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 = armnetwork.ExpressRouteGatewaysClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayGet.json +func ExampleExpressRouteGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewExpressRouteGatewaysClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", 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 = armnetwork.ExpressRouteGatewaysClientGetResponse{ + // ExpressRouteGateway: armnetwork.ExpressRouteGateway{ + // Name: to.Ptr("expressRouteGatewayName"), + // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteGatewayProperties{ + // AllowNonVirtualWanTraffic: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.VirtualHubID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayGetFailoverAllTestsDetails.json +func ExampleExpressRouteGatewaysClient_BeginGetFailoverAllTestsDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginGetFailoverAllTestsDetails(ctx, "rg1", "ergw1", &armnetwork.ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions{ + Type: to.Ptr("SingleSiteFailover"), + FetchLatest: to.Ptr(true)}) + 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 poll 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 = armnetwork.ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse{ + // ExpressRouteFailoverTestDetailsArray: []*armnetwork.ExpressRouteFailoverTestDetails{ + // { + // PeeringLocation: to.Ptr("Hong Kong"), + // Circuits: []*armnetwork.ExpressRouteFailoverCircuitResourceDetails{ + // { + // NrpResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuit1"), + // Name: to.Ptr("circuit1"), + // ConnectionName: to.Ptr("conn1"), + // }, + // }, + // Status: to.Ptr(armnetwork.FailoverTestStatusCompleted), + // StartTime: to.Ptr("2026-02-11T07:37:04Z"), + // EndTime: to.Ptr("2026-02-11T08:41:50Z"), + // Connections: []*armnetwork.ExpressRouteFailoverConnectionResourceDetails{ + // { + // NrpResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/ergw1/expressRouteConnections/conn1"), + // Name: to.Ptr("conn1"), + // Status: to.Ptr(armnetwork.FailoverConnectionStatusConnected), + // LastUpdatedTime: to.Ptr("2026-02-11T08:41:49Z"), + // }, + // }, + // TestGUID: to.Ptr("16546d1a-0548-4d6d-84ca-7149f3af4403"), + // TestType: to.Ptr(armnetwork.FailoverTestTypeSingleSiteFailover), + // Issues: []*string{ + // }, + // }, + // { + // PeeringLocation: to.Ptr("Hong Kong2"), + // Circuits: []*armnetwork.ExpressRouteFailoverCircuitResourceDetails{ + // { + // NrpResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuit2"), + // Name: to.Ptr("circuit2"), + // ConnectionName: to.Ptr("conn2"), + // }, + // }, + // Status: to.Ptr(armnetwork.FailoverTestStatusNotStarted), + // StartTime: to.Ptr(""), + // EndTime: to.Ptr(""), + // Connections: []*armnetwork.ExpressRouteFailoverConnectionResourceDetails{ + // { + // NrpResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/ergw1/expressRouteConnections/conn2"), + // Name: to.Ptr("conn2"), + // Status: to.Ptr(armnetwork.FailoverConnectionStatusConnected), + // }, + // }, + // TestGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TestType: to.Ptr(armnetwork.FailoverTestTypeSingleSiteFailover), + // Issues: []*string{ + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayGetFailoverSingleTestDetails.json +func ExampleExpressRouteGatewaysClient_BeginGetFailoverSingleTestDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginGetFailoverSingleTestDetails(ctx, "rg1", "ergw1", "Vancouver", "00000000-0000-0000-0000-000000000001", 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 poll 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.ExpressRouteGatewayList = armnetwork.ExpressRouteGatewayList{ - // Value: []*armnetwork.ExpressRouteGateway{ + // res = armnetwork.ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse{ + // ExpressRouteFailoverSingleTestDetailsArray: []*armnetwork.ExpressRouteFailoverSingleTestDetails{ // { - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](2), + // PeeringLocation: to.Ptr("Hong Kong"), + // StartTimeUTC: to.Ptr("2026-02-11T07:37:04Z"), + // EndTimeUTC: to.Ptr("2026-02-11T08:41:50Z"), + // Status: to.Ptr(armnetwork.FailoverTestStatusForSingleTestCompleted), + // WasSimulationSuccessful: to.Ptr(true), + // RedundantRoutes: []*armnetwork.ExpressRouteFailoverRedundantRoute{ + // { + // PeeringLocations: []*string{ + // to.Ptr("Atlanta"), + // to.Ptr("Silicon Valley"), + // }, + // Routes: []*string{ + // to.Ptr("10.0.0.0/24"), // }, // }, - // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ + // }, + // NonRedundantRoutes: []*string{ + // to.Ptr("10.10.0.0/16"), + // to.Ptr("10.11.0.0/24"), + // }, + // FailoverConnectionDetails: []*armnetwork.FailoverConnectionDetails{ + // { + // FailoverConnectionName: to.Ptr("conn1"), + // FailoverLocation: to.Ptr("Hong Kong2"), + // IsVerified: to.Ptr(true), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayGetResiliencyInformation.json +func ExampleExpressRouteGatewaysClient_BeginGetResiliencyInformation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginGetResiliencyInformation(ctx, "rg1", "ergw1", &armnetwork.ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions{ + AttemptRefresh: to.Ptr(false)}) + 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 poll 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 = armnetwork.ExpressRouteGatewaysClientGetResiliencyInformationResponse{ + // GatewayResiliencyInformation: armnetwork.GatewayResiliencyInformation{ + // OverallScore: to.Ptr("85"), + // ScoreChange: to.Ptr("5"), + // MinScoreFromRecommendations: to.Ptr("2"), + // MaxScoreFromRecommendations: to.Ptr("10"), + // LastComputedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-01T00:00:00Z"); return t}()), + // NextEligibleComputeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-01T01:00:00Z"); return t}()), + // Components: []*armnetwork.ResiliencyRecommendationComponents{ + // { + // Name: to.Ptr("Disaster Recovery"), + // CurrentScore: to.Ptr("-"), + // MaxScore: to.Ptr("-"), + // Recommendations: []*armnetwork.GatewayResiliencyRecommendation{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), - // EnableInternetSecurity: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // RecommendationTitle: to.Ptr("Site Failover Not Yet Validated"), + // RecommendationID: to.Ptr("6"), + // Severity: to.Ptr("High"), + // RecommendationText: to.Ptr("Use Resiliency Validation Tests at least once every 3 months."), + // CallToActionText: to.Ptr("Run Resiliency Validation Tests."), + // CallToActionLink: to.Ptr("https://learn.microsoft.com/en-us/azure/expressroute/resiliency-insights"), + // }, + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRouteGatewayGetRoutesInformation.json +func ExampleExpressRouteGatewaysClient_BeginGetRoutesInformation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginGetRoutesInformation(ctx, "rg1", "ergw1", &armnetwork.ExpressRouteGatewaysClientBeginGetRoutesInformationOptions{ + AttemptRefresh: to.Ptr(false)}) + 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 poll 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 = armnetwork.ExpressRouteGatewaysClientGetRoutesInformationResponse{ + // GatewayRouteSetsInformation: armnetwork.GatewayRouteSetsInformation{ + // LastComputedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-01T00:00:00Z"); return t}()), + // NextEligibleComputeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-01T01:00:00Z"); return t}()), + // RouteSetVersion: to.Ptr("1"), + // RouteSets: []*armnetwork.GatewayRouteSet{ + // { + // Name: to.Ptr("Set-1"), + // Locations: []*string{ + // to.Ptr("Washington DC"), + // to.Ptr("London2"), + // }, + // Details: map[string][]*armnetwork.RouteSourceDetails{ + // "10.11.0.0/24": []*armnetwork.RouteSourceDetails{ + // { + // Circuit: to.Ptr("x0"), + // Pri: to.Ptr("1"), + // Sec: to.Ptr("1"), + // }, + // { + // Circuit: to.Ptr("x1"), + // Pri: to.Ptr("2"), + // Sec: to.Ptr("2"), + // }, + // }, + // "10.57.0.0/16": []*armnetwork.RouteSourceDetails{ + // { + // Circuit: to.Ptr("x0"), + // Pri: to.Ptr("1"), + // Sec: to.Ptr("1"), + // }, // }, // }, - // }}, - // } + // }, + // }, + // CircuitsMetadataMap: map[string]*armnetwork.CircuitMetadataMap{ + // "x0": &armnetwork.CircuitMetadataMap{ + // Name: to.Ptr("circuit1"), + // Link: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuit1"), + // Location: to.Ptr("Hong Kong"), + // }, + // "x1": &armnetwork.CircuitMetadataMap{ + // Name: to.Ptr("circuit2"), + // Link: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuit2"), + // Location: to.Ptr("Hong Kong2"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayListByResourceGroup.json +// Generated from example definition: 2025-07-01/ExpressRouteGatewayListByResourceGroup.json func ExampleExpressRouteGatewaysClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -113,50 +412,53 @@ func ExampleExpressRouteGatewaysClient_ListByResourceGroup() { // 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.ExpressRouteGatewayList = armnetwork.ExpressRouteGatewayList{ - // Value: []*armnetwork.ExpressRouteGateway{ - // { - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](2), + // res = armnetwork.ExpressRouteGatewaysClientListByResourceGroupResponse{ + // ExpressRouteGatewayList: armnetwork.ExpressRouteGatewayList{ + // Value: []*armnetwork.ExpressRouteGateway{ + // { + // Name: to.Ptr("expressRouteGatewayName"), + // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteGatewayProperties{ + // AllowNonVirtualWanTraffic: to.Ptr(false), + // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ + // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + // Min: to.Ptr[int32](2), + // }, // }, - // }, - // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), - // EnableInternetSecurity: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ + // { + // Name: to.Ptr("connectionName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), + // Properties: &armnetwork.ExpressRouteConnectionProperties{ + // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), + // EnableInternetSecurity: to.Ptr(false), + // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Provisioned")), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, // }, // VnetRoutes: &armnetwork.VnetRoute{ // StaticRoutes: []*armnetwork.StaticRoute{ @@ -165,170 +467,214 @@ func ExampleExpressRouteGatewaysClient_ListByResourceGroup() { // }, // RoutingWeight: to.Ptr[int32](1), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), // }, // }, - // }}, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayCreate.json -func ExampleExpressRouteGatewaysClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRouteGatewayListBySubscription.json +func ExampleExpressRouteGatewaysClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "gateway-2", armnetwork.ExpressRouteGateway{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRouteGatewayProperties{ - AllowNonVirtualWanTraffic: to.Ptr(false), - AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - Min: to.Ptr[int32](3), - }, - }, - VirtualHub: &armnetwork.VirtualHubID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName"), - }, - }, - }, nil) + res, err := clientFactory.NewExpressRouteGatewaysClient().ListBySubscription(ctx, 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.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("gateway-2"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](3), + // res = armnetwork.ExpressRouteGatewaysClientListBySubscriptionResponse{ + // ExpressRouteGatewayList: armnetwork.ExpressRouteGatewayList{ + // Value: []*armnetwork.ExpressRouteGateway{ + // { + // Name: to.Ptr("expressRouteGatewayName"), + // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteGatewayProperties{ + // AllowNonVirtualWanTraffic: to.Ptr(false), + // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ + // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + // Min: to.Ptr[int32](2), + // }, + // }, + // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ + // { + // Name: to.Ptr("connectionName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), + // Properties: &armnetwork.ExpressRouteConnectionProperties{ + // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), + // EnableInternetSecurity: to.Ptr(false), + // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Provisioned")), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](1), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.VirtualHubID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // }, + // }, // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayUpdateTags.json -func ExampleExpressRouteGatewaysClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/ExpressRouteGatewayStartSiteFailoverTest.json +func ExampleExpressRouteGatewaysClient_BeginStartSiteFailoverTest() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginUpdateTags(ctx, "resourceGroupName", "expressRouteGatewayName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginStartSiteFailoverTest(ctx, "rg1", "ergw1", "Vancouver", 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) + log.Fatalf("failed to poll 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.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, + // res = armnetwork.ExpressRouteGatewaysClientStartSiteFailoverTestResponse{ + // Value: to.Ptr(""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayGet.json -func ExampleExpressRouteGatewaysClient_Get() { +// Generated from example definition: 2025-07-01/ExpressRouteGatewayStopSiteFailoverTest.json +func ExampleExpressRouteGatewaysClient_BeginStopSiteFailoverTest() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteGatewaysClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", nil) + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginStopSiteFailoverTest(ctx, "rg1", "ergw1", armnetwork.ExpressRouteFailoverStopAPIParameters{ + PeeringLocation: to.Ptr("Vancouver"), + WasSimulationSuccessful: to.Ptr(true), + Details: []*armnetwork.FailoverConnectionDetails{ + { + FailoverConnectionName: to.Ptr("conn1"), + FailoverLocation: to.Ptr("Denver"), + IsVerified: to.Ptr(true), + }, + }, + }, 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 poll 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.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, + // res = armnetwork.ExpressRouteGatewaysClientStopSiteFailoverTestResponse{ + // Value: to.Ptr(""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteGatewayDelete.json -func ExampleExpressRouteGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRouteGatewayUpdateTags.json +func ExampleExpressRouteGatewaysClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", nil) + poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginUpdateTags(ctx, "resourceGroupName", "expressRouteGatewayName", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse{ + // ExpressRouteGateway: armnetwork.ExpressRouteGateway{ + // Name: to.Ptr("expressRouteGatewayName"), + // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRouteGatewayProperties{ + // AllowNonVirtualWanTraffic: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.VirtualHubID{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go index c7212a295131..81159ef834cb 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteLinksClient contains the methods for the ExpressRouteLinks group. // Don't use this type directly, use NewExpressRouteLinksClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteLinksClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteLinksClient creates a new instance of ExpressRouteLinksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteLinksClient, error) { @@ -43,11 +43,9 @@ func NewExpressRouteLinksClient(subscriptionID string, credential azcore.TokenCr // Get - Retrieves the specified ExpressRouteLink resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRoutePortName - The name of the ExpressRoutePort resource. -// - linkName - The name of the ExpressRouteLink resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRoutePortName - The name of the express route port. +// - linkName - The name of the express route link. // - options - ExpressRouteLinksClientGetOptions contains the optional parameters for the ExpressRouteLinksClient.Get method. func (client *ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (ExpressRouteLinksClientGetResponse, error) { var err error @@ -95,8 +93,8 @@ func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -111,10 +109,8 @@ func (client *ExpressRouteLinksClient) getHandleResponse(resp *http.Response) (E } // NewListPager - Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.NewListPager // method. func (client *ExpressRouteLinksClient) NewListPager(resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) *runtime.Pager[ExpressRouteLinksClientListResponse] { @@ -160,8 +156,8 @@ func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go index 8b4c43335c96..5db12cbd87a4 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteLinkGet.json +// Generated from example definition: 2025-07-01/ExpressRouteLinkGet.json func ExampleExpressRouteLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,30 +29,32 @@ func ExampleExpressRouteLinksClient_Get() { // 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.ExpressRouteLink = armnetwork.ExpressRouteLink{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/linkName"), - // Name: to.Ptr("linkName"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocationName"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), + // res = armnetwork.ExpressRouteLinksClientGetResponse{ + // ExpressRouteLink: armnetwork.ExpressRouteLink{ + // Name: to.Ptr("linkName"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/linkName"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocationName"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteLinkList.json +// Generated from example definition: 2025-07-01/ExpressRouteLinkList.json func ExampleExpressRouteLinksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -70,36 +69,39 @@ func ExampleExpressRouteLinksClient_NewListPager() { _ = 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.ExpressRouteLinkListResult = armnetwork.ExpressRouteLinkListResult{ - // Value: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), + // page = armnetwork.ExpressRouteLinksClientListResponse{ + // ExpressRouteLinkListResult: armnetwork.ExpressRouteLinkListResult{ + // Value: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation1"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation2"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go index 4636c170eaf3..a6c5d15c8157 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRoutePortAuthorizationsClient contains the methods for the ExpressRoutePortAuthorizations group. // Don't use this type directly, use NewExpressRoutePortAuthorizationsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRoutePortAuthorizationsClient struct { internal *arm.Client subscriptionID string } // NewExpressRoutePortAuthorizationsClient creates a new instance of ExpressRoutePortAuthorizationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRoutePortAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortAuthorizationsClient, error) { @@ -43,9 +43,7 @@ func NewExpressRoutePortAuthorizationsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates an authorization in the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. // - authorizationParameters - Parameters supplied to the create or update express route port authorization operation. @@ -58,8 +56,7 @@ func (client *ExpressRoutePortAuthorizationsClient) BeginCreateOrUpdate(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *ExpressRoutePortAuthorizationsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates an authorization in the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRoutePortAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdate(ctx context.C // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, _ *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( // BeginDelete - Deletes the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. // - options - ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete @@ -156,8 +150,6 @@ func (client *ExpressRoutePortAuthorizationsClient) BeginDelete(ctx context.Cont // Delete - Deletes the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortAuthorizationsClient.BeginDelete" @@ -182,6 +174,10 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context. // deleteCreateRequest creates the Delete request. func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, _ *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,26 +190,19 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. // - options - ExpressRoutePortAuthorizationsClientGetOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.Get @@ -243,6 +232,10 @@ func (client *ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, res // getCreateRequest creates the Get request. func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, _ *ExpressRoutePortAuthorizationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +248,13 @@ func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context return nil, errors.New("parameter authorizationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +269,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http } // NewListPager - Gets all authorizations in an express route port. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of the express route port. // - options - ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.NewListPager // method. @@ -312,6 +299,10 @@ func (client *ExpressRoutePortAuthorizationsClient) NewListPager(resourceGroupNa // listCreateRequest creates the List request. func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, _ *ExpressRoutePortAuthorizationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +311,13 @@ func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx contex return nil, errors.New("parameter expressRoutePortName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go index 8c0d4f5169e9..b6e0773ea725 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go @@ -1,117 +1,123 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortAuthorizationDelete.json -func ExampleExpressRoutePortAuthorizationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRoutePortAuthorizationCreate.json +func ExampleExpressRoutePortAuthorizationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginDelete(ctx, "rg1", "expressRoutePortName", "authorizationName", nil) + poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "expressRoutePortName", "authorizatinName", armnetwork.ExpressRoutePortAuthorization{ + Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{}, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse{ + // ExpressRoutePortAuthorization: armnetwork.ExpressRoutePortAuthorization{ + // Name: to.Ptr("authorizationName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), + // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), + // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ + // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), + // CircuitResourceURI: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortAuthorizationGet.json -func ExampleExpressRoutePortAuthorizationsClient_Get() { +// Generated from example definition: 2025-07-01/ExpressRoutePortAuthorizationDelete.json +func ExampleExpressRoutePortAuthorizationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRoutePortAuthorizationsClient().Get(ctx, "rg1", "expressRoutePortName", "authorizationName", nil) + poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginDelete(ctx, "rg1", "expressRoutePortName", "authorizationName", 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 poll 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.ExpressRoutePortAuthorization = armnetwork.ExpressRoutePortAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.ExpressRoutePortAuthorizationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortAuthorizationCreate.json -func ExampleExpressRoutePortAuthorizationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ExpressRoutePortAuthorizationGet.json +func ExampleExpressRoutePortAuthorizationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "expressRoutePortName", "authorizatinName", armnetwork.ExpressRoutePortAuthorization{ - Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{}, - }, nil) + res, err := clientFactory.NewExpressRoutePortAuthorizationsClient().Get(ctx, "rg1", "expressRoutePortName", "authorizationName", 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.ExpressRoutePortAuthorization = armnetwork.ExpressRoutePortAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.ExpressRoutePortAuthorizationsClientGetResponse{ + // ExpressRoutePortAuthorization: armnetwork.ExpressRoutePortAuthorization{ + // Name: to.Ptr("authorizationName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), + // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authKey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), + // CircuitResourceURI: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortAuthorizationList.json +// Generated from example definition: 2025-07-01/ExpressRoutePortAuthorizationList.json func ExampleExpressRoutePortAuthorizationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -126,20 +132,23 @@ func ExampleExpressRoutePortAuthorizationsClient_NewListPager() { _ = 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.ExpressRoutePortAuthorizationListResult = armnetwork.ExpressRoutePortAuthorizationListResult{ - // Value: []*armnetwork.ExpressRoutePortAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.ExpressRoutePortAuthorizationsClientListResponse{ + // ExpressRoutePortAuthorizationListResult: armnetwork.ExpressRoutePortAuthorizationListResult{ + // Value: []*armnetwork.ExpressRoutePortAuthorization{ + // { + // Name: to.Ptr("authorizationName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), + // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), + // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ + // AuthorizationKey: to.Ptr("authKey"), + // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), + // CircuitResourceURI: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go index 37918da34ebb..89919d537817 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRoutePortsClient contains the methods for the ExpressRoutePorts group. // Don't use this type directly, use NewExpressRoutePortsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRoutePortsClient struct { internal *arm.Client subscriptionID string } // NewExpressRoutePortsClient creates a new instance of ExpressRoutePortsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRoutePortsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsClient, error) { @@ -43,10 +43,8 @@ func NewExpressRoutePortsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRoutePortName - The name of ExpressRoutePort. // - parameters - Parameters supplied to the create ExpressRoutePort operation. // - options - ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate // method. @@ -57,8 +55,7 @@ func (client *ExpressRoutePortsClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ExpressRoutePortsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRoutePortsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,10 +120,8 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete // method. func (client *ExpressRoutePortsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*runtime.Poller[ExpressRoutePortsClientDeleteResponse], error) { @@ -150,8 +144,6 @@ func (client *ExpressRoutePortsClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginDelete" @@ -193,17 +185,14 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // GenerateLOA - Generate a letter of authorization for the requested ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of ExpressRoutePort. // - request - Request parameters supplied to generate a letter of authorization. // - options - ExpressRoutePortsClientGenerateLOAOptions contains the optional parameters for the ExpressRoutePortsClient.GenerateLOA @@ -232,7 +221,7 @@ func (client *ExpressRoutePortsClient) GenerateLOA(ctx context.Context, resource // generateLOACreateRequest creates the GenerateLOA request. func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest, _ *ExpressRoutePortsClientGenerateLOAOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/generateLoa" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -250,9 +239,10 @@ func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } @@ -270,9 +260,7 @@ func (client *ExpressRoutePortsClient) generateLOAHandleResponse(resp *http.Resp // Get - Retrieves the requested ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. func (client *ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (ExpressRoutePortsClientGetResponse, error) { @@ -317,8 +305,8 @@ func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -333,8 +321,6 @@ func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (E } // NewListPager - List all the ExpressRoutePort resources in the specified subscription. -// -// Generated from API version 2025-05-01 // - options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager // method. func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { @@ -372,8 +358,8 @@ func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -388,9 +374,7 @@ func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) ( } // NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager // method. func (client *ExpressRoutePortsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) *runtime.Pager[ExpressRoutePortsClientListByResourceGroupResponse] { @@ -432,8 +416,8 @@ func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -449,10 +433,8 @@ func (client *ExpressRoutePortsClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Update ExpressRoutePort tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - expressRoutePortName - The name of ExpressRoutePort. // - parameters - Parameters supplied to update ExpressRoutePort resource tags. // - options - ExpressRoutePortsClientUpdateTagsOptions contains the optional parameters for the ExpressRoutePortsClient.UpdateTags // method. @@ -498,9 +480,10 @@ func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go index e8d3495918ce..05bd115b374b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go @@ -1,117 +1,106 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortDelete.json -func ExampleExpressRoutePortsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ExpressRoutePortCreate.json +func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginDelete(ctx, "rg1", "portName", nil) + poller, err := clientFactory.NewExpressRoutePortsClient().BeginCreateOrUpdate(ctx, "rg1", "portName", armnetwork.ExpressRoutePort{ + Location: to.Ptr("westus"), + Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + BandwidthInGbps: to.Ptr[int32](100), + BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + PeeringLocation: to.Ptr("peeringLocationName"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortGet.json -func ExampleExpressRoutePortsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsClient().Get(ctx, "rg1", "portName", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, + // res = armnetwork.ExpressRoutePortsClientCreateOrUpdateResponse{ + // ExpressRoutePort: armnetwork.ExpressRoutePort{ + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, + // }, + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortCreate.json -func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortCreate() { +// Generated from example definition: 2025-07-01/ExpressRoutePortUpdateLink.json +func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortUpdateLink() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -121,6 +110,14 @@ func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortCreate() BandwidthInGbps: to.Ptr[int32](100), BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + Links: []*armnetwork.ExpressRouteLink{ + { + Name: to.Ptr("link1"), + Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), + }, + }, + }, PeeringLocation: to.Ptr("peeringLocationName"), }, }, nil) @@ -129,160 +126,101 @@ func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortCreate() } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, + // res = armnetwork.ExpressRoutePortsClientCreateOrUpdateResponse{ + // ExpressRoutePort: armnetwork.ExpressRoutePort{ + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, + // }, + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortUpdateLink.json -func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortUpdateLink() { +// Generated from example definition: 2025-07-01/ExpressRoutePortDelete.json +func ExampleExpressRoutePortsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginCreateOrUpdate(ctx, "rg1", "portName", armnetwork.ExpressRoutePort{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - BandwidthInGbps: to.Ptr[int32](100), - BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - Links: []*armnetwork.ExpressRouteLink{ - { - Name: to.Ptr("link1"), - Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), - }, - }}, - PeeringLocation: to.Ptr("peeringLocationName"), - }, - }, nil) + poller, err := clientFactory.NewExpressRoutePortsClient().BeginDelete(ctx, "rg1", "portName", 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) + log.Fatalf("failed to poll 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.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.ExpressRoutePortsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortUpdateTags.json -func ExampleExpressRoutePortsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/GenerateExpressRoutePortsLOA.json +func ExampleExpressRoutePortsClient_GenerateLOA() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRoutePortsClient().UpdateTags(ctx, "rg1", "portName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, + res, err := clientFactory.NewExpressRoutePortsClient().GenerateLOA(ctx, "rg1", "portName", armnetwork.GenerateExpressRoutePortsLOARequest{ + CustomerName: to.Ptr("customerName"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -290,66 +228,96 @@ func ExampleExpressRoutePortsClient_UpdateTags() { // 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.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, + // res = armnetwork.ExpressRoutePortsClientGenerateLOAResponse{ + // GenerateExpressRoutePortsLOAResult: armnetwork.GenerateExpressRoutePortsLOAResult{ + // EncodedContent: to.Ptr("TWFuIGlzIGRpc3"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRoutePortGet.json +func ExampleExpressRoutePortsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewExpressRoutePortsClient().Get(ctx, "rg1", "portName", 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 = armnetwork.ExpressRoutePortsClientGetResponse{ + // ExpressRoutePort: armnetwork.ExpressRoutePort{ + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation1"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation2"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, + // }, + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortListByResourceGroup.json -func ExampleExpressRoutePortsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/ExpressRoutePortList.json +func ExampleExpressRoutePortsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewExpressRoutePortsClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewExpressRoutePortsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -360,72 +328,76 @@ func ExampleExpressRoutePortsClient_NewListByResourceGroupPager() { _ = 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.ExpressRoutePortListResult = armnetwork.ExpressRoutePortListResult{ - // Value: []*armnetwork.ExpressRoutePort{ - // { - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, + // page = armnetwork.ExpressRoutePortsClientListResponse{ + // ExpressRoutePortListResult: armnetwork.ExpressRoutePortListResult{ + // Value: []*armnetwork.ExpressRoutePort{ + // { + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation1"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation2"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, + // }, + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortList.json -func ExampleExpressRoutePortsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ExpressRoutePortListByResourceGroup.json +func ExampleExpressRoutePortsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewExpressRoutePortsClient().NewListPager(nil) + pager := clientFactory.NewExpressRoutePortsClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -436,73 +408,80 @@ func ExampleExpressRoutePortsClient_NewListPager() { _ = 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.ExpressRoutePortListResult = armnetwork.ExpressRoutePortListResult{ - // Value: []*armnetwork.ExpressRoutePort{ - // { - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, + // page = armnetwork.ExpressRoutePortsClientListByResourceGroupResponse{ + // ExpressRoutePortListResult: armnetwork.ExpressRoutePortListResult{ + // Value: []*armnetwork.ExpressRoutePort{ + // { + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation1"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, + // }, + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ColoLocation: to.Ptr("coloLocation2"), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GenerateExpressRoutePortsLOA.json -func ExampleExpressRoutePortsClient_GenerateLOA() { +// Generated from example definition: 2025-07-01/ExpressRoutePortUpdateTags.json +func ExampleExpressRoutePortsClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRoutePortsClient().GenerateLOA(ctx, "rg1", "portName", armnetwork.GenerateExpressRoutePortsLOARequest{ - CustomerName: to.Ptr("customerName"), + res, err := clientFactory.NewExpressRoutePortsClient().UpdateTags(ctx, "rg1", "portName", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -510,7 +489,53 @@ func ExampleExpressRoutePortsClient_GenerateLOA() { // 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.GenerateExpressRoutePortsLOAResult = armnetwork.GenerateExpressRoutePortsLOAResult{ - // EncodedContent: to.Ptr("TWFuIGlzIGRpc3"), + // res = armnetwork.ExpressRoutePortsClientUpdateTagsResponse{ + // ExpressRoutePort: armnetwork.ExpressRoutePort{ + // Name: to.Ptr("portName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ + // AllocationDate: to.Ptr("Friday, July 1, 2018"), + // BandwidthInGbps: to.Ptr[int32](100), + // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), + // Circuits: []*armnetwork.SubResource{ + // }, + // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), + // EtherType: to.Ptr("0x8100"), + // Links: []*armnetwork.ExpressRouteLink{ + // { + // Name: to.Ptr("link1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId1"), + // RouterName: to.Ptr("router1"), + // }, + // }, + // { + // Name: to.Ptr("link2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), + // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ + // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), + // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), + // InterfaceName: to.Ptr("Ethernet 0/0"), + // PatchPanelID: to.Ptr("patchPanelId2"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RackID: to.Ptr("rackId2"), + // RouterName: to.Ptr("router2"), + // }, + // }, + // }, + // Mtu: to.Ptr("1500"), + // PeeringLocation: to.Ptr("peeringLocationName"), + // ProvisionedBandwidthInGbps: to.Ptr[float32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go index d2d4f9eb773a..507f146f9991 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRoutePortsLocationsClient contains the methods for the ExpressRoutePortsLocations group. // Don't use this type directly, use NewExpressRoutePortsLocationsClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRoutePortsLocationsClient struct { internal *arm.Client subscriptionID string } // NewExpressRoutePortsLocationsClient creates a new instance of ExpressRoutePortsLocationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsLocationsClient, error) { @@ -44,8 +44,6 @@ func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcor // Get - Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said // peering location. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - locationName - Name of the requested ExpressRoutePort peering location. // - options - ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get // method. @@ -87,8 +85,8 @@ func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -104,8 +102,6 @@ func (client *ExpressRoutePortsLocationsClient) getHandleResponse(resp *http.Res // NewListPager - Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. // Available bandwidths can only be obtained when retrieving a specific peering location. -// -// Generated from API version 2025-05-01 // - options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager // method. func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { @@ -143,8 +139,8 @@ func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go index 994a7ffb0117..9a5ffbfa6957 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go @@ -1,27 +1,63 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortsLocationList.json +// Generated from example definition: 2025-07-01/ExpressRoutePortsLocationGet.json +func ExampleExpressRoutePortsLocationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewExpressRoutePortsLocationsClient().Get(ctx, "locationName", 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 = armnetwork.ExpressRoutePortsLocationsClientGetResponse{ + // ExpressRoutePortsLocation: armnetwork.ExpressRoutePortsLocation{ + // Name: to.Ptr("locationName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ + // Address: to.Ptr("123 Main Street, City, State, Zip"), + // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ + // { + // OfferName: to.Ptr("100 Gbps"), + // ValueInGbps: to.Ptr[int32](100), + // }, + // }, + // Contact: to.Ptr("email@address.com"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/ExpressRoutePortsLocationList.json func ExampleExpressRoutePortsLocationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,57 +72,24 @@ func ExampleExpressRoutePortsLocationsClient_NewListPager() { _ = 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.ExpressRoutePortsLocationListResult = armnetwork.ExpressRoutePortsLocationListResult{ - // Value: []*armnetwork.ExpressRoutePortsLocation{ - // { - // Name: to.Ptr("locationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ - // Address: to.Ptr("123 Main Street, City, State, Zip"), - // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ + // page = armnetwork.ExpressRoutePortsLocationsClientListResponse{ + // ExpressRoutePortsLocationListResult: armnetwork.ExpressRoutePortsLocationListResult{ + // Value: []*armnetwork.ExpressRoutePortsLocation{ + // { + // Name: to.Ptr("locationName"), + // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ + // Address: to.Ptr("123 Main Street, City, State, Zip"), + // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ + // }, + // Contact: to.Ptr("email@address.com"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // Contact: to.Ptr("email@address.com"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRoutePortsLocationGet.json -func ExampleExpressRoutePortsLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsLocationsClient().Get(ctx, "locationName", 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.ExpressRoutePortsLocation = armnetwork.ExpressRoutePortsLocation{ - // Name: to.Ptr("locationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ - // Address: to.Ptr("123 Main Street, City, State, Zip"), - // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ - // { - // OfferName: to.Ptr("100 Gbps"), - // ValueInGbps: to.Ptr[int32](100), - // }}, - // Contact: to.Ptr("email@address.com"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go index 286d91da0a4f..70886499dd78 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteProviderPortsLocationClient contains the methods for the ExpressRouteProviderPortsLocation group. // Don't use this type directly, use NewExpressRouteProviderPortsLocationClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteProviderPortsLocationClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteProviderPortsLocationClient creates a new instance of ExpressRouteProviderPortsLocationClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteProviderPortsLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteProviderPortsLocationClient, error) { @@ -43,8 +43,6 @@ func NewExpressRouteProviderPortsLocationClient(subscriptionID string, credentia // List - Retrieves all the ExpressRouteProviderPorts in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List // method. func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { @@ -84,8 +82,8 @@ func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go index 1ac3a7a5662c..76bc89d9f764 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go @@ -1,70 +1,70 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/expressRouteProviderPortList.json +// Generated from example definition: 2025-07-01/expressRouteProviderPortList.json func ExampleExpressRouteProviderPortsLocationClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExpressRouteProviderPortsLocationClient().List(ctx, &armnetwork.ExpressRouteProviderPortsLocationClientListOptions{Filter: nil}) + res, err := clientFactory.NewExpressRouteProviderPortsLocationClient().List(ctx, 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.ExpressRouteProviderPortListResult = armnetwork.ExpressRouteProviderPortListResult{ - // Value: []*armnetwork.ExpressRouteProviderPort{ - // { - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("SiliconValley"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // RemainingBandwidthInMbps: to.Ptr[int32](1500), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // UsedBandwidthInMbps: to.Ptr[int32](2500), + // res = armnetwork.ExpressRouteProviderPortsLocationClientListResponse{ + // ExpressRouteProviderPortListResult: armnetwork.ExpressRouteProviderPortListResult{ + // Value: []*armnetwork.ExpressRouteProviderPort{ + // { + // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), + // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), + // Location: to.Ptr("uswest"), + // Properties: &armnetwork.ExpressRouteProviderPortProperties{ + // OverprovisionFactor: to.Ptr[int32](4), + // PeeringLocation: to.Ptr("SiliconValley"), + // PortBandwidthInMbps: to.Ptr[int32](4000), + // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // RemainingBandwidthInMbps: to.Ptr[int32](1500), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // UsedBandwidthInMbps: to.Ptr[int32](2500), + // }, // }, - // }, - // { - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair2"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("seattle"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair2"), - // PrimaryAzurePort: to.Ptr("bvtazureixp02"), - // RemainingBandwidthInMbps: to.Ptr[int32](1800), - // SecondaryAzurePort: to.Ptr("bvtazureixp02"), - // UsedBandwidthInMbps: to.Ptr[int32](1200), + // { + // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), + // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair2"), + // Location: to.Ptr("uswest"), + // Properties: &armnetwork.ExpressRouteProviderPortProperties{ + // OverprovisionFactor: to.Ptr[int32](4), + // PeeringLocation: to.Ptr("seattle"), + // PortBandwidthInMbps: to.Ptr[int32](4000), + // PortPairDescriptor: to.Ptr("bvtazureixpportpair2"), + // PrimaryAzurePort: to.Ptr("bvtazureixp02"), + // RemainingBandwidthInMbps: to.Ptr[int32](1800), + // SecondaryAzurePort: to.Ptr("bvtazureixp02"), + // UsedBandwidthInMbps: to.Ptr[int32](1200), + // }, // }, - // }}, + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go index ed7ed37e32b5..cd3e4cc52bc6 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ExpressRouteServiceProvidersClient contains the methods for the ExpressRouteServiceProviders group. // Don't use this type directly, use NewExpressRouteServiceProvidersClient() instead. +// +// Generated from API version 2025-07-01 type ExpressRouteServiceProvidersClient struct { internal *arm.Client subscriptionID string } // NewExpressRouteServiceProvidersClient creates a new instance of ExpressRouteServiceProvidersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteServiceProvidersClient, error) { @@ -42,8 +42,6 @@ func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azc } // NewListPager - Gets all the available express route service providers. -// -// Generated from API version 2025-05-01 // - options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager // method. func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { @@ -81,8 +79,8 @@ func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go index ce44317ddaec..2717a4e00f04 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ExpressRouteProviderList.json +// Generated from example definition: 2025-07-01/ExpressRouteProviderList.json func ExampleExpressRouteServiceProvidersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,52 +33,57 @@ func ExampleExpressRouteServiceProvidersClient_NewListPager() { _ = 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.ExpressRouteServiceProviderListResult = armnetwork.ExpressRouteServiceProviderListResult{ - // Value: []*armnetwork.ExpressRouteServiceProvider{ - // { - // Name: to.Ptr("providerName"), - // Type: to.Ptr("Microsoft.Network/expressRouteServiceProviders"), - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/expressRouteServiceProviders/"), - // Properties: &armnetwork.ExpressRouteServiceProviderPropertiesFormat{ - // BandwidthsOffered: []*armnetwork.ExpressRouteServiceProviderBandwidthsOffered{ - // { - // OfferName: to.Ptr("50Mbps"), - // ValueInMbps: to.Ptr[int32](50), - // }, - // { - // OfferName: to.Ptr("100Mbps"), - // ValueInMbps: to.Ptr[int32](100), - // }, - // { - // OfferName: to.Ptr("200Mbps"), - // ValueInMbps: to.Ptr[int32](200), - // }, - // { - // OfferName: to.Ptr("500Mbps"), - // ValueInMbps: to.Ptr[int32](500), - // }, - // { - // OfferName: to.Ptr("1Gbps"), - // ValueInMbps: to.Ptr[int32](1000), - // }, - // { - // OfferName: to.Ptr("2Gbps"), - // ValueInMbps: to.Ptr[int32](2000), + // page = armnetwork.ExpressRouteServiceProvidersClientListResponse{ + // ExpressRouteServiceProviderListResult: armnetwork.ExpressRouteServiceProviderListResult{ + // Value: []*armnetwork.ExpressRouteServiceProvider{ + // { + // Name: to.Ptr("providerName"), + // Type: to.Ptr("Microsoft.Network/expressRouteServiceProviders"), + // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/expressRouteServiceProviders/"), + // Properties: &armnetwork.ExpressRouteServiceProviderPropertiesFormat{ + // BandwidthsOffered: []*armnetwork.ExpressRouteServiceProviderBandwidthsOffered{ + // { + // OfferName: to.Ptr("50Mbps"), + // ValueInMbps: to.Ptr[int32](50), + // }, + // { + // OfferName: to.Ptr("100Mbps"), + // ValueInMbps: to.Ptr[int32](100), + // }, + // { + // OfferName: to.Ptr("200Mbps"), + // ValueInMbps: to.Ptr[int32](200), + // }, + // { + // OfferName: to.Ptr("500Mbps"), + // ValueInMbps: to.Ptr[int32](500), + // }, + // { + // OfferName: to.Ptr("1Gbps"), + // ValueInMbps: to.Ptr[int32](1000), + // }, + // { + // OfferName: to.Ptr("2Gbps"), + // ValueInMbps: to.Ptr[int32](2000), + // }, + // { + // OfferName: to.Ptr("5Gbps"), + // ValueInMbps: to.Ptr[int32](5000), + // }, + // { + // OfferName: to.Ptr("10Gbps"), + // ValueInMbps: to.Ptr[int32](10000), + // }, // }, - // { - // OfferName: to.Ptr("5Gbps"), - // ValueInMbps: to.Ptr[int32](5000), + // PeeringLocations: []*string{ + // to.Ptr("peeringLocation1"), + // to.Ptr("peeringLocation2"), // }, - // { - // OfferName: to.Ptr("10Gbps"), - // ValueInMbps: to.Ptr[int32](10000), - // }}, - // PeeringLocations: []*string{ - // to.Ptr("peeringLocation1"), - // to.Ptr("peeringLocation2")}, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go index f41ed85d223b..9056ba90b59c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (a *AdminRuleCollectionsServerTransport) Do(req *http.Request) (*http.Respo } func (a *AdminRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -143,7 +138,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchCreateOrUpdate(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdminRuleCollection, req) @@ -182,11 +177,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchBeginDelete(req *http.Requ if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -209,7 +200,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -251,7 +242,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdminRuleCollection, req) @@ -286,11 +277,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -300,11 +287,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.AdminRuleCollectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.AdminRuleCollectionsClientListOptions{ @@ -323,7 +306,7 @@ func (a *AdminRuleCollectionsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go index d67d17b1d34b..b6f1d800c800 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (a *AdminRulesServerTransport) Do(req *http.Request) (*http.Response, error } func (a *AdminRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (a *AdminRulesServerTransport) dispatchToMethodFake(req *http.Request, meth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -151,7 +146,7 @@ func (a *AdminRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BaseAdminRuleClassification, req) @@ -194,11 +189,7 @@ func (a *AdminRulesServerTransport) dispatchBeginDelete(req *http.Request) (*htt if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -221,7 +212,7 @@ func (a *AdminRulesServerTransport) dispatchBeginDelete(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -267,7 +258,7 @@ func (a *AdminRulesServerTransport) dispatchGet(req *http.Request) (*http.Respon return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BaseAdminRuleClassification, req) @@ -306,11 +297,7 @@ func (a *AdminRulesServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -320,11 +307,7 @@ func (a *AdminRulesServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.AdminRulesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.AdminRulesClientListOptions{ @@ -343,7 +326,7 @@ func (a *AdminRulesServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go index f7538c5e57d2..6f498866b2d9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationGatewayPrivateEndpointConnectionsServer is a fake server for instances of the armnetwork.ApplicationGatewayPrivateEndpointConnectionsClient type. @@ -71,9 +71,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) Do(req *ht } func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchTo } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -146,7 +141,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchBe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -184,7 +179,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchGe return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGatewayPrivateEndpointConnection, req) @@ -225,7 +220,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchNe if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -276,7 +271,7 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchBe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go index 21e5e047fc7a..f462393d8d13 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationGatewayPrivateLinkResourcesServer is a fake server for instances of the armnetwork.ApplicationGatewayPrivateLinkResourcesClient type. @@ -54,9 +54,7 @@ func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) Do(req *http.Req } func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchToMethod } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -117,7 +112,7 @@ func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchNewListP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go index 3994510a35e0..7c65e4742524 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationGatewaysServer is a fake server for instances of the armnetwork.ApplicationGatewaysClient type. @@ -135,9 +135,7 @@ func (a *ApplicationGatewaysServerTransport) Do(req *http.Request) (*http.Respon } func (a *ApplicationGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -185,10 +183,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchToMethodFake(req *http.Requ } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -220,11 +215,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginBackendHealth(req *htt if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.ApplicationGatewaysClientBeginBackendHealthOptions if expandParam != nil { options = &armnetwork.ApplicationGatewaysClientBeginBackendHealthOptions{ @@ -244,7 +235,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginBackendHealth(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginBackendHealth.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -280,11 +271,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginBackendHealthOnDemand( if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.ApplicationGatewaysClientBeginBackendHealthOnDemandOptions if expandParam != nil { options = &armnetwork.ApplicationGatewaysClientBeginBackendHealthOnDemandOptions{ @@ -304,7 +291,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginBackendHealthOnDemand( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginBackendHealthOnDemand.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -352,7 +339,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { a.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -396,7 +383,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -430,7 +417,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchGet(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGateway, req) @@ -459,7 +446,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchGetSSLPredefinedPolicy(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGatewaySSLPredefinedPolicy, req) @@ -496,7 +483,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchNewListPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -529,7 +516,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchNewListAllPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -554,7 +541,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchListAvailableRequestHeaders return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StringArray, req) @@ -579,7 +566,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchListAvailableResponseHeader return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StringArray, req) @@ -604,7 +591,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchListAvailableSSLOptions(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGatewayAvailableSSLOptions, req) @@ -637,7 +624,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchNewListAvailableSSLPredefin if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListAvailableSSLPredefinedPoliciesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -662,7 +649,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchListAvailableServerVariable return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StringArray, req) @@ -687,7 +674,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchListAvailableWafRuleSets(re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGatewayAvailableWafRuleSetsResult, req) @@ -730,7 +717,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStart(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginStart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -774,7 +761,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStop(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginStop.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -812,7 +799,7 @@ func (a *ApplicationGatewaysServerTransport) dispatchUpdateTags(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGateway, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go index 899b6b27b773..c3d24ad1b31f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationGatewayWafDynamicManifestsServer is a fake server for instances of the armnetwork.ApplicationGatewayWafDynamicManifestsClient type. @@ -54,9 +54,7 @@ func (a *ApplicationGatewayWafDynamicManifestsServerTransport) Do(req *http.Requ } func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchToMethodF } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchNewGetPag if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newGetPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go index 97251a914604..e6dbbc74c4f7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationGatewayWafDynamicManifestsDefaultServer is a fake server for instances of the armnetwork.ApplicationGatewayWafDynamicManifestsDefaultClient type. @@ -50,9 +50,7 @@ func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) Do(req *ht } func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchTo } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -101,7 +96,7 @@ func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchGe return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationGatewayWafDynamicManifestResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go index 0235330242b8..8481b61e79c7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ApplicationSecurityGroupsServer is a fake server for instances of the armnetwork.ApplicationSecurityGroupsClient type. @@ -81,9 +81,7 @@ func (a *ApplicationSecurityGroupsServerTransport) Do(req *http.Request) (*http. } func (a *ApplicationSecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchBeginCreateOrUpdate(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { a.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationSecurityGroup, req) @@ -275,7 +270,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchNewListAllPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchUpdateTags(req *http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationSecurityGroup, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go index b119b544d2b9..ac43f00fe29d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // AvailableDelegationsServer is a fake server for instances of the armnetwork.AvailableDelegationsClient type. @@ -54,9 +54,7 @@ func (a *AvailableDelegationsServerTransport) Do(req *http.Request) (*http.Respo } func (a *AvailableDelegationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (a *AvailableDelegationsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (a *AvailableDelegationsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go index 4a646db12d77..e09c7ff2f2ab 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // AvailableEndpointServicesServer is a fake server for instances of the armnetwork.AvailableEndpointServicesClient type. @@ -54,9 +54,7 @@ func (a *AvailableEndpointServicesServerTransport) Do(req *http.Request) (*http. } func (a *AvailableEndpointServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (a *AvailableEndpointServicesServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (a *AvailableEndpointServicesServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go index 53f6b9cf9929..c0e8e3934df6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // AvailablePrivateEndpointTypesServer is a fake server for instances of the armnetwork.AvailablePrivateEndpointTypesClient type. @@ -60,9 +60,7 @@ func (a *AvailablePrivateEndpointTypesServerTransport) Do(req *http.Request) (*h } func (a *AvailablePrivateEndpointTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -80,10 +78,7 @@ func (a *AvailablePrivateEndpointTypesServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -121,7 +116,7 @@ func (a *AvailablePrivateEndpointTypesServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -162,7 +157,7 @@ func (a *AvailablePrivateEndpointTypesServerTransport) dispatchNewListByResource if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go index 73e44c16b9df..53fae5e678ab 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // AvailableResourceGroupDelegationsServer is a fake server for instances of the armnetwork.AvailableResourceGroupDelegationsClient type. @@ -54,9 +54,7 @@ func (a *AvailableResourceGroupDelegationsServerTransport) Do(req *http.Request) } func (a *AvailableResourceGroupDelegationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (a *AvailableResourceGroupDelegationsServerTransport) dispatchToMethodFake( } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -117,7 +112,7 @@ func (a *AvailableResourceGroupDelegationsServerTransport) dispatchNewListPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go index 37257c570005..94ce69bb86da 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // AvailableServiceAliasesServer is a fake server for instances of the armnetwork.AvailableServiceAliasesClient type. @@ -60,9 +60,7 @@ func (a *AvailableServiceAliasesServerTransport) Do(req *http.Request) (*http.Re } func (a *AvailableServiceAliasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -80,10 +78,7 @@ func (a *AvailableServiceAliasesServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -121,7 +116,7 @@ func (a *AvailableServiceAliasesServerTransport) dispatchNewListPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -162,7 +157,7 @@ func (a *AvailableServiceAliasesServerTransport) dispatchNewListByResourceGroupP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go index f39a15c42f60..117d1b64fdfd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,9 +11,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "regexp" + "slices" ) // AzureFirewallFqdnTagsServer is a fake server for instances of the armnetwork.AzureFirewallFqdnTagsClient type. @@ -53,9 +53,7 @@ func (a *AzureFirewallFqdnTagsServerTransport) Do(req *http.Request) (*http.Resp } func (a *AzureFirewallFqdnTagsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -71,10 +69,7 @@ func (a *AzureFirewallFqdnTagsServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -108,7 +103,7 @@ func (a *AzureFirewallFqdnTagsServerTransport) dispatchNewListAllPager(req *http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go index 03cdb307dbee..38dffe1d0399 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" + "strconv" ) // AzureFirewallsServer is a fake server for instances of the armnetwork.AzureFirewallsClient type. @@ -101,9 +102,7 @@ func (a *AzureFirewallsServerTransport) Do(req *http.Request) (*http.Response, e } func (a *AzureFirewallsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -135,10 +134,7 @@ func (a *AzureFirewallsServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -161,6 +157,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + qp := req.URL.Query() body, err := server.UnmarshalRequestAsJSON[armnetwork.AzureFirewall](req) if err != nil { return nil, err @@ -173,7 +170,17 @@ func (a *AzureFirewallsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re if err != nil { return nil, err } - respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, azureFirewallNameParam, body, nil) + createAfcControlPlaneParam, err := parseOptional(qp.Get("createAfcControlPlane"), strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armnetwork.AzureFirewallsClientBeginCreateOrUpdateOptions + if createAfcControlPlaneParam != nil { + options = &armnetwork.AzureFirewallsClientBeginCreateOrUpdateOptions{ + CreateAfcControlPlane: createAfcControlPlaneParam, + } + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, azureFirewallNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -186,7 +193,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { a.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -230,7 +237,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -264,7 +271,7 @@ func (a *AzureFirewallsServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AzureFirewall, req) @@ -301,7 +308,7 @@ func (a *AzureFirewallsServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -334,7 +341,7 @@ func (a *AzureFirewallsServerTransport) dispatchNewListAllPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -377,7 +384,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginListLearnedPrefixes(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginListLearnedPrefixes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -425,7 +432,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginPacketCapture(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -473,7 +480,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginPacketCaptureOperation(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginPacketCaptureOperation.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -521,7 +528,7 @@ func (a *AzureFirewallsServerTransport) dispatchBeginUpdateTags(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go index a522bacfe78b..bfe1477dbcd4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // BastionHostsServer is a fake server for instances of the armnetwork.BastionHostsClient type. @@ -83,9 +83,7 @@ func (b *BastionHostsServerTransport) Do(req *http.Request) (*http.Response, err } func (b *BastionHostsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -111,10 +109,7 @@ func (b *BastionHostsServerTransport) dispatchToMethodFake(req *http.Request, me } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -162,7 +157,7 @@ func (b *BastionHostsServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { b.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -206,7 +201,7 @@ func (b *BastionHostsServerTransport) dispatchBeginDelete(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { b.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -240,7 +235,7 @@ func (b *BastionHostsServerTransport) dispatchGet(req *http.Request) (*http.Resp return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BastionHost, req) @@ -273,7 +268,7 @@ func (b *BastionHostsServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { b.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -310,7 +305,7 @@ func (b *BastionHostsServerTransport) dispatchNewListByResourceGroupPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { b.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +352,7 @@ func (b *BastionHostsServerTransport) dispatchBeginUpdateTags(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { b.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go index 0055073e0b0f..ff52b799eb50 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,9 +11,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "regexp" + "slices" ) // BgpServiceCommunitiesServer is a fake server for instances of the armnetwork.BgpServiceCommunitiesClient type. @@ -53,9 +53,7 @@ func (b *BgpServiceCommunitiesServerTransport) Do(req *http.Request) (*http.Resp } func (b *BgpServiceCommunitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -71,10 +69,7 @@ func (b *BgpServiceCommunitiesServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -108,7 +103,7 @@ func (b *BgpServiceCommunitiesServerTransport) dispatchNewListPager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { b.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/commits_server.go b/sdk/resourcemanager/network/armnetwork/fake/commits_server.go new file mode 100644 index 000000000000..259ccc4a50c5 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/commits_server.go @@ -0,0 +1,309 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "net/http" + "net/url" + "regexp" + "slices" + "strconv" +) + +// CommitsServer is a fake server for instances of the armnetwork.CommitsClient type. +type CommitsServer struct { + // BeginCreateOrUpdate is the fake for method CommitsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, resource armnetwork.Commit, options *armnetwork.CommitsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.CommitsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method CommitsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *armnetwork.CommitsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.CommitsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method CommitsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkManagerName string, commitName string, options *armnetwork.CommitsClientGetOptions) (resp azfake.Responder[armnetwork.CommitsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method CommitsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkManagerName string, options *armnetwork.CommitsClientListOptions) (resp azfake.PagerResponder[armnetwork.CommitsClientListResponse]) +} + +// NewCommitsServerTransport creates a new instance of CommitsServerTransport with the provided implementation. +// The returned CommitsServerTransport instance is connected to an instance of armnetwork.CommitsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCommitsServerTransport(srv *CommitsServer) *CommitsServerTransport { + return &CommitsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.CommitsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armnetwork.CommitsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.CommitsClientListResponse]](), + } +} + +// CommitsServerTransport connects instances of armnetwork.CommitsClient to instances of CommitsServer. +// Don't use this type directly, use NewCommitsServerTransport instead. +type CommitsServerTransport struct { + srv *CommitsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.CommitsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armnetwork.CommitsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.CommitsClientListResponse]] +} + +// Do implements the policy.Transporter interface for CommitsServerTransport. +func (c *CommitsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *CommitsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result, 1) + go func() { + var intercepted bool + var res result + if commitsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = commitsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CommitsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CommitsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CommitsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CommitsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + resultChan <- res + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (c *CommitsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkManagers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.Commit](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkManagerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkManagerName")]) + if err != nil { + return nil, err + } + commitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("commitName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, networkManagerNameParam, commitNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (c *CommitsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkManagers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkManagerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkManagerName")]) + if err != nil { + return nil, err + } + commitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("commitName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, networkManagerNameParam, commitNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *CommitsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkManagers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkManagerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkManagerName")]) + if err != nil { + return nil, err + } + commitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("commitName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, networkManagerNameParam, commitNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Commit, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CommitsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkManagers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commits` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkManagerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkManagerName")]) + if err != nil { + return nil, err + } + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(qp.Get("$skipToken")) + var options *armnetwork.CommitsClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.CommitsClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, networkManagerNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.CommitsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to CommitsServerTransport +var commitsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go index caab8b3b7398..c6608e9a0c7a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ConfigurationPolicyGroupsServer is a fake server for instances of the armnetwork.ConfigurationPolicyGroupsClient type. @@ -71,9 +71,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) Do(req *http.Request) (*http. } func (c *ConfigurationPolicyGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchBeginCreateOrUpdate(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { c.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNServerConfigurationPolicyGroup, req) @@ -277,7 +272,7 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchNewListByVPNServerCon if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { c.newListByVPNServerConfigurationPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go index ac2c5437f88b..287a9577335e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,12 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ConnectionMonitorsServer is a fake server for instances of the armnetwork.ConnectionMonitorsClient type. @@ -80,9 +81,7 @@ func (c *ConnectionMonitorsServerTransport) Do(req *http.Request) (*http.Respons } func (c *ConnectionMonitorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -108,10 +107,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -151,11 +147,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginCreateOrUpdate(req *htt if err != nil { return nil, err } - migrateUnescaped, err := url.QueryUnescape(qp.Get("migrate")) - if err != nil { - return nil, err - } - migrateParam := getOptional(migrateUnescaped) + migrateParam := getOptional(qp.Get("migrate")) var options *armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions if migrateParam != nil { options = &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{ @@ -175,7 +167,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginCreateOrUpdate(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { c.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -223,7 +215,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -261,7 +253,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionMonitorResult, req) @@ -294,12 +286,15 @@ func (c *ConnectionMonitorsServerTransport) dispatchNewListPager(req *http.Reque resp := c.srv.NewListPager(resourceGroupNameParam, networkWatcherNameParam, nil) newListPager = &resp c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.ConnectionMonitorsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -346,7 +341,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginStop(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginStop.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -388,7 +383,7 @@ func (c *ConnectionMonitorsServerTransport) dispatchUpdateTags(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionMonitorResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/connectionpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectionpolicies_server.go new file mode 100644 index 000000000000..60514baf58df --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/connectionpolicies_server.go @@ -0,0 +1,289 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "net/http" + "net/url" + "regexp" + "slices" +) + +// ConnectionPoliciesServer is a fake server for instances of the armnetwork.ConnectionPoliciesClient type. +type ConnectionPoliciesServer struct { + // BeginCreateOrUpdate is the fake for method ConnectionPoliciesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, resource armnetwork.ConnectionPolicy, options *armnetwork.ConnectionPoliciesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.ConnectionPoliciesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ConnectionPoliciesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *armnetwork.ConnectionPoliciesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.ConnectionPoliciesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ConnectionPoliciesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, virtualHubName string, connectionPolicyName string, options *armnetwork.ConnectionPoliciesClientGetOptions) (resp azfake.Responder[armnetwork.ConnectionPoliciesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ConnectionPoliciesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, virtualHubName string, options *armnetwork.ConnectionPoliciesClientListOptions) (resp azfake.PagerResponder[armnetwork.ConnectionPoliciesClientListResponse]) +} + +// NewConnectionPoliciesServerTransport creates a new instance of ConnectionPoliciesServerTransport with the provided implementation. +// The returned ConnectionPoliciesServerTransport instance is connected to an instance of armnetwork.ConnectionPoliciesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewConnectionPoliciesServerTransport(srv *ConnectionPoliciesServer) *ConnectionPoliciesServerTransport { + return &ConnectionPoliciesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ConnectionPoliciesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armnetwork.ConnectionPoliciesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.ConnectionPoliciesClientListResponse]](), + } +} + +// ConnectionPoliciesServerTransport connects instances of armnetwork.ConnectionPoliciesClient to instances of ConnectionPoliciesServer. +// Don't use this type directly, use NewConnectionPoliciesServerTransport instead. +type ConnectionPoliciesServerTransport struct { + srv *ConnectionPoliciesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ConnectionPoliciesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armnetwork.ConnectionPoliciesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.ConnectionPoliciesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ConnectionPoliciesServerTransport. +func (c *ConnectionPoliciesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *ConnectionPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result, 1) + go func() { + var intercepted bool + var res result + if connectionPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectionPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectionPoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConnectionPoliciesClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ConnectionPoliciesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectionPoliciesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + resultChan <- res + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (c *ConnectionPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualHubs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.ConnectionPolicy](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + virtualHubNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualHubName")]) + if err != nil { + return nil, err + } + connectionPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, virtualHubNameParam, connectionPolicyNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (c *ConnectionPoliciesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualHubs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + virtualHubNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualHubName")]) + if err != nil { + return nil, err + } + connectionPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, virtualHubNameParam, connectionPolicyNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ConnectionPoliciesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualHubs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + virtualHubNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualHubName")]) + if err != nil { + return nil, err + } + connectionPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, virtualHubNameParam, connectionPolicyNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionPolicy, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ConnectionPoliciesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualHubs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionPolicies` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + virtualHubNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualHubName")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListPager(resourceGroupNameParam, virtualHubNameParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.ConnectionPoliciesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to ConnectionPoliciesServerTransport +var connectionPoliciesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go index f8c92716f754..f9a83d99ff77 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (c *ConnectivityConfigurationsServerTransport) Do(req *http.Request) (*http } func (c *ConnectivityConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchToMethodFake(req *ht } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchCreateOrUpdate(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectivityConfiguration, req) @@ -174,11 +169,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchBeginDelete(req *htt if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -201,7 +192,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -239,7 +230,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchGet(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectivityConfiguration, req) @@ -270,11 +261,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -284,11 +271,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ConnectivityConfigurationsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ConnectivityConfigurationsClientListOptions{ @@ -307,7 +290,7 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go index f7a47a02f179..cc2be3c3a89d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // CustomIPPrefixesServer is a fake server for instances of the armnetwork.CustomIPPrefixesClient type. @@ -81,9 +81,7 @@ func (c *CustomIPPrefixesServerTransport) Do(req *http.Request) (*http.Response, } func (c *CustomIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchBeginCreateOrUpdate(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { c.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchGet(req *http.Request) (*http. if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.CustomIPPrefixesClientGetOptions if expandParam != nil { options = &armnetwork.CustomIPPrefixesClientGetOptions{ @@ -250,7 +241,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CustomIPPrefix, req) @@ -287,7 +278,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchNewListAllPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { c.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (c *CustomIPPrefixesServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CustomIPPrefix, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go index eae5dbbd9296..e005bb790419 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,12 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // DdosCustomPoliciesServer is a fake server for instances of the armnetwork.DdosCustomPoliciesClient type. @@ -32,6 +33,14 @@ type DdosCustomPoliciesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *armnetwork.DdosCustomPoliciesClientGetOptions) (resp azfake.Responder[armnetwork.DdosCustomPoliciesClientGetResponse], errResp azfake.ErrorResponder) + // NewListPager is the fake for method DdosCustomPoliciesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armnetwork.DdosCustomPoliciesClientListOptions) (resp azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListResponse]) + + // NewListAllPager is the fake for method DdosCustomPoliciesClient.NewListAllPager + // HTTP status codes to indicate success: http.StatusOK + NewListAllPager func(options *armnetwork.DdosCustomPoliciesClientListAllOptions) (resp azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListAllResponse]) + // UpdateTags is the fake for method DdosCustomPoliciesClient.UpdateTags // HTTP status codes to indicate success: http.StatusOK UpdateTags func(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters armnetwork.TagsObject, options *armnetwork.DdosCustomPoliciesClientUpdateTagsOptions) (resp azfake.Responder[armnetwork.DdosCustomPoliciesClientUpdateTagsResponse], errResp azfake.ErrorResponder) @@ -45,6 +54,8 @@ func NewDdosCustomPoliciesServerTransport(srv *DdosCustomPoliciesServer) *DdosCu srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.DdosCustomPoliciesClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armnetwork.DdosCustomPoliciesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListAllResponse]](), } } @@ -54,6 +65,8 @@ type DdosCustomPoliciesServerTransport struct { srv *DdosCustomPoliciesServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.DdosCustomPoliciesClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armnetwork.DdosCustomPoliciesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armnetwork.DdosCustomPoliciesClientListAllResponse]] } // Do implements the policy.Transporter interface for DdosCustomPoliciesServerTransport. @@ -68,9 +81,7 @@ func (d *DdosCustomPoliciesServerTransport) Do(req *http.Request) (*http.Respons } func (d *DdosCustomPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -85,6 +96,10 @@ func (d *DdosCustomPoliciesServerTransport) dispatchToMethodFake(req *http.Reque res.resp, res.err = d.dispatchBeginDelete(req) case "DdosCustomPoliciesClient.Get": res.resp, res.err = d.dispatchGet(req) + case "DdosCustomPoliciesClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DdosCustomPoliciesClient.NewListAllPager": + res.resp, res.err = d.dispatchNewListAllPager(req) case "DdosCustomPoliciesClient.UpdateTags": res.resp, res.err = d.dispatchUpdateTags(req) default: @@ -92,10 +107,7 @@ func (d *DdosCustomPoliciesServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -143,7 +155,7 @@ func (d *DdosCustomPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -187,7 +199,7 @@ func (d *DdosCustomPoliciesServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -221,7 +233,7 @@ func (d *DdosCustomPoliciesServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DdosCustomPolicy, req) @@ -231,6 +243,76 @@ func (d *DdosCustomPoliciesServerTransport) dispatchGet(req *http.Request) (*htt return resp, nil } +func (d *DdosCustomPoliciesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/ddosCustomPolicies` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := d.srv.NewListPager(resourceGroupNameParam, nil) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.DdosCustomPoliciesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} + +func (d *DdosCustomPoliciesServerTransport) dispatchNewListAllPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListAllPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} + } + newListAllPager := d.newListAllPager.get(req) + if newListAllPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/ddosCustomPolicies` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := d.srv.NewListAllPager(nil) + newListAllPager = &resp + d.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armnetwork.DdosCustomPoliciesClientListAllResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListAllPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListAllPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListAllPager) { + d.newListAllPager.remove(req) + } + return resp, nil +} + func (d *DdosCustomPoliciesServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { if d.srv.UpdateTags == nil { return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} @@ -258,7 +340,7 @@ func (d *DdosCustomPoliciesServerTransport) dispatchUpdateTags(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DdosCustomPolicy, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go index 138633ea33d5..37c2f30900a5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // DdosProtectionPlansServer is a fake server for instances of the armnetwork.DdosProtectionPlansClient type. @@ -81,9 +81,7 @@ func (d *DdosProtectionPlansServerTransport) Do(req *http.Request) (*http.Respon } func (d *DdosProtectionPlansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchToMethodFake(req *http.Requ } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchBeginCreateOrUpdate(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchGet(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DdosProtectionPlan, req) @@ -271,7 +266,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchNewListPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchNewListByResourceGroupPager if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (d *DdosProtectionPlansServerTransport) dispatchUpdateTags(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DdosProtectionPlan, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go index 97211ba97b86..345e5b2fd9b5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // DefaultSecurityRulesServer is a fake server for instances of the armnetwork.DefaultSecurityRulesClient type. @@ -59,9 +59,7 @@ func (d *DefaultSecurityRulesServerTransport) Do(req *http.Request) (*http.Respo } func (d *DefaultSecurityRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (d *DefaultSecurityRulesServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (d *DefaultSecurityRulesServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityRule, req) @@ -161,7 +156,7 @@ func (d *DefaultSecurityRulesServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go index 1b55a173ef87..1b44c322a86a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // DscpConfigurationServer is a fake server for instances of the armnetwork.DscpConfigurationClient type. @@ -77,9 +77,7 @@ func (d *DscpConfigurationServerTransport) Do(req *http.Request) (*http.Response } func (d *DscpConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -103,10 +101,7 @@ func (d *DscpConfigurationServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -154,7 +149,7 @@ func (d *DscpConfigurationServerTransport) dispatchBeginCreateOrUpdate(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (d *DscpConfigurationServerTransport) dispatchBeginDelete(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -232,7 +227,7 @@ func (d *DscpConfigurationServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DscpConfiguration, req) @@ -269,7 +264,7 @@ func (d *DscpConfigurationServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -302,7 +297,7 @@ func (d *DscpConfigurationServerTransport) dispatchNewListAllPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { d.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go index bac722e836d1..8287083aee94 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteCircuitAuthorizationsServer is a fake server for instances of the armnetwork.ExpressRouteCircuitAuthorizationsClient type. @@ -71,9 +71,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) Do(req *http.Request) } func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchToMethodFake( } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchBeginCreateOr return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchBeginDelete(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchGet(req *http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuitAuthorization, req) @@ -277,7 +272,7 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchNewListPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go index 6b00263049c3..6b4bd7d14218 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteCircuitConnectionsServer is a fake server for instances of the armnetwork.ExpressRouteCircuitConnectionsClient type. @@ -71,9 +71,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) Do(req *http.Request) (* } func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -154,7 +149,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchBeginCreateOrUpd return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -206,7 +201,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchBeginDelete(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -248,7 +243,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchGet(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuitConnection, req) @@ -293,7 +288,7 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go index eb66134a8580..6798119f7f24 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteCircuitPeeringsServer is a fake server for instances of the armnetwork.ExpressRouteCircuitPeeringsClient type. @@ -71,9 +71,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) Do(req *http.Request) (*htt } func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchToMethodFake(req *h } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchBeginCreateOrUpdate return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchBeginDelete(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchGet(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuitPeering, req) @@ -277,7 +272,7 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go index 4adb0b7a6d42..b03528f5c4b6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" + "strconv" ) // ExpressRouteCircuitsServer is a fake server for instances of the armnetwork.ExpressRouteCircuitsClient type. @@ -33,6 +34,14 @@ type ExpressRouteCircuitsServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, circuitName string, options *armnetwork.ExpressRouteCircuitsClientGetOptions) (resp azfake.Responder[armnetwork.ExpressRouteCircuitsClientGetResponse], errResp azfake.ErrorResponder) + // BeginGetCircuitLinkFailoverAllTestsDetails is the fake for method ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetCircuitLinkFailoverAllTestsDetails func(ctx context.Context, resourceGroupName string, circuitName string, options *armnetwork.ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse], errResp azfake.ErrorResponder) + + // BeginGetCircuitLinkFailoverSingleTestDetails is the fake for method ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetCircuitLinkFailoverSingleTestDetails func(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, failoverTestID string, options *armnetwork.ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse], errResp azfake.ErrorResponder) + // GetPeeringStats is the fake for method ExpressRouteCircuitsClient.GetPeeringStats // HTTP status codes to indicate success: http.StatusOK GetPeeringStats func(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *armnetwork.ExpressRouteCircuitsClientGetPeeringStatsOptions) (resp azfake.Responder[armnetwork.ExpressRouteCircuitsClientGetPeeringStatsResponse], errResp azfake.ErrorResponder) @@ -61,6 +70,14 @@ type ExpressRouteCircuitsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginListRoutesTableSummary func(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *armnetwork.ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse], errResp azfake.ErrorResponder) + // BeginStartCircuitLinkFailoverTest is the fake for method ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStartCircuitLinkFailoverTest func(ctx context.Context, resourceGroupName string, circuitName string, linkType string, circuitTestCategory string, options *armnetwork.ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse], errResp azfake.ErrorResponder) + + // BeginStopCircuitLinkFailoverTest is the fake for method ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStopCircuitLinkFailoverTest func(ctx context.Context, resourceGroupName string, circuitName string, stopParameters armnetwork.ExpressRouteLinkFailoverStopAPIParameters, options *armnetwork.ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse], errResp azfake.ErrorResponder) + // UpdateTags is the fake for method ExpressRouteCircuitsClient.UpdateTags // HTTP status codes to indicate success: http.StatusOK UpdateTags func(ctx context.Context, resourceGroupName string, circuitName string, parameters armnetwork.TagsObject, options *armnetwork.ExpressRouteCircuitsClientUpdateTagsOptions) (resp azfake.Responder[armnetwork.ExpressRouteCircuitsClientUpdateTagsResponse], errResp azfake.ErrorResponder) @@ -71,28 +88,36 @@ type ExpressRouteCircuitsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewExpressRouteCircuitsServerTransport(srv *ExpressRouteCircuitsServer) *ExpressRouteCircuitsServerTransport { return &ExpressRouteCircuitsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListResponse]](), - newListAllPager: newTracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListAllResponse]](), - beginListArpTable: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListArpTableResponse]](), - beginListRoutesTable: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableResponse]](), - beginListRoutesTableSummary: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientDeleteResponse]](), + beginGetCircuitLinkFailoverAllTestsDetails: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse]](), + beginGetCircuitLinkFailoverSingleTestDetails: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListAllResponse]](), + beginListArpTable: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListArpTableResponse]](), + beginListRoutesTable: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableResponse]](), + beginListRoutesTableSummary: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse]](), + beginStartCircuitLinkFailoverTest: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse]](), + beginStopCircuitLinkFailoverTest: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse]](), } } // ExpressRouteCircuitsServerTransport connects instances of armnetwork.ExpressRouteCircuitsClient to instances of ExpressRouteCircuitsServer. // Don't use this type directly, use NewExpressRouteCircuitsServerTransport instead. type ExpressRouteCircuitsServerTransport struct { - srv *ExpressRouteCircuitsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListResponse]] - newListAllPager *tracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListAllResponse]] - beginListArpTable *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListArpTableResponse]] - beginListRoutesTable *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableResponse]] - beginListRoutesTableSummary *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse]] + srv *ExpressRouteCircuitsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientDeleteResponse]] + beginGetCircuitLinkFailoverAllTestsDetails *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse]] + beginGetCircuitLinkFailoverSingleTestDetails *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armnetwork.ExpressRouteCircuitsClientListAllResponse]] + beginListArpTable *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListArpTableResponse]] + beginListRoutesTable *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableResponse]] + beginListRoutesTableSummary *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientListRoutesTableSummaryResponse]] + beginStartCircuitLinkFailoverTest *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse]] + beginStopCircuitLinkFailoverTest *tracker[azfake.PollerResponder[armnetwork.ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse]] } // Do implements the policy.Transporter interface for ExpressRouteCircuitsServerTransport. @@ -107,9 +132,7 @@ func (e *ExpressRouteCircuitsServerTransport) Do(req *http.Request) (*http.Respo } func (e *ExpressRouteCircuitsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -124,6 +147,10 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchToMethodFake(req *http.Req res.resp, res.err = e.dispatchBeginDelete(req) case "ExpressRouteCircuitsClient.Get": res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails": + res.resp, res.err = e.dispatchBeginGetCircuitLinkFailoverAllTestsDetails(req) + case "ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails": + res.resp, res.err = e.dispatchBeginGetCircuitLinkFailoverSingleTestDetails(req) case "ExpressRouteCircuitsClient.GetPeeringStats": res.resp, res.err = e.dispatchGetPeeringStats(req) case "ExpressRouteCircuitsClient.GetStats": @@ -138,6 +165,10 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchToMethodFake(req *http.Req res.resp, res.err = e.dispatchBeginListRoutesTable(req) case "ExpressRouteCircuitsClient.BeginListRoutesTableSummary": res.resp, res.err = e.dispatchBeginListRoutesTableSummary(req) + case "ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest": + res.resp, res.err = e.dispatchBeginStartCircuitLinkFailoverTest(req) + case "ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest": + res.resp, res.err = e.dispatchBeginStopCircuitLinkFailoverTest(req) case "ExpressRouteCircuitsClient.UpdateTags": res.resp, res.err = e.dispatchUpdateTags(req) default: @@ -145,10 +176,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -196,7 +224,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginCreateOrUpdate(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -240,7 +268,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -274,7 +302,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuit, req) @@ -284,6 +312,108 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchGet(req *http.Request) (*h return resp, nil } +func (e *ExpressRouteCircuitsServerTransport) dispatchBeginGetCircuitLinkFailoverAllTestsDetails(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetCircuitLinkFailoverAllTestsDetails == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetCircuitLinkFailoverAllTestsDetails not implemented")} + } + beginGetCircuitLinkFailoverAllTestsDetails := e.beginGetCircuitLinkFailoverAllTestsDetails.get(req) + if beginGetCircuitLinkFailoverAllTestsDetails == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteCircuits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getCircuitLinkFailoverAllTestsDetails` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + circuitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("circuitName")]) + if err != nil { + return nil, err + } + failoverTestTypeParam := getOptional(qp.Get("failoverTestType")) + fetchLatestParam, err := parseOptional(qp.Get("fetchLatest"), strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armnetwork.ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions + if failoverTestTypeParam != nil || fetchLatestParam != nil { + options = &armnetwork.ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions{ + FailoverTestType: failoverTestTypeParam, + FetchLatest: fetchLatestParam, + } + } + respr, errRespr := e.srv.BeginGetCircuitLinkFailoverAllTestsDetails(req.Context(), resourceGroupNameParam, circuitNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetCircuitLinkFailoverAllTestsDetails = &respr + e.beginGetCircuitLinkFailoverAllTestsDetails.add(req, beginGetCircuitLinkFailoverAllTestsDetails) + } + + resp, err := server.PollerResponderNext(beginGetCircuitLinkFailoverAllTestsDetails, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetCircuitLinkFailoverAllTestsDetails.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetCircuitLinkFailoverAllTestsDetails) { + e.beginGetCircuitLinkFailoverAllTestsDetails.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteCircuitsServerTransport) dispatchBeginGetCircuitLinkFailoverSingleTestDetails(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetCircuitLinkFailoverSingleTestDetails == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetCircuitLinkFailoverSingleTestDetails not implemented")} + } + beginGetCircuitLinkFailoverSingleTestDetails := e.beginGetCircuitLinkFailoverSingleTestDetails.get(req) + if beginGetCircuitLinkFailoverSingleTestDetails == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteCircuits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getCircuitLinkFailoverSingleTestDetails` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + circuitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("circuitName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginGetCircuitLinkFailoverSingleTestDetails(req.Context(), resourceGroupNameParam, circuitNameParam, qp.Get("linkType"), qp.Get("circuitTestCategory"), qp.Get("failoverTestId"), nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetCircuitLinkFailoverSingleTestDetails = &respr + e.beginGetCircuitLinkFailoverSingleTestDetails.add(req, beginGetCircuitLinkFailoverSingleTestDetails) + } + + resp, err := server.PollerResponderNext(beginGetCircuitLinkFailoverSingleTestDetails, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetCircuitLinkFailoverSingleTestDetails.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetCircuitLinkFailoverSingleTestDetails) { + e.beginGetCircuitLinkFailoverSingleTestDetails.remove(req) + } + + return resp, nil +} + func (e *ExpressRouteCircuitsServerTransport) dispatchGetPeeringStats(req *http.Request) (*http.Response, error) { if e.srv.GetPeeringStats == nil { return nil, &nonRetriableError{errors.New("fake for method GetPeeringStats not implemented")} @@ -311,7 +441,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchGetPeeringStats(req *http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuitStats, req) @@ -344,7 +474,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchGetStats(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuitStats, req) @@ -381,7 +511,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -414,7 +544,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchNewListAllPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -465,7 +595,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginListArpTable(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListArpTable.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -517,7 +647,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginListRoutesTable(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListRoutesTable.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -569,7 +699,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginListRoutesTableSummar return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListRoutesTableSummary.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -580,6 +710,99 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchBeginListRoutesTableSummar return resp, nil } +func (e *ExpressRouteCircuitsServerTransport) dispatchBeginStartCircuitLinkFailoverTest(req *http.Request) (*http.Response, error) { + if e.srv.BeginStartCircuitLinkFailoverTest == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartCircuitLinkFailoverTest not implemented")} + } + beginStartCircuitLinkFailoverTest := e.beginStartCircuitLinkFailoverTest.get(req) + if beginStartCircuitLinkFailoverTest == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteCircuits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startCircuitLinkFailoverTest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + circuitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("circuitName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginStartCircuitLinkFailoverTest(req.Context(), resourceGroupNameParam, circuitNameParam, qp.Get("linkType"), qp.Get("circuitTestCategory"), nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartCircuitLinkFailoverTest = &respr + e.beginStartCircuitLinkFailoverTest.add(req, beginStartCircuitLinkFailoverTest) + } + + resp, err := server.PollerResponderNext(beginStartCircuitLinkFailoverTest, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginStartCircuitLinkFailoverTest.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartCircuitLinkFailoverTest) { + e.beginStartCircuitLinkFailoverTest.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteCircuitsServerTransport) dispatchBeginStopCircuitLinkFailoverTest(req *http.Request) (*http.Response, error) { + if e.srv.BeginStopCircuitLinkFailoverTest == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStopCircuitLinkFailoverTest not implemented")} + } + beginStopCircuitLinkFailoverTest := e.beginStopCircuitLinkFailoverTest.get(req) + if beginStopCircuitLinkFailoverTest == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteCircuits/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopCircuitLinkFailoverTest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.ExpressRouteLinkFailoverStopAPIParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + circuitNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("circuitName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginStopCircuitLinkFailoverTest(req.Context(), resourceGroupNameParam, circuitNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStopCircuitLinkFailoverTest = &respr + e.beginStopCircuitLinkFailoverTest.add(req, beginStopCircuitLinkFailoverTest) + } + + resp, err := server.PollerResponderNext(beginStopCircuitLinkFailoverTest, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginStopCircuitLinkFailoverTest.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStopCircuitLinkFailoverTest) { + e.beginStopCircuitLinkFailoverTest.remove(req) + } + + return resp, nil +} + func (e *ExpressRouteCircuitsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { if e.srv.UpdateTags == nil { return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} @@ -607,7 +830,7 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchUpdateTags(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCircuit, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go index 54a636611d87..29e0f19acc4e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteConnectionsServer is a fake server for instances of the armnetwork.ExpressRouteConnectionsClient type. @@ -68,9 +68,7 @@ func (e *ExpressRouteConnectionsServerTransport) Do(req *http.Request) (*http.Re } func (e *ExpressRouteConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -147,7 +142,7 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -195,7 +190,7 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -233,7 +228,7 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteConnection, req) @@ -266,7 +261,7 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchList(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteConnectionList, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go index 58d133596a51..a6e3a020ffc1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteCrossConnectionPeeringsServer is a fake server for instances of the armnetwork.ExpressRouteCrossConnectionPeeringsClient type. @@ -71,9 +71,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) Do(req *http.Reques } func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchToMethodFak } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchBeginCreate return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchBeginDelete return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchGet(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCrossConnectionPeering, req) @@ -277,7 +272,7 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchNewListPage if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go index aaead6cde631..a48440ffda85 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteCrossConnectionsServer is a fake server for instances of the armnetwork.ExpressRouteCrossConnectionsClient type. @@ -93,9 +93,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) Do(req *http.Request) (*ht } func (e *ExpressRouteCrossConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -125,10 +123,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -176,7 +171,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchBeginCreateOrUpdat return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -210,7 +205,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchGet(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCrossConnection, req) @@ -233,11 +228,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchNewListPager(req * return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) + filterParam := getOptional(qp.Get("$filter")) var options *armnetwork.ExpressRouteCrossConnectionsClientListOptions if filterParam != nil { options = &armnetwork.ExpressRouteCrossConnectionsClientListOptions{ @@ -255,7 +246,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -306,7 +297,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchBeginListArpTable( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListArpTable.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -344,7 +335,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchNewListByResourceG if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -395,7 +386,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchBeginListRoutesTab return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListRoutesTable.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -447,7 +438,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchBeginListRoutesTab return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginListRoutesTableSummary.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -485,7 +476,7 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchUpdateTags(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteCrossConnection, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go index e0d2f4c3b166..6936db009e7f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,12 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" + "strconv" ) // ExpressRouteGatewaysServer is a fake server for instances of the armnetwork.ExpressRouteGatewaysClient type. @@ -32,6 +33,22 @@ type ExpressRouteGatewaysServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *armnetwork.ExpressRouteGatewaysClientGetOptions) (resp azfake.Responder[armnetwork.ExpressRouteGatewaysClientGetResponse], errResp azfake.ErrorResponder) + // BeginGetFailoverAllTestsDetails is the fake for method ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetFailoverAllTestsDetails func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *armnetwork.ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse], errResp azfake.ErrorResponder) + + // BeginGetFailoverSingleTestDetails is the fake for method ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetFailoverSingleTestDetails func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, failoverTestID string, options *armnetwork.ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse], errResp azfake.ErrorResponder) + + // BeginGetResiliencyInformation is the fake for method ExpressRouteGatewaysClient.BeginGetResiliencyInformation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetResiliencyInformation func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *armnetwork.ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetResiliencyInformationResponse], errResp azfake.ErrorResponder) + + // BeginGetRoutesInformation is the fake for method ExpressRouteGatewaysClient.BeginGetRoutesInformation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetRoutesInformation func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *armnetwork.ExpressRouteGatewaysClientBeginGetRoutesInformationOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetRoutesInformationResponse], errResp azfake.ErrorResponder) + // ListByResourceGroup is the fake for method ExpressRouteGatewaysClient.ListByResourceGroup // HTTP status codes to indicate success: http.StatusOK ListByResourceGroup func(ctx context.Context, resourceGroupName string, options *armnetwork.ExpressRouteGatewaysClientListByResourceGroupOptions) (resp azfake.Responder[armnetwork.ExpressRouteGatewaysClientListByResourceGroupResponse], errResp azfake.ErrorResponder) @@ -40,6 +57,14 @@ type ExpressRouteGatewaysServer struct { // HTTP status codes to indicate success: http.StatusOK ListBySubscription func(ctx context.Context, options *armnetwork.ExpressRouteGatewaysClientListBySubscriptionOptions) (resp azfake.Responder[armnetwork.ExpressRouteGatewaysClientListBySubscriptionResponse], errResp azfake.ErrorResponder) + // BeginStartSiteFailoverTest is the fake for method ExpressRouteGatewaysClient.BeginStartSiteFailoverTest + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStartSiteFailoverTest func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, peeringLocation string, options *armnetwork.ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStartSiteFailoverTestResponse], errResp azfake.ErrorResponder) + + // BeginStopSiteFailoverTest is the fake for method ExpressRouteGatewaysClient.BeginStopSiteFailoverTest + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStopSiteFailoverTest func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, stopParameters armnetwork.ExpressRouteFailoverStopAPIParameters, options *armnetwork.ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStopSiteFailoverTestResponse], errResp azfake.ErrorResponder) + // BeginUpdateTags is the fake for method ExpressRouteGatewaysClient.BeginUpdateTags // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdateTags func(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters armnetwork.TagsObject, options *armnetwork.ExpressRouteGatewaysClientBeginUpdateTagsOptions) (resp azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse], errResp azfake.ErrorResponder) @@ -50,20 +75,32 @@ type ExpressRouteGatewaysServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewExpressRouteGatewaysServerTransport(srv *ExpressRouteGatewaysServer) *ExpressRouteGatewaysServerTransport { return &ExpressRouteGatewaysServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientDeleteResponse]](), - beginUpdateTags: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientDeleteResponse]](), + beginGetFailoverAllTestsDetails: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse]](), + beginGetFailoverSingleTestDetails: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse]](), + beginGetResiliencyInformation: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetResiliencyInformationResponse]](), + beginGetRoutesInformation: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetRoutesInformationResponse]](), + beginStartSiteFailoverTest: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStartSiteFailoverTestResponse]](), + beginStopSiteFailoverTest: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStopSiteFailoverTestResponse]](), + beginUpdateTags: newTracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse]](), } } // ExpressRouteGatewaysServerTransport connects instances of armnetwork.ExpressRouteGatewaysClient to instances of ExpressRouteGatewaysServer. // Don't use this type directly, use NewExpressRouteGatewaysServerTransport instead. type ExpressRouteGatewaysServerTransport struct { - srv *ExpressRouteGatewaysServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientDeleteResponse]] - beginUpdateTags *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse]] + srv *ExpressRouteGatewaysServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientDeleteResponse]] + beginGetFailoverAllTestsDetails *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse]] + beginGetFailoverSingleTestDetails *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse]] + beginGetResiliencyInformation *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetResiliencyInformationResponse]] + beginGetRoutesInformation *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientGetRoutesInformationResponse]] + beginStartSiteFailoverTest *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStartSiteFailoverTestResponse]] + beginStopSiteFailoverTest *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientStopSiteFailoverTestResponse]] + beginUpdateTags *tracker[azfake.PollerResponder[armnetwork.ExpressRouteGatewaysClientUpdateTagsResponse]] } // Do implements the policy.Transporter interface for ExpressRouteGatewaysServerTransport. @@ -78,9 +115,7 @@ func (e *ExpressRouteGatewaysServerTransport) Do(req *http.Request) (*http.Respo } func (e *ExpressRouteGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +130,22 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchToMethodFake(req *http.Req res.resp, res.err = e.dispatchBeginDelete(req) case "ExpressRouteGatewaysClient.Get": res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails": + res.resp, res.err = e.dispatchBeginGetFailoverAllTestsDetails(req) + case "ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails": + res.resp, res.err = e.dispatchBeginGetFailoverSingleTestDetails(req) + case "ExpressRouteGatewaysClient.BeginGetResiliencyInformation": + res.resp, res.err = e.dispatchBeginGetResiliencyInformation(req) + case "ExpressRouteGatewaysClient.BeginGetRoutesInformation": + res.resp, res.err = e.dispatchBeginGetRoutesInformation(req) case "ExpressRouteGatewaysClient.ListByResourceGroup": res.resp, res.err = e.dispatchListByResourceGroup(req) case "ExpressRouteGatewaysClient.ListBySubscription": res.resp, res.err = e.dispatchListBySubscription(req) + case "ExpressRouteGatewaysClient.BeginStartSiteFailoverTest": + res.resp, res.err = e.dispatchBeginStartSiteFailoverTest(req) + case "ExpressRouteGatewaysClient.BeginStopSiteFailoverTest": + res.resp, res.err = e.dispatchBeginStopSiteFailoverTest(req) case "ExpressRouteGatewaysClient.BeginUpdateTags": res.resp, res.err = e.dispatchBeginUpdateTags(req) default: @@ -106,10 +153,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -157,7 +201,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -201,7 +245,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -235,7 +279,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteGateway, req) @@ -245,6 +289,218 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchGet(req *http.Request) (*h return resp, nil } +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginGetFailoverAllTestsDetails(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetFailoverAllTestsDetails == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetFailoverAllTestsDetails not implemented")} + } + beginGetFailoverAllTestsDetails := e.beginGetFailoverAllTestsDetails.get(req) + if beginGetFailoverAllTestsDetails == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFailoverAllTestsDetails` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + typeParam := getOptional(qp.Get("type")) + fetchLatestParam, err := parseOptional(qp.Get("fetchLatest"), strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armnetwork.ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions + if typeParam != nil || fetchLatestParam != nil { + options = &armnetwork.ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions{ + Type: typeParam, + FetchLatest: fetchLatestParam, + } + } + respr, errRespr := e.srv.BeginGetFailoverAllTestsDetails(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetFailoverAllTestsDetails = &respr + e.beginGetFailoverAllTestsDetails.add(req, beginGetFailoverAllTestsDetails) + } + + resp, err := server.PollerResponderNext(beginGetFailoverAllTestsDetails, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetFailoverAllTestsDetails.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetFailoverAllTestsDetails) { + e.beginGetFailoverAllTestsDetails.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginGetFailoverSingleTestDetails(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetFailoverSingleTestDetails == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetFailoverSingleTestDetails not implemented")} + } + beginGetFailoverSingleTestDetails := e.beginGetFailoverSingleTestDetails.get(req) + if beginGetFailoverSingleTestDetails == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFailoverSingleTestDetails` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginGetFailoverSingleTestDetails(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, qp.Get("peeringLocation"), qp.Get("failoverTestId"), nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetFailoverSingleTestDetails = &respr + e.beginGetFailoverSingleTestDetails.add(req, beginGetFailoverSingleTestDetails) + } + + resp, err := server.PollerResponderNext(beginGetFailoverSingleTestDetails, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetFailoverSingleTestDetails.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetFailoverSingleTestDetails) { + e.beginGetFailoverSingleTestDetails.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginGetResiliencyInformation(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetResiliencyInformation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetResiliencyInformation not implemented")} + } + beginGetResiliencyInformation := e.beginGetResiliencyInformation.get(req) + if beginGetResiliencyInformation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getResiliencyInformation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + attemptRefreshParam, err := parseOptional(qp.Get("attemptRefresh"), strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armnetwork.ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions + if attemptRefreshParam != nil { + options = &armnetwork.ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions{ + AttemptRefresh: attemptRefreshParam, + } + } + respr, errRespr := e.srv.BeginGetResiliencyInformation(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetResiliencyInformation = &respr + e.beginGetResiliencyInformation.add(req, beginGetResiliencyInformation) + } + + resp, err := server.PollerResponderNext(beginGetResiliencyInformation, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetResiliencyInformation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetResiliencyInformation) { + e.beginGetResiliencyInformation.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginGetRoutesInformation(req *http.Request) (*http.Response, error) { + if e.srv.BeginGetRoutesInformation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetRoutesInformation not implemented")} + } + beginGetRoutesInformation := e.beginGetRoutesInformation.get(req) + if beginGetRoutesInformation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getRoutesInformation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + attemptRefreshParam, err := parseOptional(qp.Get("attemptRefresh"), strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armnetwork.ExpressRouteGatewaysClientBeginGetRoutesInformationOptions + if attemptRefreshParam != nil { + options = &armnetwork.ExpressRouteGatewaysClientBeginGetRoutesInformationOptions{ + AttemptRefresh: attemptRefreshParam, + } + } + respr, errRespr := e.srv.BeginGetRoutesInformation(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetRoutesInformation = &respr + e.beginGetRoutesInformation.add(req, beginGetRoutesInformation) + } + + resp, err := server.PollerResponderNext(beginGetRoutesInformation, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginGetRoutesInformation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetRoutesInformation) { + e.beginGetRoutesInformation.remove(req) + } + + return resp, nil +} + func (e *ExpressRouteGatewaysServerTransport) dispatchListByResourceGroup(req *http.Request) (*http.Response, error) { if e.srv.ListByResourceGroup == nil { return nil, &nonRetriableError{errors.New("fake for method ListByResourceGroup not implemented")} @@ -264,7 +520,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchListByResourceGroup(req *h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteGatewayList, req) @@ -289,7 +545,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchListBySubscription(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteGatewayList, req) @@ -299,6 +555,99 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchListBySubscription(req *ht return resp, nil } +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginStartSiteFailoverTest(req *http.Request) (*http.Response, error) { + if e.srv.BeginStartSiteFailoverTest == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartSiteFailoverTest not implemented")} + } + beginStartSiteFailoverTest := e.beginStartSiteFailoverTest.get(req) + if beginStartSiteFailoverTest == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startSiteFailoverTest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginStartSiteFailoverTest(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, qp.Get("peeringLocation"), nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartSiteFailoverTest = &respr + e.beginStartSiteFailoverTest.add(req, beginStartSiteFailoverTest) + } + + resp, err := server.PollerResponderNext(beginStartSiteFailoverTest, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginStartSiteFailoverTest.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartSiteFailoverTest) { + e.beginStartSiteFailoverTest.remove(req) + } + + return resp, nil +} + +func (e *ExpressRouteGatewaysServerTransport) dispatchBeginStopSiteFailoverTest(req *http.Request) (*http.Response, error) { + if e.srv.BeginStopSiteFailoverTest == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStopSiteFailoverTest not implemented")} + } + beginStopSiteFailoverTest := e.beginStopSiteFailoverTest.get(req) + if beginStopSiteFailoverTest == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRouteGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopSiteFailoverTest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.ExpressRouteFailoverStopAPIParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + expressRouteGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("expressRouteGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginStopSiteFailoverTest(req.Context(), resourceGroupNameParam, expressRouteGatewayNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStopSiteFailoverTest = &respr + e.beginStopSiteFailoverTest.add(req, beginStopSiteFailoverTest) + } + + resp, err := server.PollerResponderNext(beginStopSiteFailoverTest, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginStopSiteFailoverTest.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStopSiteFailoverTest) { + e.beginStopSiteFailoverTest.remove(req) + } + + return resp, nil +} + func (e *ExpressRouteGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Request) (*http.Response, error) { if e.srv.BeginUpdateTags == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateTags not implemented")} @@ -336,7 +685,7 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchBeginUpdateTags(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { e.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go index d45b5c610d9e..604ab3118e1b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRouteLinksServer is a fake server for instances of the armnetwork.ExpressRouteLinksClient type. @@ -59,9 +59,7 @@ func (e *ExpressRouteLinksServerTransport) Do(req *http.Request) (*http.Response } func (e *ExpressRouteLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (e *ExpressRouteLinksServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (e *ExpressRouteLinksServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteLink, req) @@ -161,7 +156,7 @@ func (e *ExpressRouteLinksServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go index 991db99d64fd..7d13bb48d76e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRoutePortAuthorizationsServer is a fake server for instances of the armnetwork.ExpressRoutePortAuthorizationsClient type. @@ -71,9 +71,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) Do(req *http.Request) (* } func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchBeginCreateOrUpd return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchBeginDelete(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchGet(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRoutePortAuthorization, req) @@ -277,7 +272,7 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go index 6b835ecd94cd..14c5dd8de355 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRoutePortsServer is a fake server for instances of the armnetwork.ExpressRoutePortsClient type. @@ -85,9 +85,7 @@ func (e *ExpressRoutePortsServerTransport) Do(req *http.Request) (*http.Response } func (e *ExpressRoutePortsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -115,10 +113,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -166,7 +161,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchBeginCreateOrUpdate(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { e.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -210,7 +205,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchBeginDelete(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -225,7 +220,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchGenerateLOA(req *http.Request if e.srv.GenerateLOA == nil { return nil, &nonRetriableError{errors.New("fake for method GenerateLOA not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/expressRoutePorts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generateLoa` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/ExpressRoutePorts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generateLoa` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -248,7 +243,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchGenerateLOA(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GenerateExpressRoutePortsLOAResult, req) @@ -281,7 +276,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRoutePort, req) @@ -314,7 +309,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -351,7 +346,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchNewListByResourceGroupPager(r if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -388,7 +383,7 @@ func (e *ExpressRoutePortsServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRoutePort, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go index dab12f7ce34f..361b6b743b4f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ExpressRoutePortsLocationsServer is a fake server for instances of the armnetwork.ExpressRoutePortsLocationsClient type. @@ -59,9 +59,7 @@ func (e *ExpressRoutePortsLocationsServerTransport) Do(req *http.Request) (*http } func (e *ExpressRoutePortsLocationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (e *ExpressRoutePortsLocationsServerTransport) dispatchToMethodFake(req *ht } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -112,7 +107,7 @@ func (e *ExpressRoutePortsLocationsServerTransport) dispatchGet(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRoutePortsLocation, req) @@ -145,7 +140,7 @@ func (e *ExpressRoutePortsLocationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go index ec442f3bf005..5933f0e1b941 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,10 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" - "net/url" "regexp" + "slices" ) // ExpressRouteProviderPortsLocationServer is a fake server for instances of the armnetwork.ExpressRouteProviderPortsLocationClient type. @@ -50,9 +49,7 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) Do(req *http.Request) } func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +65,7 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchToMethodFake( } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -93,11 +87,7 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchList(req *htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) + filterParam := getOptional(qp.Get("$filter")) var options *armnetwork.ExpressRouteProviderPortsLocationClientListOptions if filterParam != nil { options = &armnetwork.ExpressRouteProviderPortsLocationClientListOptions{ @@ -109,7 +99,7 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchList(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteProviderPortListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go index 47991bd9242f..9eacdee9a9dd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,9 +11,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "regexp" + "slices" ) // ExpressRouteServiceProvidersServer is a fake server for instances of the armnetwork.ExpressRouteServiceProvidersClient type. @@ -53,9 +53,7 @@ func (e *ExpressRouteServiceProvidersServerTransport) Do(req *http.Request) (*ht } func (e *ExpressRouteServiceProvidersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -71,10 +69,7 @@ func (e *ExpressRouteServiceProvidersServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -108,7 +103,7 @@ func (e *ExpressRouteServiceProvidersServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go index f1e5c359cf27..4c01d0b963f9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPoliciesServer is a fake server for instances of the armnetwork.FirewallPoliciesClient type. @@ -81,9 +81,7 @@ func (f *FirewallPoliciesServerTransport) Do(req *http.Request) (*http.Response, } func (f *FirewallPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (f *FirewallPoliciesServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (f *FirewallPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { f.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (f *FirewallPoliciesServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (f *FirewallPoliciesServerTransport) dispatchGet(req *http.Request) (*http. if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.FirewallPoliciesClientGetOptions if expandParam != nil { options = &armnetwork.FirewallPoliciesClientGetOptions{ @@ -250,7 +241,7 @@ func (f *FirewallPoliciesServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicy, req) @@ -287,7 +278,7 @@ func (f *FirewallPoliciesServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { f.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (f *FirewallPoliciesServerTransport) dispatchNewListAllPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { f.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (f *FirewallPoliciesServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicy, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go index e8bd46bf4784..35f66b991102 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyDeploymentsServer is a fake server for instances of the armnetwork.FirewallPolicyDeploymentsClient type. @@ -54,9 +54,7 @@ func (f *FirewallPolicyDeploymentsServerTransport) Do(req *http.Request) (*http. } func (f *FirewallPolicyDeploymentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (f *FirewallPolicyDeploymentsServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -119,7 +114,7 @@ func (f *FirewallPolicyDeploymentsServerTransport) dispatchBeginDeploy(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDeploy.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go index e23edff506c5..6666f489b27d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyDraftsServer is a fake server for instances of the armnetwork.FirewallPolicyDraftsClient type. @@ -58,9 +58,7 @@ func (f *FirewallPolicyDraftsServerTransport) Do(req *http.Request) (*http.Respo } func (f *FirewallPolicyDraftsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -80,10 +78,7 @@ func (f *FirewallPolicyDraftsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -121,7 +116,7 @@ func (f *FirewallPolicyDraftsServerTransport) dispatchCreateOrUpdate(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicyDraft, req) @@ -154,7 +149,7 @@ func (f *FirewallPolicyDraftsServerTransport) dispatchDelete(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -187,7 +182,7 @@ func (f *FirewallPolicyDraftsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicyDraft, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go index 23aa3fdda9cb..f345ff1bf0c8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyIdpsSignaturesServer is a fake server for instances of the armnetwork.FirewallPolicyIdpsSignaturesClient type. @@ -50,9 +50,7 @@ func (f *FirewallPolicyIdpsSignaturesServerTransport) Do(req *http.Request) (*ht } func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -109,7 +104,7 @@ func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchList(req *http.Req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).QueryResults, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go index 3a59842c15ee..6da5bd8d67c8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyIdpsSignaturesFilterValuesServer is a fake server for instances of the armnetwork.FirewallPolicyIdpsSignaturesFilterValuesClient type. @@ -50,9 +50,7 @@ func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) Do(req *http.R } func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchToMeth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -109,7 +104,7 @@ func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchList(r return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SignatureOverridesFilterValuesResponse, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go index 51b2c1880a69..9c4237cb1561 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyIdpsSignaturesOverridesServer is a fake server for instances of the armnetwork.FirewallPolicyIdpsSignaturesOverridesClient type. @@ -62,9 +62,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) Do(req *http.Requ } func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -86,10 +84,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchToMethodF } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -123,7 +118,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchGet(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SignaturesOverrides, req) @@ -156,7 +151,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchList(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SignaturesOverridesList, req) @@ -193,7 +188,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchPatch(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SignaturesOverrides, req) @@ -230,7 +225,7 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchPut(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SignaturesOverrides, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go index 8513b9426c57..2a5653990234 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyRuleCollectionGroupDraftsServer is a fake server for instances of the armnetwork.FirewallPolicyRuleCollectionGroupDraftsClient type. @@ -58,9 +58,7 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) Do(req *http.Re } func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -80,10 +78,7 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchToMetho } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -125,7 +120,7 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchCreateO return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicyRuleCollectionGroupDraft, req) @@ -162,7 +157,7 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchDelete( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -199,7 +194,7 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchGet(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicyRuleCollectionGroupDraft, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go index 87241d7dce63..fc3376f0310d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FirewallPolicyRuleCollectionGroupsServer is a fake server for instances of the armnetwork.FirewallPolicyRuleCollectionGroupsClient type. @@ -71,9 +71,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) Do(req *http.Request } func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchToMethodFake } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchBeginCreateO return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { f.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchBeginDelete( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchGet(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FirewallPolicyRuleCollectionGroup, req) @@ -277,7 +272,7 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchNewListPager if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { f.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go index 793662e1d44b..a7c0970c28a8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // FlowLogsServer is a fake server for instances of the armnetwork.FlowLogsClient type. @@ -75,9 +75,7 @@ func (f *FlowLogsServerTransport) Do(req *http.Request) (*http.Response, error) } func (f *FlowLogsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -101,10 +99,7 @@ func (f *FlowLogsServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -156,7 +151,7 @@ func (f *FlowLogsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { f.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (f *FlowLogsServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -242,7 +237,7 @@ func (f *FlowLogsServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FlowLog, req) @@ -283,7 +278,7 @@ func (f *FlowLogsServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { f.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -324,7 +319,7 @@ func (f *FlowLogsServerTransport) dispatchUpdateTags(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FlowLog, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/groups_server.go b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go index f2e9232b5a07..41046eb81c7d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/groups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (g *GroupsServerTransport) Do(req *http.Request) (*http.Response, error) { } func (g *GroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (g *GroupsServerTransport) dispatchToMethodFake(req *http.Request, method s } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -146,7 +141,7 @@ func (g *GroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Group, req) @@ -184,11 +179,7 @@ func (g *GroupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -211,7 +202,7 @@ func (g *GroupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -249,7 +240,7 @@ func (g *GroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Group, req) @@ -280,11 +271,7 @@ func (g *GroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.R if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -294,11 +281,7 @@ func (g *GroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.R if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.GroupsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.GroupsClientListOptions{ @@ -317,7 +300,7 @@ func (g *GroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { g.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go index 05bf315e7608..8b2c80344051 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // HubRouteTablesServer is a fake server for instances of the armnetwork.HubRouteTablesClient type. @@ -71,9 +71,7 @@ func (h *HubRouteTablesServerTransport) Do(req *http.Request) (*http.Response, e } func (h *HubRouteTablesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (h *HubRouteTablesServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (h *HubRouteTablesServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { h.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (h *HubRouteTablesServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { h.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (h *HubRouteTablesServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).HubRouteTable, req) @@ -277,7 +272,7 @@ func (h *HubRouteTablesServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { h.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go index 785abf5cb36d..e5a6b0cade4c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // HubVirtualNetworkConnectionsServer is a fake server for instances of the armnetwork.HubVirtualNetworkConnectionsClient type. @@ -71,9 +71,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) Do(req *http.Request) (*ht } func (h *HubVirtualNetworkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchBeginCreateOrUpdat return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { h.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchBeginDelete(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { h.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchGet(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).HubVirtualNetworkConnection, req) @@ -277,7 +272,7 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { h.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go index 061fca89ab52..4b60ff1ecd25 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InboundNatRulesServer is a fake server for instances of the armnetwork.InboundNatRulesClient type. @@ -71,9 +71,7 @@ func (i *InboundNatRulesServerTransport) Do(req *http.Request) (*http.Response, } func (i *InboundNatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (i *InboundNatRulesServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (i *InboundNatRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (i *InboundNatRulesServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -232,11 +227,7 @@ func (i *InboundNatRulesServerTransport) dispatchGet(req *http.Request) (*http.R if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InboundNatRulesClientGetOptions if expandParam != nil { options = &armnetwork.InboundNatRulesClientGetOptions{ @@ -248,7 +239,7 @@ func (i *InboundNatRulesServerTransport) dispatchGet(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InboundNatRule, req) @@ -289,7 +280,7 @@ func (i *InboundNatRulesServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go index 69d1efd48976..b8f0a20d4823 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InboundSecurityRuleServer is a fake server for instances of the armnetwork.InboundSecurityRuleClient type. @@ -58,9 +58,7 @@ func (i *InboundSecurityRuleServerTransport) Do(req *http.Request) (*http.Respon } func (i *InboundSecurityRuleServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -78,10 +76,7 @@ func (i *InboundSecurityRuleServerTransport) dispatchToMethodFake(req *http.Requ } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -133,7 +128,7 @@ func (i *InboundSecurityRuleServerTransport) dispatchBeginCreateOrUpdate(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -171,7 +166,7 @@ func (i *InboundSecurityRuleServerTransport) dispatchGet(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InboundSecurityRule, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/interconnectgroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/interconnectgroups_server.go new file mode 100644 index 000000000000..952b7561b439 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/interconnectgroups_server.go @@ -0,0 +1,383 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "net/http" + "net/url" + "regexp" + "slices" +) + +// InterconnectGroupsServer is a fake server for instances of the armnetwork.InterconnectGroupsClient type. +type InterconnectGroupsServer struct { + // CreateOrUpdate is the fake for method InterconnectGroupsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters armnetwork.InterconnectGroup, options *armnetwork.InterconnectGroupsClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.InterconnectGroupsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method InterconnectGroupsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *armnetwork.InterconnectGroupsClientDeleteOptions) (resp azfake.Responder[armnetwork.InterconnectGroupsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method InterconnectGroupsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *armnetwork.InterconnectGroupsClientGetOptions) (resp azfake.Responder[armnetwork.InterconnectGroupsClientGetResponse], errResp azfake.ErrorResponder) + + // BeginGetNodeAvailability is the fake for method InterconnectGroupsClient.BeginGetNodeAvailability + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetNodeAvailability func(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *armnetwork.InterconnectGroupsClientBeginGetNodeAvailabilityOptions) (resp azfake.PollerResponder[armnetwork.InterconnectGroupsClientGetNodeAvailabilityResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method InterconnectGroupsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armnetwork.InterconnectGroupsClientListOptions) (resp azfake.PagerResponder[armnetwork.InterconnectGroupsClientListResponse]) + + // NewListAllPager is the fake for method InterconnectGroupsClient.NewListAllPager + // HTTP status codes to indicate success: http.StatusOK + NewListAllPager func(options *armnetwork.InterconnectGroupsClientListAllOptions) (resp azfake.PagerResponder[armnetwork.InterconnectGroupsClientListAllResponse]) + + // UpdateTags is the fake for method InterconnectGroupsClient.UpdateTags + // HTTP status codes to indicate success: http.StatusOK + UpdateTags func(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters armnetwork.TagsObject, options *armnetwork.InterconnectGroupsClientUpdateTagsOptions) (resp azfake.Responder[armnetwork.InterconnectGroupsClientUpdateTagsResponse], errResp azfake.ErrorResponder) +} + +// NewInterconnectGroupsServerTransport creates a new instance of InterconnectGroupsServerTransport with the provided implementation. +// The returned InterconnectGroupsServerTransport instance is connected to an instance of armnetwork.InterconnectGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewInterconnectGroupsServerTransport(srv *InterconnectGroupsServer) *InterconnectGroupsServerTransport { + return &InterconnectGroupsServerTransport{ + srv: srv, + beginGetNodeAvailability: newTracker[azfake.PollerResponder[armnetwork.InterconnectGroupsClientGetNodeAvailabilityResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.InterconnectGroupsClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armnetwork.InterconnectGroupsClientListAllResponse]](), + } +} + +// InterconnectGroupsServerTransport connects instances of armnetwork.InterconnectGroupsClient to instances of InterconnectGroupsServer. +// Don't use this type directly, use NewInterconnectGroupsServerTransport instead. +type InterconnectGroupsServerTransport struct { + srv *InterconnectGroupsServer + beginGetNodeAvailability *tracker[azfake.PollerResponder[armnetwork.InterconnectGroupsClientGetNodeAvailabilityResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.InterconnectGroupsClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armnetwork.InterconnectGroupsClientListAllResponse]] +} + +// Do implements the policy.Transporter interface for InterconnectGroupsServerTransport. +func (i *InterconnectGroupsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return i.dispatchToMethodFake(req, method) +} + +func (i *InterconnectGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result, 1) + go func() { + var intercepted bool + var res result + if interconnectGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = interconnectGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InterconnectGroupsClient.CreateOrUpdate": + res.resp, res.err = i.dispatchCreateOrUpdate(req) + case "InterconnectGroupsClient.Delete": + res.resp, res.err = i.dispatchDelete(req) + case "InterconnectGroupsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InterconnectGroupsClient.BeginGetNodeAvailability": + res.resp, res.err = i.dispatchBeginGetNodeAvailability(req) + case "InterconnectGroupsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + case "InterconnectGroupsClient.NewListAllPager": + res.resp, res.err = i.dispatchNewListAllPager(req) + case "InterconnectGroupsClient.UpdateTags": + res.resp, res.err = i.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + resultChan <- res + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (i *InterconnectGroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if i.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.InterconnectGroup](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterconnectGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if i.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Delete(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterconnectGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchBeginGetNodeAvailability(req *http.Request) (*http.Response, error) { + if i.srv.BeginGetNodeAvailability == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetNodeAvailability not implemented")} + } + beginGetNodeAvailability := i.beginGetNodeAvailability.get(req) + if beginGetNodeAvailability == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginGetNodeAvailability(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetNodeAvailability = &respr + i.beginGetNodeAvailability.add(req, beginGetNodeAvailability) + } + + resp, err := server.PollerResponderNext(beginGetNodeAvailability, req) + if err != nil { + return nil, err + } + + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + i.beginGetNodeAvailability.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetNodeAvailability) { + i.beginGetNodeAvailability.remove(req) + } + + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := i.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := i.srv.NewListPager(resourceGroupNameParam, nil) + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.InterconnectGroupsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) + } + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchNewListAllPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListAllPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} + } + newListAllPager := i.newListAllPager.get(req) + if newListAllPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := i.srv.NewListAllPager(nil) + newListAllPager = &resp + i.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armnetwork.InterconnectGroupsClientListAllResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListAllPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListAllPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListAllPager) { + i.newListAllPager.remove(req) + } + return resp, nil +} + +func (i *InterconnectGroupsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { + if i.srv.UpdateTags == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.TagsObject](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.UpdateTags(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterconnectGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to InterconnectGroupsServerTransport +var interconnectGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go index 41294cab0b37..95442f0a25d3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InterfaceIPConfigurationsServer is a fake server for instances of the armnetwork.InterfaceIPConfigurationsClient type. @@ -59,9 +59,7 @@ func (i *InterfaceIPConfigurationsServerTransport) Do(req *http.Request) (*http. } func (i *InterfaceIPConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (i *InterfaceIPConfigurationsServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (i *InterfaceIPConfigurationsServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterfaceIPConfiguration, req) @@ -161,7 +156,7 @@ func (i *InterfaceIPConfigurationsServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go index 2ea92f424f71..7ea6d61d6d77 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InterfaceLoadBalancersServer is a fake server for instances of the armnetwork.InterfaceLoadBalancersClient type. @@ -54,9 +54,7 @@ func (i *InterfaceLoadBalancersServerTransport) Do(req *http.Request) (*http.Res } func (i *InterfaceLoadBalancersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (i *InterfaceLoadBalancersServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -117,7 +112,7 @@ func (i *InterfaceLoadBalancersServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go index 5c26f222abd8..d52be7520350 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InterfacesServer is a fake server for instances of the armnetwork.InterfacesClient type. @@ -135,9 +135,7 @@ func (i *InterfacesServerTransport) Do(req *http.Request) (*http.Response, error } func (i *InterfacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -183,10 +181,7 @@ func (i *InterfacesServerTransport) dispatchToMethodFake(req *http.Request, meth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -234,7 +229,7 @@ func (i *InterfacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -278,7 +273,7 @@ func (i *InterfacesServerTransport) dispatchBeginDelete(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -308,11 +303,7 @@ func (i *InterfacesServerTransport) dispatchGet(req *http.Request) (*http.Respon if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InterfacesClientGetOptions if expandParam != nil { options = &armnetwork.InterfacesClientGetOptions{ @@ -324,7 +315,7 @@ func (i *InterfacesServerTransport) dispatchGet(req *http.Request) (*http.Respon return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) @@ -338,7 +329,7 @@ func (i *InterfacesServerTransport) dispatchGetCloudServiceNetworkInterface(req if i.srv.GetCloudServiceNetworkInterface == nil { return nil, &nonRetriableError{errors.New("fake for method GetCloudServiceNetworkInterface not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 6 { @@ -361,11 +352,7 @@ func (i *InterfacesServerTransport) dispatchGetCloudServiceNetworkInterface(req if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InterfacesClientGetCloudServiceNetworkInterfaceOptions if expandParam != nil { options = &armnetwork.InterfacesClientGetCloudServiceNetworkInterfaceOptions{ @@ -377,7 +364,7 @@ func (i *InterfacesServerTransport) dispatchGetCloudServiceNetworkInterface(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) @@ -420,7 +407,7 @@ func (i *InterfacesServerTransport) dispatchBeginGetEffectiveRouteTable(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { i.beginGetEffectiveRouteTable.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -435,7 +422,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetIPConfigura if i.srv.GetVirtualMachineScaleSetIPConfiguration == nil { return nil, &nonRetriableError{errors.New("fake for method GetVirtualMachineScaleSetIPConfiguration not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 7 { @@ -462,11 +449,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetIPConfigura if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions if expandParam != nil { options = &armnetwork.InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions{ @@ -478,7 +461,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetIPConfigura return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterfaceIPConfiguration, req) @@ -492,7 +475,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetNetworkInte if i.srv.GetVirtualMachineScaleSetNetworkInterface == nil { return nil, &nonRetriableError{errors.New("fake for method GetVirtualMachineScaleSetNetworkInterface not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 6 { @@ -515,11 +498,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetNetworkInte if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions if expandParam != nil { options = &armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions{ @@ -531,7 +510,7 @@ func (i *InterfacesServerTransport) dispatchGetVirtualMachineScaleSetNetworkInte return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) @@ -568,7 +547,7 @@ func (i *InterfacesServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -601,7 +580,7 @@ func (i *InterfacesServerTransport) dispatchNewListAllPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -617,7 +596,7 @@ func (i *InterfacesServerTransport) dispatchNewListCloudServiceNetworkInterfaces } newListCloudServiceNetworkInterfacesPager := i.newListCloudServiceNetworkInterfacesPager.get(req) if newListCloudServiceNetworkInterfacesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -642,7 +621,7 @@ func (i *InterfacesServerTransport) dispatchNewListCloudServiceNetworkInterfaces if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListCloudServiceNetworkInterfacesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -658,7 +637,7 @@ func (i *InterfacesServerTransport) dispatchNewListCloudServiceRoleInstanceNetwo } newListCloudServiceRoleInstanceNetworkInterfacesPager := i.newListCloudServiceRoleInstanceNetworkInterfacesPager.get(req) if newListCloudServiceRoleInstanceNetworkInterfacesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -687,7 +666,7 @@ func (i *InterfacesServerTransport) dispatchNewListCloudServiceRoleInstanceNetwo if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListCloudServiceRoleInstanceNetworkInterfacesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -730,7 +709,7 @@ func (i *InterfacesServerTransport) dispatchBeginListEffectiveNetworkSecurityGro return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { i.beginListEffectiveNetworkSecurityGroups.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -770,11 +749,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetIPConfi if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions if expandParam != nil { options = &armnetwork.InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions{ @@ -792,7 +767,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetIPConfi if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListVirtualMachineScaleSetIPConfigurationsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -808,7 +783,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetNetwork } newListVirtualMachineScaleSetNetworkInterfacesPager := i.newListVirtualMachineScaleSetNetworkInterfacesPager.get(req) if newListVirtualMachineScaleSetNetworkInterfacesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -833,7 +808,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetNetwork if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListVirtualMachineScaleSetNetworkInterfacesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -849,7 +824,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetVMNetwo } newListVirtualMachineScaleSetVMNetworkInterfacesPager := i.newListVirtualMachineScaleSetVMNetworkInterfacesPager.get(req) if newListVirtualMachineScaleSetVMNetworkInterfacesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -878,7 +853,7 @@ func (i *InterfacesServerTransport) dispatchNewListVirtualMachineScaleSetVMNetwo if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListVirtualMachineScaleSetVMNetworkInterfacesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -915,7 +890,7 @@ func (i *InterfacesServerTransport) dispatchUpdateTags(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go index 8b7ad1c3965e..d41a9c5b09ef 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // InterfaceTapConfigurationsServer is a fake server for instances of the armnetwork.InterfaceTapConfigurationsClient type. @@ -71,9 +71,7 @@ func (i *InterfaceTapConfigurationsServerTransport) Do(req *http.Request) (*http } func (i *InterfaceTapConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchToMethodFake(req *ht } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchBeginCreateOrUpdate( return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchGet(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InterfaceTapConfiguration, req) @@ -277,7 +272,7 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/internal.go b/sdk/resourcemanager/network/armnetwork/fake/internal.go index 6c584d9b9549..f09fd1b96bd8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/internal.go +++ b/sdk/resourcemanager/network/armnetwork/fake/internal.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -26,15 +25,6 @@ func (nonRetriableError) NonRetriable() { // marker method } -func contains[T comparable](s []T, v T) bool { - for _, vv := range s { - if vv == v { - return true - } - } - return false -} - func getHeaderValue(h http.Header, k string) string { v := h[k] if len(v) == 0 { @@ -50,6 +40,14 @@ func getOptional[T any](v T) *T { return &v } +func initServer[T any](mu *sync.Mutex, dst **T, src func() *T) { + mu.Lock() + if *dst == nil { + *dst = src() + } + mu.Unlock() +} + func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { if v == "" { return nil, nil @@ -58,7 +56,7 @@ func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) if err != nil { return nil, err } - return &t, err + return &t, nil } func readRequestBody(req *http.Request) ([]byte, error) { diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go index c0bc7be2fdd8..9aa619732c2f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // IPAllocationsServer is a fake server for instances of the armnetwork.IPAllocationsClient type. @@ -81,9 +81,7 @@ func (i *IPAllocationsServerTransport) Do(req *http.Request) (*http.Response, er } func (i *IPAllocationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (i *IPAllocationsServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (i *IPAllocationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (i *IPAllocationsServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (i *IPAllocationsServerTransport) dispatchGet(req *http.Request) (*http.Res if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.IPAllocationsClientGetOptions if expandParam != nil { options = &armnetwork.IPAllocationsClientGetOptions{ @@ -250,7 +241,7 @@ func (i *IPAllocationsServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IPAllocation, req) @@ -283,7 +274,7 @@ func (i *IPAllocationsServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (i *IPAllocationsServerTransport) dispatchNewListByResourceGroupPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (i *IPAllocationsServerTransport) dispatchUpdateTags(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IPAllocation, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go index 218e66ddb3f2..817b04163eed 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" - "reflect" "regexp" + "slices" "strconv" ) @@ -49,7 +48,7 @@ type IpamPoolsServer struct { // Update is the fake for method IpamPoolsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *armnetwork.IpamPoolsClientUpdateOptions) (resp azfake.Responder[armnetwork.IpamPoolsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body armnetwork.IpamPoolUpdate, options *armnetwork.IpamPoolsClientUpdateOptions) (resp azfake.Responder[armnetwork.IpamPoolsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewIpamPoolsServerTransport creates a new instance of IpamPoolsServerTransport with the provided implementation. @@ -87,9 +86,7 @@ func (i *IpamPoolsServerTransport) Do(req *http.Request) (*http.Response, error) } func (i *IpamPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -117,10 +114,7 @@ func (i *IpamPoolsServerTransport) dispatchToMethodFake(req *http.Request, metho } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -179,7 +173,7 @@ func (i *IpamPoolsServerTransport) dispatchBeginCreate(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -234,7 +228,7 @@ func (i *IpamPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -272,7 +266,7 @@ func (i *IpamPoolsServerTransport) dispatchGet(req *http.Request) (*http.Respons return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IpamPool, req) @@ -309,7 +303,7 @@ func (i *IpamPoolsServerTransport) dispatchGetPoolUsage(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PoolUsage, req) @@ -340,16 +334,8 @@ func (i *IpamPoolsServerTransport) dispatchNewListPager(req *http.Request) (*htt if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) - skipUnescaped, err := url.QueryUnescape(qp.Get("skip")) - if err != nil { - return nil, err - } - skipParam, err := parseOptional(skipUnescaped, func(v string) (int32, error) { + skipTokenParam := getOptional(qp.Get("skipToken")) + skipParam, err := parseOptional(qp.Get("skip"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -359,11 +345,7 @@ func (i *IpamPoolsServerTransport) dispatchNewListPager(req *http.Request) (*htt if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -373,16 +355,8 @@ func (i *IpamPoolsServerTransport) dispatchNewListPager(req *http.Request) (*htt if err != nil { return nil, err } - sortKeyUnescaped, err := url.QueryUnescape(qp.Get("sortKey")) - if err != nil { - return nil, err - } - sortKeyParam := getOptional(sortKeyUnescaped) - sortValueUnescaped, err := url.QueryUnescape(qp.Get("sortValue")) - if err != nil { - return nil, err - } - sortValueParam := getOptional(sortValueUnescaped) + sortKeyParam := getOptional(qp.Get("sortKey")) + sortValueParam := getOptional(qp.Get("sortValue")) var options *armnetwork.IpamPoolsClientListOptions if skipTokenParam != nil || skipParam != nil || topParam != nil || sortKeyParam != nil || sortValueParam != nil { options = &armnetwork.IpamPoolsClientListOptions{ @@ -404,7 +378,7 @@ func (i *IpamPoolsServerTransport) dispatchNewListPager(req *http.Request) (*htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -449,7 +423,7 @@ func (i *IpamPoolsServerTransport) dispatchNewListAssociatedResourcesPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListAssociatedResourcesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -487,18 +461,17 @@ func (i *IpamPoolsServerTransport) dispatchUpdate(req *http.Request) (*http.Resp } ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) var options *armnetwork.IpamPoolsClientUpdateOptions - if ifMatchParam != nil || !reflect.ValueOf(body).IsZero() { + if ifMatchParam != nil { options = &armnetwork.IpamPoolsClientUpdateOptions{ IfMatch: ifMatchParam, - Body: &body, } } - respr, errRespr := i.srv.Update(req.Context(), resourceGroupNameParam, networkManagerNameParam, poolNameParam, options) + respr, errRespr := i.srv.Update(req.Context(), resourceGroupNameParam, networkManagerNameParam, poolNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IpamPool, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go index 75d358c37604..f3684f084480 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // IPGroupsServer is a fake server for instances of the armnetwork.IPGroupsClient type. @@ -81,9 +81,7 @@ func (i *IPGroupsServerTransport) Do(req *http.Request) (*http.Response, error) } func (i *IPGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (i *IPGroupsServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (i *IPGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (i *IPGroupsServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (i *IPGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.IPGroupsClientGetOptions if expandParam != nil { options = &armnetwork.IPGroupsClientGetOptions{ @@ -250,7 +241,7 @@ func (i *IPGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IPGroup, req) @@ -283,7 +274,7 @@ func (i *IPGroupsServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (i *IPGroupsServerTransport) dispatchNewListByResourceGroupPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { i.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (i *IPGroupsServerTransport) dispatchUpdateGroups(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IPGroup, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go index cf4348be75b7..62911bebf958 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerBackendAddressPoolsServer is a fake server for instances of the armnetwork.LoadBalancerBackendAddressPoolsClient type. @@ -71,9 +71,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) Do(req *http.Request) ( } func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchToMethodFake(re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchBeginCreateOrUp return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { l.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchBeginDelete(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchGet(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackendAddressPool, req) @@ -277,7 +272,7 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchNewListPager(re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go index 861dbdd1aa2f..94a0f3ffe71a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerFrontendIPConfigurationsServer is a fake server for instances of the armnetwork.LoadBalancerFrontendIPConfigurationsClient type. @@ -59,9 +59,7 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) Do(req *http.Reque } func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchToMethodFa } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchGet(req *h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FrontendIPConfiguration, req) @@ -161,7 +156,7 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchNewListPag if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go index 65d62e87881a..9927fe5d5bc5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerLoadBalancingRulesServer is a fake server for instances of the armnetwork.LoadBalancerLoadBalancingRulesClient type. @@ -65,9 +65,7 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) Do(req *http.Request) (* } func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -87,10 +85,7 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -128,7 +123,7 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchGet(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LoadBalancingRule, req) @@ -175,7 +170,7 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchBeginHealth(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginHealth.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -217,7 +212,7 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go index 9688350f6be4..27f69ca43f59 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerNetworkInterfacesServer is a fake server for instances of the armnetwork.LoadBalancerNetworkInterfacesClient type. @@ -54,9 +54,7 @@ func (l *LoadBalancerNetworkInterfacesServerTransport) Do(req *http.Request) (*h } func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -117,7 +112,7 @@ func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go index 01a9362554b3..328204d334ae 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerOutboundRulesServer is a fake server for instances of the armnetwork.LoadBalancerOutboundRulesClient type. @@ -59,9 +59,7 @@ func (l *LoadBalancerOutboundRulesServerTransport) Do(req *http.Request) (*http. } func (l *LoadBalancerOutboundRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (l *LoadBalancerOutboundRulesServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (l *LoadBalancerOutboundRulesServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OutboundRule, req) @@ -161,7 +156,7 @@ func (l *LoadBalancerOutboundRulesServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go index 931bf37c016c..e6c577a540a8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LoadBalancerProbesServer is a fake server for instances of the armnetwork.LoadBalancerProbesClient type. @@ -59,9 +59,7 @@ func (l *LoadBalancerProbesServerTransport) Do(req *http.Request) (*http.Respons } func (l *LoadBalancerProbesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (l *LoadBalancerProbesServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (l *LoadBalancerProbesServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Probe, req) @@ -161,7 +156,7 @@ func (l *LoadBalancerProbesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go index 645a1c9c6efe..9973d839ee04 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // LoadBalancersServer is a fake server for instances of the armnetwork.LoadBalancersClient type. @@ -98,9 +98,7 @@ func (l *LoadBalancersServerTransport) Do(req *http.Request) (*http.Response, er } func (l *LoadBalancersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -132,10 +130,7 @@ func (l *LoadBalancersServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -183,7 +178,7 @@ func (l *LoadBalancersServerTransport) dispatchBeginCreateOrUpdate(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { l.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -227,7 +222,7 @@ func (l *LoadBalancersServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -257,15 +252,13 @@ func (l *LoadBalancersServerTransport) dispatchGet(req *http.Request) (*http.Res if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) + detailLevelParam := getOptional(armnetwork.LoadBalancerDetailLevel(qp.Get("detailLevel"))) var options *armnetwork.LoadBalancersClientGetOptions - if expandParam != nil { + if expandParam != nil || detailLevelParam != nil { options = &armnetwork.LoadBalancersClientGetOptions{ - Expand: expandParam, + Expand: expandParam, + DetailLevel: detailLevelParam, } } respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, loadBalancerNameParam, options) @@ -273,7 +266,7 @@ func (l *LoadBalancersServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LoadBalancer, req) @@ -310,7 +303,7 @@ func (l *LoadBalancersServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -343,7 +336,7 @@ func (l *LoadBalancersServerTransport) dispatchNewListAllPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -394,7 +387,7 @@ func (l *LoadBalancersServerTransport) dispatchBeginListInboundNatRulePortMappin return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginListInboundNatRulePortMappings.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -438,7 +431,7 @@ func (l *LoadBalancersServerTransport) dispatchMigrateToIPBased(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigratedPools, req) @@ -481,7 +474,7 @@ func (l *LoadBalancersServerTransport) dispatchBeginSwapPublicIPAddresses(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginSwapPublicIPAddresses.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -519,7 +512,7 @@ func (l *LoadBalancersServerTransport) dispatchUpdateTags(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LoadBalancer, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go index 56f3d1dda946..88c7bc5a87bb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // LocalNetworkGatewaysServer is a fake server for instances of the armnetwork.LocalNetworkGatewaysClient type. @@ -75,9 +75,7 @@ func (l *LocalNetworkGatewaysServerTransport) Do(req *http.Request) (*http.Respo } func (l *LocalNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -101,10 +99,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -152,7 +147,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { l.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -196,7 +191,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -230,7 +225,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LocalNetworkGateway, req) @@ -267,7 +262,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -304,7 +299,7 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchUpdateTags(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LocalNetworkGateway, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/management_server.go b/sdk/resourcemanager/network/armnetwork/fake/management_server.go index ef54bdd39d97..12e6d1e22bec 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/management_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/management_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -120,9 +120,7 @@ func (m *ManagementServerTransport) Do(req *http.Request) (*http.Response, error } func (m *ManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -164,10 +162,7 @@ func (m *ManagementServerTransport) dispatchToMethodFake(req *http.Request, meth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -182,7 +177,7 @@ func (m *ManagementServerTransport) dispatchCheckDNSNameAvailability(req *http.R if m.srv.CheckDNSNameAvailability == nil { return nil, &nonRetriableError{errors.New("fake for method CheckDNSNameAvailability not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/CheckDnsNameAvailability` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkDnsNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 3 { @@ -193,16 +188,12 @@ func (m *ManagementServerTransport) dispatchCheckDNSNameAvailability(req *http.R if err != nil { return nil, err } - domainNameLabelParam, err := url.QueryUnescape(qp.Get("domainNameLabel")) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.CheckDNSNameAvailability(req.Context(), locationParam, domainNameLabelParam, nil) + respr, errRespr := m.srv.CheckDNSNameAvailability(req.Context(), locationParam, qp.Get("domainNameLabel"), nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DNSNameAvailabilityResult, req) @@ -249,7 +240,7 @@ func (m *ManagementServerTransport) dispatchBeginDeleteBastionShareableLink(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDeleteBastionShareableLink.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -297,7 +288,7 @@ func (m *ManagementServerTransport) dispatchBeginDeleteBastionShareableLinkByTok return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDeleteBastionShareableLinkByToken.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -343,7 +334,7 @@ func (m *ManagementServerTransport) dispatchNewDisconnectActiveSessionsPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newDisconnectActiveSessionsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -372,7 +363,7 @@ func (m *ManagementServerTransport) dispatchExpressRouteProviderPort(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExpressRouteProviderPort, req) @@ -388,7 +379,7 @@ func (m *ManagementServerTransport) dispatchBeginGeneratevirtualwanvpnserverconf } beginGeneratevirtualwanvpnserverconfigurationvpnprofile := m.beginGeneratevirtualwanvpnserverconfigurationvpnprofile.get(req) if beginGeneratevirtualwanvpnserverconfigurationvpnprofile == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualWans/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/GenerateVpnProfile` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualWans/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/generateVpnProfile` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -419,7 +410,7 @@ func (m *ManagementServerTransport) dispatchBeginGeneratevirtualwanvpnserverconf return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { m.beginGeneratevirtualwanvpnserverconfigurationvpnprofile.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -463,7 +454,7 @@ func (m *ManagementServerTransport) dispatchBeginGetActiveSessions(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { m.beginGetActiveSessions.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -509,7 +500,7 @@ func (m *ManagementServerTransport) dispatchNewGetBastionShareableLinkPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newGetBastionShareableLinkPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -542,11 +533,7 @@ func (m *ManagementServerTransport) dispatchListActiveConnectivityConfigurations if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -567,7 +554,7 @@ func (m *ManagementServerTransport) dispatchListActiveConnectivityConfigurations return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ActiveConnectivityConfigurationsListResult, req) @@ -600,11 +587,7 @@ func (m *ManagementServerTransport) dispatchListActiveSecurityAdminRules(req *ht if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -625,7 +608,7 @@ func (m *ManagementServerTransport) dispatchListActiveSecurityAdminRules(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ActiveSecurityAdminRulesListResult, req) @@ -658,11 +641,7 @@ func (m *ManagementServerTransport) dispatchListNetworkManagerEffectiveConnectiv if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -683,7 +662,7 @@ func (m *ManagementServerTransport) dispatchListNetworkManagerEffectiveConnectiv return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerEffectiveConnectivityConfigurationListResult, req) @@ -716,11 +695,7 @@ func (m *ManagementServerTransport) dispatchListNetworkManagerEffectiveSecurityA if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -741,7 +716,7 @@ func (m *ManagementServerTransport) dispatchListNetworkManagerEffectiveSecurityA return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerEffectiveSecurityAdminRulesListResult, req) @@ -788,7 +763,7 @@ func (m *ManagementServerTransport) dispatchBeginPutBastionShareableLink(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { m.beginPutBastionShareableLink.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -822,7 +797,7 @@ func (m *ManagementServerTransport) dispatchSupportedSecurityProviders(req *http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualWanSecurityProviders, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go index 7aca188ee92d..5f0220a0566b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) Do(req *http.R } func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchToMeth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -133,7 +128,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchCreate return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerConnection, req) @@ -166,7 +161,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchDelete return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -199,7 +194,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchGet(re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerConnection, req) @@ -226,11 +221,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchNewLis if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -240,11 +231,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchNewLis if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ManagementGroupNetworkManagerConnectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ManagementGroupNetworkManagerConnectionsClientListOptions{ @@ -263,7 +250,7 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchNewLis if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go index 41bf5e42372d..d584b184a00e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ManagerCommitsServer is a fake server for instances of the armnetwork.ManagerCommitsClient type. @@ -54,9 +54,7 @@ func (m *ManagerCommitsServerTransport) Do(req *http.Request) (*http.Response, e } func (m *ManagerCommitsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (m *ManagerCommitsServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -123,7 +118,7 @@ func (m *ManagerCommitsServerTransport) dispatchBeginPost(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { m.beginPost.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go index e65170b40edb..9f503950edde 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -51,9 +51,7 @@ func (m *ManagerDeploymentStatusServerTransport) Do(req *http.Request) (*http.Re } func (m *ManagerDeploymentStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -69,10 +67,7 @@ func (m *ManagerDeploymentStatusServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -106,11 +101,7 @@ func (m *ManagerDeploymentStatusServerTransport) dispatchList(req *http.Request) if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -131,7 +122,7 @@ func (m *ManagerDeploymentStatusServerTransport) dispatchList(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerDeploymentStatusListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go index b22515267be8..6f21163a0c75 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) Do(req *http.Request) (*ht } func (m *ManagerRoutingConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchCreateOrUpdate(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerRoutingConfiguration, req) @@ -174,11 +169,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchBeginDelete(req *h if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -201,7 +192,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchBeginDelete(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -239,7 +230,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchGet(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerRoutingConfiguration, req) @@ -270,11 +261,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -284,11 +271,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ManagerRoutingConfigurationsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ManagerRoutingConfigurationsClientListOptions{ @@ -307,7 +290,7 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/managers_server.go b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go index 5d00d2da4106..e601a3658141 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -80,9 +80,7 @@ func (m *ManagersServerTransport) Do(req *http.Request) (*http.Response, error) } func (m *ManagersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -108,10 +106,7 @@ func (m *ManagersServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -149,7 +144,7 @@ func (m *ManagersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Manager, req) @@ -180,11 +175,7 @@ func (m *ManagersServerTransport) dispatchBeginDelete(req *http.Request) (*http. if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -207,7 +198,7 @@ func (m *ManagersServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -241,7 +232,7 @@ func (m *ManagersServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Manager, req) @@ -268,11 +259,7 @@ func (m *ManagersServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -282,11 +269,7 @@ func (m *ManagersServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ManagersClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ManagersClientListOptions{ @@ -305,7 +288,7 @@ func (m *ManagersServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -328,11 +311,7 @@ func (m *ManagersServerTransport) dispatchNewListBySubscriptionPager(req *http.R return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -342,11 +321,7 @@ func (m *ManagersServerTransport) dispatchNewListBySubscriptionPager(req *http.R if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ManagersClientListBySubscriptionOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ManagersClientListBySubscriptionOptions{ @@ -365,7 +340,7 @@ func (m *ManagersServerTransport) dispatchNewListBySubscriptionPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { m.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -402,7 +377,7 @@ func (m *ManagersServerTransport) dispatchPatch(req *http.Request) (*http.Respon return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Manager, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go index b7080a63022f..74fa71c7a8e1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // NatGatewaysServer is a fake server for instances of the armnetwork.NatGatewaysClient type. @@ -81,9 +81,7 @@ func (n *NatGatewaysServerTransport) Do(req *http.Request) (*http.Response, erro } func (n *NatGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (n *NatGatewaysServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (n *NatGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { n.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (n *NatGatewaysServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (n *NatGatewaysServerTransport) dispatchGet(req *http.Request) (*http.Respo if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.NatGatewaysClientGetOptions if expandParam != nil { options = &armnetwork.NatGatewaysClientGetOptions{ @@ -250,7 +241,7 @@ func (n *NatGatewaysServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NatGateway, req) @@ -287,7 +278,7 @@ func (n *NatGatewaysServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { n.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (n *NatGatewaysServerTransport) dispatchNewListAllPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { n.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (n *NatGatewaysServerTransport) dispatchUpdateTags(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NatGateway, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go index 16fa26aee561..555a750fefc8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // NatRulesServer is a fake server for instances of the armnetwork.NatRulesClient type. @@ -71,9 +71,7 @@ func (n *NatRulesServerTransport) Do(req *http.Request) (*http.Response, error) } func (n *NatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (n *NatRulesServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (n *NatRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { n.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (n *NatRulesServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (n *NatRulesServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNGatewayNatRule, req) @@ -277,7 +272,7 @@ func (n *NatRulesServerTransport) dispatchNewListByVPNGatewayPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { n.newListByVPNGatewayPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/operations_server.go b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go index abdb44a0ebda..25a3c7920ad5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/operations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,8 +11,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" + "slices" ) // OperationsServer is a fake server for instances of the armnetwork.OperationsClient type. @@ -52,9 +52,7 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error } func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -70,10 +68,7 @@ func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, meth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -101,7 +96,7 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { o.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go index 536abca3c960..539c7f4eb899 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // P2SVPNGatewaysServer is a fake server for instances of the armnetwork.P2SVPNGatewaysClient type. @@ -113,9 +113,7 @@ func (p *P2SVPNGatewaysServerTransport) Do(req *http.Request) (*http.Response, e } func (p *P2SVPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -151,10 +149,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -202,7 +197,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -246,7 +241,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -294,7 +289,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginDisconnectP2SVPNConnections return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDisconnectP2SVPNConnections.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -342,7 +337,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginGenerateVPNProfile(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginGenerateVPNProfile.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -376,7 +371,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).P2SVPNGateway, req) @@ -419,7 +414,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginGetP2SVPNConnectionHealth(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginGetP2SVPNConnectionHealth.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -467,7 +462,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginGetP2SVPNConnectionHealthDe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginGetP2SVPNConnectionHealthDetailed.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -501,7 +496,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -538,7 +533,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchNewListByResourceGroupPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -581,7 +576,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginReset(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginReset.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -629,7 +624,7 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go index 8e3a8ceab5eb..c140e35b8994 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,12 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PacketCapturesServer is a fake server for instances of the armnetwork.PacketCapturesClient type. @@ -82,9 +83,7 @@ func (p *PacketCapturesServerTransport) Do(req *http.Request) (*http.Response, e } func (p *PacketCapturesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -110,10 +109,7 @@ func (p *PacketCapturesServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -165,7 +161,7 @@ func (p *PacketCapturesServerTransport) dispatchBeginCreate(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -213,7 +209,7 @@ func (p *PacketCapturesServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -251,7 +247,7 @@ func (p *PacketCapturesServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PacketCaptureResult, req) @@ -298,7 +294,7 @@ func (p *PacketCapturesServerTransport) dispatchBeginGetStatus(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginGetStatus.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -332,12 +328,15 @@ func (p *PacketCapturesServerTransport) dispatchNewListPager(req *http.Request) resp := p.srv.NewListPager(resourceGroupNameParam, networkWatcherNameParam, nil) newListPager = &resp p.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.PacketCapturesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -384,7 +383,7 @@ func (p *PacketCapturesServerTransport) dispatchBeginStop(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginStop.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go index 812917097cfe..4df1057a6e94 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PeerExpressRouteCircuitConnectionsServer is a fake server for instances of the armnetwork.PeerExpressRouteCircuitConnectionsClient type. @@ -59,9 +59,7 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) Do(req *http.Request } func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -124,7 +119,7 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchGet(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PeerExpressRouteCircuitConnection, req) @@ -169,7 +164,7 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchNewListPager if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go index a9a3d1905c57..abe9a3529038 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go @@ -1,13 +1,12 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" ) func unmarshalBaseAdminRuleClassification(rawMsg json.RawMessage) (armnetwork.BaseAdminRuleClassification, error) { diff --git a/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go index 1b15b6c2b31d..2f066bef37a3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PrivateDNSZoneGroupsServer is a fake server for instances of the armnetwork.PrivateDNSZoneGroupsClient type. @@ -71,9 +71,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) Do(req *http.Request) (*http.Respo } func (p *PrivateDNSZoneGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchBeginCreateOrUpdate(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateDNSZoneGroup, req) @@ -277,7 +272,7 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go index 478f568cca7d..11fcbfa076da 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PrivateEndpointsServer is a fake server for instances of the armnetwork.PrivateEndpointsClient type. @@ -77,9 +77,7 @@ func (p *PrivateEndpointsServerTransport) Do(req *http.Request) (*http.Response, } func (p *PrivateEndpointsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -103,10 +101,7 @@ func (p *PrivateEndpointsServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -154,7 +149,7 @@ func (p *PrivateEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (p *PrivateEndpointsServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -228,11 +223,7 @@ func (p *PrivateEndpointsServerTransport) dispatchGet(req *http.Request) (*http. if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PrivateEndpointsClientGetOptions if expandParam != nil { options = &armnetwork.PrivateEndpointsClientGetOptions{ @@ -244,7 +235,7 @@ func (p *PrivateEndpointsServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpoint, req) @@ -281,7 +272,7 @@ func (p *PrivateEndpointsServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -314,7 +305,7 @@ func (p *PrivateEndpointsServerTransport) dispatchNewListBySubscriptionPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go index 962338e8529e..bb7e5f72b721 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PrivateLinkServicesServer is a fake server for instances of the armnetwork.PrivateLinkServicesClient type. @@ -121,9 +121,7 @@ func (p *PrivateLinkServicesServerTransport) Do(req *http.Request) (*http.Respon } func (p *PrivateLinkServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -163,10 +161,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchToMethodFake(req *http.Requ } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -210,7 +205,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchBeginCheckPrivateLinkServic return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginCheckPrivateLinkServiceVisibility.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -258,7 +253,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchBeginCheckPrivateLinkServic return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginCheckPrivateLinkServiceVisibilityByResourceGroup.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -306,7 +301,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchBeginCreateOrUpdate(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -350,7 +345,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -398,7 +393,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchBeginDeletePrivateEndpointC return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDeletePrivateEndpointConnection.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -428,11 +423,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchGet(req *http.Request) (*ht if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PrivateLinkServicesClientGetOptions if expandParam != nil { options = &armnetwork.PrivateLinkServicesClientGetOptions{ @@ -444,7 +435,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchGet(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkService, req) @@ -477,11 +468,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchGetPrivateEndpointConnectio if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions if expandParam != nil { options = &armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions{ @@ -493,7 +480,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchGetPrivateEndpointConnectio return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) @@ -530,7 +517,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchNewListPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -567,7 +554,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchNewListAutoApprovedPrivateL if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListAutoApprovedPrivateLinkServicesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -608,7 +595,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchNewListAutoApprovedPrivateL if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListAutoApprovedPrivateLinkServicesByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -641,7 +628,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchNewListBySubscriptionPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -682,7 +669,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchNewListPrivateEndpointConne if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPrivateEndpointConnectionsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -723,7 +710,7 @@ func (p *PrivateLinkServicesServerTransport) dispatchUpdatePrivateEndpointConnec return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go index 91f4fa84201d..877d9016c2db 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ProfilesServer is a fake server for instances of the armnetwork.ProfilesClient type. @@ -79,9 +79,7 @@ func (p *ProfilesServerTransport) Do(req *http.Request) (*http.Response, error) } func (p *ProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -107,10 +105,7 @@ func (p *ProfilesServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -148,7 +143,7 @@ func (p *ProfilesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Profile, req) @@ -191,7 +186,7 @@ func (p *ProfilesServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -221,11 +216,7 @@ func (p *ProfilesServerTransport) dispatchGet(req *http.Request) (*http.Response if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.ProfilesClientGetOptions if expandParam != nil { options = &armnetwork.ProfilesClientGetOptions{ @@ -237,7 +228,7 @@ func (p *ProfilesServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Profile, req) @@ -274,7 +265,7 @@ func (p *ProfilesServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -307,7 +298,7 @@ func (p *ProfilesServerTransport) dispatchNewListAllPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -344,7 +335,7 @@ func (p *ProfilesServerTransport) dispatchUpdateTags(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Profile, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go index 99263029825b..d52567c74ed9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PublicIPAddressesServer is a fake server for instances of the armnetwork.PublicIPAddressesClient type. @@ -131,9 +131,7 @@ func (p *PublicIPAddressesServerTransport) Do(req *http.Request) (*http.Response } func (p *PublicIPAddressesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -177,10 +175,7 @@ func (p *PublicIPAddressesServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -228,7 +223,7 @@ func (p *PublicIPAddressesServerTransport) dispatchBeginCreateOrUpdate(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -272,7 +267,7 @@ func (p *PublicIPAddressesServerTransport) dispatchBeginDdosProtectionStatus(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginDdosProtectionStatus.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -316,7 +311,7 @@ func (p *PublicIPAddressesServerTransport) dispatchBeginDelete(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -364,7 +359,7 @@ func (p *PublicIPAddressesServerTransport) dispatchBeginDisassociateCloudService return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginDisassociateCloudServiceReservedPublicIP.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -394,11 +389,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGet(req *http.Request) (*http if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PublicIPAddressesClientGetOptions if expandParam != nil { options = &armnetwork.PublicIPAddressesClientGetOptions{ @@ -410,7 +401,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPAddress, req) @@ -424,7 +415,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGetCloudServicePublicIPAddres if p.srv.GetCloudServicePublicIPAddress == nil { return nil, &nonRetriableError{errors.New("fake for method GetCloudServicePublicIPAddress not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipconfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipconfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 8 { @@ -455,11 +446,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGetCloudServicePublicIPAddres if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressOptions if expandParam != nil { options = &armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressOptions{ @@ -471,7 +458,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGetCloudServicePublicIPAddres return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPAddress, req) @@ -516,11 +503,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGetVirtualMachineScaleSetPubl if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions if expandParam != nil { options = &armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions{ @@ -532,7 +515,7 @@ func (p *PublicIPAddressesServerTransport) dispatchGetVirtualMachineScaleSetPubl return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPAddress, req) @@ -569,7 +552,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -602,7 +585,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListAllPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -618,7 +601,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListCloudServicePublicIPAd } newListCloudServicePublicIPAddressesPager := p.newListCloudServicePublicIPAddressesPager.get(req) if newListCloudServicePublicIPAddressesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -643,7 +626,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListCloudServicePublicIPAd if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListCloudServicePublicIPAddressesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -659,7 +642,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListCloudServiceRoleInstan } newListCloudServiceRoleInstancePublicIPAddressesPager := p.newListCloudServiceRoleInstancePublicIPAddressesPager.get(req) if newListCloudServiceRoleInstancePublicIPAddressesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipconfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkInterfaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ipconfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publicipaddresses` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 7 { @@ -696,7 +679,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListCloudServiceRoleInstan if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListCloudServiceRoleInstancePublicIPAddressesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -737,7 +720,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListVirtualMachineScaleSet if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListVirtualMachineScaleSetPublicIPAddressesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -790,7 +773,7 @@ func (p *PublicIPAddressesServerTransport) dispatchNewListVirtualMachineScaleSet if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListVirtualMachineScaleSetVMPublicIPAddressesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -837,7 +820,7 @@ func (p *PublicIPAddressesServerTransport) dispatchBeginReserveCloudServicePubli return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginReserveCloudServicePublicIPAddress.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -875,7 +858,7 @@ func (p *PublicIPAddressesServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPAddress, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go index 9c919661bd99..bcec6a2c1385 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // PublicIPPrefixesServer is a fake server for instances of the armnetwork.PublicIPPrefixesClient type. @@ -81,9 +81,7 @@ func (p *PublicIPPrefixesServerTransport) Do(req *http.Request) (*http.Response, } func (p *PublicIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchBeginCreateOrUpdate(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchGet(req *http.Request) (*http. if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.PublicIPPrefixesClientGetOptions if expandParam != nil { options = &armnetwork.PublicIPPrefixesClientGetOptions{ @@ -250,7 +241,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPPrefix, req) @@ -287,7 +278,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchNewListAllPager(req *http.Requ if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (p *PublicIPPrefixesServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PublicIPPrefix, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go index 1ecff40b33c6..c7eb48f405e1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) Do(req *http.Request) (*htt } func (r *ReachabilityAnalysisIntentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchToMethodFake(req *h } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -141,7 +136,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchCreate(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReachabilityAnalysisIntent, req) @@ -182,7 +177,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchDelete(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -223,7 +218,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchGet(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReachabilityAnalysisIntent, req) @@ -258,16 +253,8 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) - skipUnescaped, err := url.QueryUnescape(qp.Get("skip")) - if err != nil { - return nil, err - } - skipParam, err := parseOptional(skipUnescaped, func(v string) (int32, error) { + skipTokenParam := getOptional(qp.Get("skipToken")) + skipParam, err := parseOptional(qp.Get("skip"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -277,11 +264,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -291,16 +274,8 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - sortKeyUnescaped, err := url.QueryUnescape(qp.Get("sortKey")) - if err != nil { - return nil, err - } - sortKeyParam := getOptional(sortKeyUnescaped) - sortValueUnescaped, err := url.QueryUnescape(qp.Get("sortValue")) - if err != nil { - return nil, err - } - sortValueParam := getOptional(sortValueUnescaped) + sortKeyParam := getOptional(qp.Get("sortKey")) + sortValueParam := getOptional(qp.Get("sortValue")) var options *armnetwork.ReachabilityAnalysisIntentsClientListOptions if skipTokenParam != nil || skipParam != nil || topParam != nil || sortKeyParam != nil || sortValueParam != nil { options = &armnetwork.ReachabilityAnalysisIntentsClientListOptions{ @@ -322,7 +297,7 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go index 2547cafd9085..3eedc9aa299a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) Do(req *http.Request) (*http.R } func (r *ReachabilityAnalysisRunsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchToMethodFake(req *http } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -143,7 +138,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchCreate(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReachabilityAnalysisRun, req) @@ -194,7 +189,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchBeginDelete(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReachabilityAnalysisRun, req) @@ -271,16 +266,8 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) - skipUnescaped, err := url.QueryUnescape(qp.Get("skip")) - if err != nil { - return nil, err - } - skipParam, err := parseOptional(skipUnescaped, func(v string) (int32, error) { + skipTokenParam := getOptional(qp.Get("skipToken")) + skipParam, err := parseOptional(qp.Get("skip"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -290,11 +277,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -304,16 +287,8 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - sortKeyUnescaped, err := url.QueryUnescape(qp.Get("sortKey")) - if err != nil { - return nil, err - } - sortKeyParam := getOptional(sortKeyUnescaped) - sortValueUnescaped, err := url.QueryUnescape(qp.Get("sortValue")) - if err != nil { - return nil, err - } - sortValueParam := getOptional(sortValueUnescaped) + sortKeyParam := getOptional(qp.Get("sortKey")) + sortValueParam := getOptional(qp.Get("sortValue")) var options *armnetwork.ReachabilityAnalysisRunsClientListOptions if skipTokenParam != nil || skipParam != nil || topParam != nil || sortKeyParam != nil || sortValueParam != nil { options = &armnetwork.ReachabilityAnalysisRunsClientListOptions{ @@ -335,7 +310,7 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go index 688a897ca988..fe5fd3ffa1cc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ResourceNavigationLinksServer is a fake server for instances of the armnetwork.ResourceNavigationLinksClient type. @@ -50,9 +50,7 @@ func (r *ResourceNavigationLinksServerTransport) Do(req *http.Request) (*http.Re } func (r *ResourceNavigationLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (r *ResourceNavigationLinksServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -86,7 +81,7 @@ func (r *ResourceNavigationLinksServerTransport) dispatchList(req *http.Request) if r.srv.List == nil { return nil, &nonRetriableError{errors.New("fake for method List not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ResourceNavigationLinks` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceNavigationLinks` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -109,7 +104,7 @@ func (r *ResourceNavigationLinksServerTransport) dispatchList(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ResourceNavigationLinksListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go index d66d005fb0b6..b60e5f308066 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RouteFilterRulesServer is a fake server for instances of the armnetwork.RouteFilterRulesClient type. @@ -71,9 +71,7 @@ func (r *RouteFilterRulesServerTransport) Do(req *http.Request) (*http.Response, } func (r *RouteFilterRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (r *RouteFilterRulesServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (r *RouteFilterRulesServerTransport) dispatchBeginCreateOrUpdate(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (r *RouteFilterRulesServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (r *RouteFilterRulesServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteFilterRule, req) @@ -277,7 +272,7 @@ func (r *RouteFilterRulesServerTransport) dispatchNewListByRouteFilterPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListByRouteFilterPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go index ed7633f0fc13..3b8ce48c05b6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RouteFiltersServer is a fake server for instances of the armnetwork.RouteFiltersClient type. @@ -81,9 +81,7 @@ func (r *RouteFiltersServerTransport) Do(req *http.Request) (*http.Response, err } func (r *RouteFiltersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (r *RouteFiltersServerTransport) dispatchToMethodFake(req *http.Request, me } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (r *RouteFiltersServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (r *RouteFiltersServerTransport) dispatchBeginDelete(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (r *RouteFiltersServerTransport) dispatchGet(req *http.Request) (*http.Resp if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.RouteFiltersClientGetOptions if expandParam != nil { options = &armnetwork.RouteFiltersClientGetOptions{ @@ -250,7 +241,7 @@ func (r *RouteFiltersServerTransport) dispatchGet(req *http.Request) (*http.Resp return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteFilter, req) @@ -283,7 +274,7 @@ func (r *RouteFiltersServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (r *RouteFiltersServerTransport) dispatchNewListByResourceGroupPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (r *RouteFiltersServerTransport) dispatchUpdateTags(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteFilter, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go index a4e5c9ff5488..6de4f3230d04 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RouteMapsServer is a fake server for instances of the armnetwork.RouteMapsClient type. @@ -71,9 +71,7 @@ func (r *RouteMapsServerTransport) Do(req *http.Request) (*http.Response, error) } func (r *RouteMapsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (r *RouteMapsServerTransport) dispatchToMethodFake(req *http.Request, metho } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (r *RouteMapsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (r *RouteMapsServerTransport) dispatchBeginDelete(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (r *RouteMapsServerTransport) dispatchGet(req *http.Request) (*http.Respons return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteMap, req) @@ -277,7 +272,7 @@ func (r *RouteMapsServerTransport) dispatchNewListPager(req *http.Request) (*htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/routes_server.go b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go index ca13005adb11..d8b993a5ceec 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RoutesServer is a fake server for instances of the armnetwork.RoutesClient type. @@ -71,9 +71,7 @@ func (r *RoutesServerTransport) Do(req *http.Request) (*http.Response, error) { } func (r *RoutesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (r *RoutesServerTransport) dispatchToMethodFake(req *http.Request, method s } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (r *RoutesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (r *RoutesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (r *RoutesServerTransport) dispatchGet(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Route, req) @@ -277,7 +272,7 @@ func (r *RoutesServerTransport) dispatchNewListPager(req *http.Request) (*http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go index 5488508667dd..118691e5c621 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RouteTablesServer is a fake server for instances of the armnetwork.RouteTablesClient type. @@ -81,9 +81,7 @@ func (r *RouteTablesServerTransport) Do(req *http.Request) (*http.Response, erro } func (r *RouteTablesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (r *RouteTablesServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (r *RouteTablesServerTransport) dispatchBeginCreateOrUpdate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (r *RouteTablesServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (r *RouteTablesServerTransport) dispatchGet(req *http.Request) (*http.Respo if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.RouteTablesClientGetOptions if expandParam != nil { options = &armnetwork.RouteTablesClientGetOptions{ @@ -250,7 +241,7 @@ func (r *RouteTablesServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteTable, req) @@ -287,7 +278,7 @@ func (r *RouteTablesServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (r *RouteTablesServerTransport) dispatchNewListAllPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (r *RouteTablesServerTransport) dispatchUpdateTags(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RouteTable, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go index 0639aa52bd99..9f38f6143085 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // RoutingIntentServer is a fake server for instances of the armnetwork.RoutingIntentClient type. @@ -71,9 +71,7 @@ func (r *RoutingIntentServerTransport) Do(req *http.Request) (*http.Response, er } func (r *RoutingIntentServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (r *RoutingIntentServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (r *RoutingIntentServerTransport) dispatchBeginCreateOrUpdate(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (r *RoutingIntentServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (r *RoutingIntentServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RoutingIntent, req) @@ -277,7 +272,7 @@ func (r *RoutingIntentServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go index f9b5dc96e547..e05a5852af0d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (r *RoutingRuleCollectionsServerTransport) Do(req *http.Request) (*http.Res } func (r *RoutingRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -143,7 +138,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchCreateOrUpdate(req *http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RoutingRuleCollection, req) @@ -182,11 +177,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchBeginDelete(req *http.Re if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -209,7 +200,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchBeginDelete(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -251,7 +242,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchGet(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RoutingRuleCollection, req) @@ -286,11 +277,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -300,11 +287,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.RoutingRuleCollectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.RoutingRuleCollectionsClientListOptions{ @@ -323,7 +306,7 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go index 2a5c75c5143a..ebb1b5aac773 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (r *RoutingRulesServerTransport) Do(req *http.Request) (*http.Response, err } func (r *RoutingRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (r *RoutingRulesServerTransport) dispatchToMethodFake(req *http.Request, me } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -147,7 +142,7 @@ func (r *RoutingRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RoutingRule, req) @@ -190,11 +185,7 @@ func (r *RoutingRulesServerTransport) dispatchBeginDelete(req *http.Request) (*h if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -217,7 +208,7 @@ func (r *RoutingRulesServerTransport) dispatchBeginDelete(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -263,7 +254,7 @@ func (r *RoutingRulesServerTransport) dispatchGet(req *http.Request) (*http.Resp return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RoutingRule, req) @@ -302,11 +293,7 @@ func (r *RoutingRulesServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -316,11 +303,7 @@ func (r *RoutingRulesServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.RoutingRulesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.RoutingRulesClientListOptions{ @@ -339,7 +322,7 @@ func (r *RoutingRulesServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go index 87f5474b26f4..46b58c2f0814 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (s *ScopeConnectionsServerTransport) Do(req *http.Request) (*http.Response, } func (s *ScopeConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (s *ScopeConnectionsServerTransport) dispatchToMethodFake(req *http.Request } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -137,7 +132,7 @@ func (s *ScopeConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ScopeConnection, req) @@ -174,7 +169,7 @@ func (s *ScopeConnectionsServerTransport) dispatchDelete(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -211,7 +206,7 @@ func (s *ScopeConnectionsServerTransport) dispatchGet(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ScopeConnection, req) @@ -242,11 +237,7 @@ func (s *ScopeConnectionsServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -256,11 +247,7 @@ func (s *ScopeConnectionsServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.ScopeConnectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.ScopeConnectionsClientListOptions{ @@ -279,7 +266,7 @@ func (s *ScopeConnectionsServerTransport) dispatchNewListPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go index d54abf58f2ef..33ac96db5419 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (s *SecurityAdminConfigurationsServerTransport) Do(req *http.Request) (*htt } func (s *SecurityAdminConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchToMethodFake(req *h } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchCreateOrUpdate(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityAdminConfiguration, req) @@ -174,11 +169,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchBeginDelete(req *ht if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -201,7 +192,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchBeginDelete(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -239,7 +230,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchGet(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityAdminConfiguration, req) @@ -270,11 +261,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -284,11 +271,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityAdminConfigurationsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityAdminConfigurationsClientListOptions{ @@ -307,7 +290,7 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go index ce8a09d59db0..a66b60da6a15 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityGroupsServer is a fake server for instances of the armnetwork.SecurityGroupsClient type. @@ -81,9 +81,7 @@ func (s *SecurityGroupsServerTransport) Do(req *http.Request) (*http.Response, e } func (s *SecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (s *SecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (s *SecurityGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (s *SecurityGroupsServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (s *SecurityGroupsServerTransport) dispatchGet(req *http.Request) (*http.Re if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.SecurityGroupsClientGetOptions if expandParam != nil { options = &armnetwork.SecurityGroupsClientGetOptions{ @@ -250,7 +241,7 @@ func (s *SecurityGroupsServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityGroup, req) @@ -287,7 +278,7 @@ func (s *SecurityGroupsServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (s *SecurityGroupsServerTransport) dispatchNewListAllPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (s *SecurityGroupsServerTransport) dispatchUpdateTags(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityGroup, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go index 711e1cc1ae29..857d86c8d4fc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityPartnerProvidersServer is a fake server for instances of the armnetwork.SecurityPartnerProvidersClient type. @@ -81,9 +81,7 @@ func (s *SecurityPartnerProvidersServerTransport) Do(req *http.Request) (*http.R } func (s *SecurityPartnerProvidersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchToMethodFake(req *http } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchBeginCreateOrUpdate(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchBeginDelete(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPartnerProvider, req) @@ -271,7 +266,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchNewListByResourceGroup if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchUpdateTags(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPartnerProvider, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go index cfadba2c1548..cfc4a4335770 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -72,9 +72,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) Do(req *http.Request) (*ht } func (s *SecurityPerimeterAccessRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -98,10 +96,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -147,7 +142,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchCreateOrUpdate(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspAccessRule, req) @@ -188,7 +183,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchDelete(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -229,7 +224,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchGet(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspAccessRule, req) @@ -264,11 +259,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -278,11 +269,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimeterAccessRulesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimeterAccessRulesClientListOptions{ @@ -301,7 +288,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -346,7 +333,7 @@ func (s *SecurityPerimeterAccessRulesServerTransport) dispatchReconcile(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go index 8998dc1aa4fa..3cde32cf0ed3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityPerimeterAssociableResourceTypesServer is a fake server for instances of the armnetwork.SecurityPerimeterAssociableResourceTypesClient type. @@ -54,9 +54,7 @@ func (s *SecurityPerimeterAssociableResourceTypesServerTransport) Do(req *http.R } func (s *SecurityPerimeterAssociableResourceTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (s *SecurityPerimeterAssociableResourceTypesServerTransport) dispatchToMeth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (s *SecurityPerimeterAssociableResourceTypesServerTransport) dispatchNewLis if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go index 7a8642a2b914..79a04b43292e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -76,9 +76,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) Do(req *http.Request) (*h } func (s *SecurityPerimeterAssociationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -102,10 +100,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -157,7 +152,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchBeginCreateOrUpda return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } @@ -205,7 +200,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchBeginDelete(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -243,7 +238,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchGet(req *http.Req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspAssociation, req) @@ -274,11 +269,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -288,11 +279,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimeterAssociationsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimeterAssociationsClientListOptions{ @@ -311,7 +298,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -352,7 +339,7 @@ func (s *SecurityPerimeterAssociationsServerTransport) dispatchReconcile(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Interface, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go index 341ea5e7d66d..d56b0cfd9b23 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -66,9 +66,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) Do(req *http.Request) ( } func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -88,10 +86,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchToMethodFake(re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchBeginDelete(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -177,7 +172,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchGet(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspLinkReference, req) @@ -208,11 +203,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchNewListPager(re if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -222,11 +213,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchNewListPager(re if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimeterLinkReferencesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimeterLinkReferencesClientListOptions{ @@ -245,7 +232,7 @@ func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchNewListPager(re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go index 9729ceef67b2..ff2d98d0ca52 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (s *SecurityPerimeterLinksServerTransport) Do(req *http.Request) (*http.Res } func (s *SecurityPerimeterLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchCreateOrUpdate(req *http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspLink, req) @@ -186,7 +181,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchBeginDelete(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -224,7 +219,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchGet(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspLink, req) @@ -255,11 +250,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -269,11 +260,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimeterLinksClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimeterLinksClientListOptions{ @@ -292,7 +279,7 @@ func (s *SecurityPerimeterLinksServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go index 5a40e1450f4f..30262e83c385 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityPerimeterLoggingConfigurationsServer is a fake server for instances of the armnetwork.SecurityPerimeterLoggingConfigurationsClient type. @@ -67,9 +67,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) Do(req *http.Req } func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -91,10 +89,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchToMethod } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -136,7 +131,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchCreateOr return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspLoggingConfiguration, req) @@ -173,7 +168,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchDelete(r return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -210,7 +205,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchGet(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspLoggingConfiguration, req) @@ -251,7 +246,7 @@ func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchNewListP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go index d0421bda3d86..8a61bdba8274 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityPerimeterOperationStatusesServer is a fake server for instances of the armnetwork.SecurityPerimeterOperationStatusesClient type. @@ -50,9 +50,7 @@ func (s *SecurityPerimeterOperationStatusesServerTransport) Do(req *http.Request } func (s *SecurityPerimeterOperationStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (s *SecurityPerimeterOperationStatusesServerTransport) dispatchToMethodFake } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -105,7 +100,7 @@ func (s *SecurityPerimeterOperationStatusesServerTransport) dispatchGet(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationStatusResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go index e48813e3ffa3..442c3627c0eb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (s *SecurityPerimeterProfilesServerTransport) Do(req *http.Request) (*http. } func (s *SecurityPerimeterProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -137,7 +132,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchCreateOrUpdate(req *h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspProfile, req) @@ -174,7 +169,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchDelete(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -211,7 +206,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NspProfile, req) @@ -242,11 +237,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -256,11 +247,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimeterProfilesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimeterProfilesClientListOptions{ @@ -279,7 +266,7 @@ func (s *SecurityPerimeterProfilesServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go index 66ce3f5d2779..03326330fedc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -80,9 +80,7 @@ func (s *SecurityPerimetersServerTransport) Do(req *http.Request) (*http.Respons } func (s *SecurityPerimetersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -108,10 +106,7 @@ func (s *SecurityPerimetersServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -149,7 +144,7 @@ func (s *SecurityPerimetersServerTransport) dispatchCreateOrUpdate(req *http.Req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPerimeter, req) @@ -180,11 +175,7 @@ func (s *SecurityPerimetersServerTransport) dispatchBeginDelete(req *http.Reques if err != nil { return nil, err } - forceDeletionUnescaped, err := url.QueryUnescape(qp.Get("forceDeletion")) - if err != nil { - return nil, err - } - forceDeletionParam, err := parseOptional(forceDeletionUnescaped, strconv.ParseBool) + forceDeletionParam, err := parseOptional(qp.Get("forceDeletion"), strconv.ParseBool) if err != nil { return nil, err } @@ -207,7 +198,7 @@ func (s *SecurityPerimetersServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -241,7 +232,7 @@ func (s *SecurityPerimetersServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPerimeter, req) @@ -268,11 +259,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -282,11 +269,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimetersClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimetersClientListOptions{ @@ -305,7 +288,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -328,11 +311,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListBySubscriptionPager(r return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -342,11 +321,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListBySubscriptionPager(r if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityPerimetersClientListBySubscriptionOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityPerimetersClientListBySubscriptionOptions{ @@ -365,7 +340,7 @@ func (s *SecurityPerimetersServerTransport) dispatchNewListBySubscriptionPager(r if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -402,7 +377,7 @@ func (s *SecurityPerimetersServerTransport) dispatchPatch(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPerimeter, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterservicetags_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterservicetags_server.go index 97f2fae6761e..bd583720b44c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityperimeterservicetags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterservicetags_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityPerimeterServiceTagsServer is a fake server for instances of the armnetwork.SecurityPerimeterServiceTagsClient type. @@ -54,9 +54,7 @@ func (s *SecurityPerimeterServiceTagsServerTransport) Do(req *http.Request) (*ht } func (s *SecurityPerimeterServiceTagsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (s *SecurityPerimeterServiceTagsServerTransport) dispatchToMethodFake(req * } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (s *SecurityPerimeterServiceTagsServerTransport) dispatchNewListPager(req * if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go index 8c0b8583f17d..a206660f019a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SecurityRulesServer is a fake server for instances of the armnetwork.SecurityRulesClient type. @@ -71,9 +71,7 @@ func (s *SecurityRulesServerTransport) Do(req *http.Request) (*http.Response, er } func (s *SecurityRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (s *SecurityRulesServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (s *SecurityRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (s *SecurityRulesServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (s *SecurityRulesServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityRule, req) @@ -277,7 +272,7 @@ func (s *SecurityRulesServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go index 1a9a218e67f6..4141e29a6bed 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (s *SecurityUserConfigurationsServerTransport) Do(req *http.Request) (*http } func (s *SecurityUserConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchToMethodFake(req *ht } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,7 +134,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchCreateOrUpdate(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserConfiguration, req) @@ -174,11 +169,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchBeginDelete(req *htt if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -201,7 +192,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -239,7 +230,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchGet(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserConfiguration, req) @@ -270,11 +261,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -284,11 +271,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityUserConfigurationsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityUserConfigurationsClientListOptions{ @@ -307,7 +290,7 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchNewListPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go index 8c4253638bf9..58a20561a2c3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) Do(req *http.Request) (*htt } func (s *SecurityUserRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchToMethodFake(req *h } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -143,7 +138,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchCreateOrUpdate(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserRuleCollection, req) @@ -182,11 +177,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchBeginDelete(req *ht if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -209,7 +200,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchBeginDelete(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -251,7 +242,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchGet(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserRuleCollection, req) @@ -286,11 +277,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -300,11 +287,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityUserRuleCollectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityUserRuleCollectionsClientListOptions{ @@ -323,7 +306,7 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go index 24a108e71117..c65f8a174caf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -70,9 +70,7 @@ func (s *SecurityUserRulesServerTransport) Do(req *http.Request) (*http.Response } func (s *SecurityUserRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -94,10 +92,7 @@ func (s *SecurityUserRulesServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -147,7 +142,7 @@ func (s *SecurityUserRulesServerTransport) dispatchCreateOrUpdate(req *http.Requ return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserRule, req) @@ -190,11 +185,7 @@ func (s *SecurityUserRulesServerTransport) dispatchBeginDelete(req *http.Request if err != nil { return nil, err } - forceUnescaped, err := url.QueryUnescape(qp.Get("force")) - if err != nil { - return nil, err - } - forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + forceParam, err := parseOptional(qp.Get("force"), strconv.ParseBool) if err != nil { return nil, err } @@ -217,7 +208,7 @@ func (s *SecurityUserRulesServerTransport) dispatchBeginDelete(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -263,7 +254,7 @@ func (s *SecurityUserRulesServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityUserRule, req) @@ -302,11 +293,7 @@ func (s *SecurityUserRulesServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -316,11 +303,7 @@ func (s *SecurityUserRulesServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SecurityUserRulesClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SecurityUserRulesClientListOptions{ @@ -339,7 +322,7 @@ func (s *SecurityUserRulesServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/server_factory.go b/sdk/resourcemanager/network/armnetwork/fake/server_factory.go index 2a62cbb567f3..b2df92e54c40 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/server_factory.go +++ b/sdk/resourcemanager/network/armnetwork/fake/server_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -67,12 +66,18 @@ type ServerFactory struct { // BgpServiceCommunitiesServer contains the fakes for client BgpServiceCommunitiesClient BgpServiceCommunitiesServer BgpServiceCommunitiesServer + // CommitsServer contains the fakes for client CommitsClient + CommitsServer CommitsServer + // ConfigurationPolicyGroupsServer contains the fakes for client ConfigurationPolicyGroupsClient ConfigurationPolicyGroupsServer ConfigurationPolicyGroupsServer // ConnectionMonitorsServer contains the fakes for client ConnectionMonitorsClient ConnectionMonitorsServer ConnectionMonitorsServer + // ConnectionPoliciesServer contains the fakes for client ConnectionPoliciesClient + ConnectionPoliciesServer ConnectionPoliciesServer + // ConnectivityConfigurationsServer contains the fakes for client ConnectivityConfigurationsClient ConnectivityConfigurationsServer ConnectivityConfigurationsServer @@ -181,6 +186,9 @@ type ServerFactory struct { // InboundSecurityRuleServer contains the fakes for client InboundSecurityRuleClient InboundSecurityRuleServer InboundSecurityRuleServer + // InterconnectGroupsServer contains the fakes for client InterconnectGroupsClient + InterconnectGroupsServer InterconnectGroupsServer + // InterfaceIPConfigurationsServer contains the fakes for client InterfaceIPConfigurationsClient InterfaceIPConfigurationsServer InterfaceIPConfigurationsServer @@ -385,6 +393,9 @@ type ServerFactory struct { // StaticMembersServer contains the fakes for client StaticMembersClient StaticMembersServer StaticMembersServer + // SubgroupsServer contains the fakes for client SubgroupsClient + SubgroupsServer SubgroupsServer + // SubnetsServer contains the fakes for client SubnetsClient SubnetsServer SubnetsServer @@ -525,8 +536,10 @@ type ServerFactoryTransport struct { trAzureFirewallsServer *AzureFirewallsServerTransport trBastionHostsServer *BastionHostsServerTransport trBgpServiceCommunitiesServer *BgpServiceCommunitiesServerTransport + trCommitsServer *CommitsServerTransport trConfigurationPolicyGroupsServer *ConfigurationPolicyGroupsServerTransport trConnectionMonitorsServer *ConnectionMonitorsServerTransport + trConnectionPoliciesServer *ConnectionPoliciesServerTransport trConnectivityConfigurationsServer *ConnectivityConfigurationsServerTransport trCustomIPPrefixesServer *CustomIPPrefixesServerTransport trDdosCustomPoliciesServer *DdosCustomPoliciesServerTransport @@ -563,6 +576,7 @@ type ServerFactoryTransport struct { trIPGroupsServer *IPGroupsServerTransport trInboundNatRulesServer *InboundNatRulesServerTransport trInboundSecurityRuleServer *InboundSecurityRuleServerTransport + trInterconnectGroupsServer *InterconnectGroupsServerTransport trInterfaceIPConfigurationsServer *InterfaceIPConfigurationsServerTransport trInterfaceLoadBalancersServer *InterfaceLoadBalancersServerTransport trInterfaceTapConfigurationsServer *InterfaceTapConfigurationsServerTransport @@ -631,6 +645,7 @@ type ServerFactoryTransport struct { trServiceTagsServer *ServiceTagsServerTransport trStaticCidrsServer *StaticCidrsServerTransport trStaticMembersServer *StaticMembersServerTransport + trSubgroupsServer *SubgroupsServerTransport trSubnetsServer *SubnetsServerTransport trSubscriptionNetworkManagerConnectionsServer *SubscriptionNetworkManagerConnectionsServerTransport trUsagesServer *UsagesServerTransport @@ -683,739 +698,755 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { switch client { case "AdminRuleCollectionsClient": - initServer(s, &s.trAdminRuleCollectionsServer, func() *AdminRuleCollectionsServerTransport { + initServer(&s.trMu, &s.trAdminRuleCollectionsServer, func() *AdminRuleCollectionsServerTransport { return NewAdminRuleCollectionsServerTransport(&s.srv.AdminRuleCollectionsServer) }) resp, err = s.trAdminRuleCollectionsServer.Do(req) case "AdminRulesClient": - initServer(s, &s.trAdminRulesServer, func() *AdminRulesServerTransport { return NewAdminRulesServerTransport(&s.srv.AdminRulesServer) }) + initServer(&s.trMu, &s.trAdminRulesServer, func() *AdminRulesServerTransport { return NewAdminRulesServerTransport(&s.srv.AdminRulesServer) }) resp, err = s.trAdminRulesServer.Do(req) case "ApplicationGatewayPrivateEndpointConnectionsClient": - initServer(s, &s.trApplicationGatewayPrivateEndpointConnectionsServer, func() *ApplicationGatewayPrivateEndpointConnectionsServerTransport { + initServer(&s.trMu, &s.trApplicationGatewayPrivateEndpointConnectionsServer, func() *ApplicationGatewayPrivateEndpointConnectionsServerTransport { return NewApplicationGatewayPrivateEndpointConnectionsServerTransport(&s.srv.ApplicationGatewayPrivateEndpointConnectionsServer) }) resp, err = s.trApplicationGatewayPrivateEndpointConnectionsServer.Do(req) case "ApplicationGatewayPrivateLinkResourcesClient": - initServer(s, &s.trApplicationGatewayPrivateLinkResourcesServer, func() *ApplicationGatewayPrivateLinkResourcesServerTransport { + initServer(&s.trMu, &s.trApplicationGatewayPrivateLinkResourcesServer, func() *ApplicationGatewayPrivateLinkResourcesServerTransport { return NewApplicationGatewayPrivateLinkResourcesServerTransport(&s.srv.ApplicationGatewayPrivateLinkResourcesServer) }) resp, err = s.trApplicationGatewayPrivateLinkResourcesServer.Do(req) case "ApplicationGatewayWafDynamicManifestsClient": - initServer(s, &s.trApplicationGatewayWafDynamicManifestsServer, func() *ApplicationGatewayWafDynamicManifestsServerTransport { + initServer(&s.trMu, &s.trApplicationGatewayWafDynamicManifestsServer, func() *ApplicationGatewayWafDynamicManifestsServerTransport { return NewApplicationGatewayWafDynamicManifestsServerTransport(&s.srv.ApplicationGatewayWafDynamicManifestsServer) }) resp, err = s.trApplicationGatewayWafDynamicManifestsServer.Do(req) case "ApplicationGatewayWafDynamicManifestsDefaultClient": - initServer(s, &s.trApplicationGatewayWafDynamicManifestsDefaultServer, func() *ApplicationGatewayWafDynamicManifestsDefaultServerTransport { + initServer(&s.trMu, &s.trApplicationGatewayWafDynamicManifestsDefaultServer, func() *ApplicationGatewayWafDynamicManifestsDefaultServerTransport { return NewApplicationGatewayWafDynamicManifestsDefaultServerTransport(&s.srv.ApplicationGatewayWafDynamicManifestsDefaultServer) }) resp, err = s.trApplicationGatewayWafDynamicManifestsDefaultServer.Do(req) case "ApplicationGatewaysClient": - initServer(s, &s.trApplicationGatewaysServer, func() *ApplicationGatewaysServerTransport { + initServer(&s.trMu, &s.trApplicationGatewaysServer, func() *ApplicationGatewaysServerTransport { return NewApplicationGatewaysServerTransport(&s.srv.ApplicationGatewaysServer) }) resp, err = s.trApplicationGatewaysServer.Do(req) case "ApplicationSecurityGroupsClient": - initServer(s, &s.trApplicationSecurityGroupsServer, func() *ApplicationSecurityGroupsServerTransport { + initServer(&s.trMu, &s.trApplicationSecurityGroupsServer, func() *ApplicationSecurityGroupsServerTransport { return NewApplicationSecurityGroupsServerTransport(&s.srv.ApplicationSecurityGroupsServer) }) resp, err = s.trApplicationSecurityGroupsServer.Do(req) case "AvailableDelegationsClient": - initServer(s, &s.trAvailableDelegationsServer, func() *AvailableDelegationsServerTransport { + initServer(&s.trMu, &s.trAvailableDelegationsServer, func() *AvailableDelegationsServerTransport { return NewAvailableDelegationsServerTransport(&s.srv.AvailableDelegationsServer) }) resp, err = s.trAvailableDelegationsServer.Do(req) case "AvailableEndpointServicesClient": - initServer(s, &s.trAvailableEndpointServicesServer, func() *AvailableEndpointServicesServerTransport { + initServer(&s.trMu, &s.trAvailableEndpointServicesServer, func() *AvailableEndpointServicesServerTransport { return NewAvailableEndpointServicesServerTransport(&s.srv.AvailableEndpointServicesServer) }) resp, err = s.trAvailableEndpointServicesServer.Do(req) case "AvailablePrivateEndpointTypesClient": - initServer(s, &s.trAvailablePrivateEndpointTypesServer, func() *AvailablePrivateEndpointTypesServerTransport { + initServer(&s.trMu, &s.trAvailablePrivateEndpointTypesServer, func() *AvailablePrivateEndpointTypesServerTransport { return NewAvailablePrivateEndpointTypesServerTransport(&s.srv.AvailablePrivateEndpointTypesServer) }) resp, err = s.trAvailablePrivateEndpointTypesServer.Do(req) case "AvailableResourceGroupDelegationsClient": - initServer(s, &s.trAvailableResourceGroupDelegationsServer, func() *AvailableResourceGroupDelegationsServerTransport { + initServer(&s.trMu, &s.trAvailableResourceGroupDelegationsServer, func() *AvailableResourceGroupDelegationsServerTransport { return NewAvailableResourceGroupDelegationsServerTransport(&s.srv.AvailableResourceGroupDelegationsServer) }) resp, err = s.trAvailableResourceGroupDelegationsServer.Do(req) case "AvailableServiceAliasesClient": - initServer(s, &s.trAvailableServiceAliasesServer, func() *AvailableServiceAliasesServerTransport { + initServer(&s.trMu, &s.trAvailableServiceAliasesServer, func() *AvailableServiceAliasesServerTransport { return NewAvailableServiceAliasesServerTransport(&s.srv.AvailableServiceAliasesServer) }) resp, err = s.trAvailableServiceAliasesServer.Do(req) case "AzureFirewallFqdnTagsClient": - initServer(s, &s.trAzureFirewallFqdnTagsServer, func() *AzureFirewallFqdnTagsServerTransport { + initServer(&s.trMu, &s.trAzureFirewallFqdnTagsServer, func() *AzureFirewallFqdnTagsServerTransport { return NewAzureFirewallFqdnTagsServerTransport(&s.srv.AzureFirewallFqdnTagsServer) }) resp, err = s.trAzureFirewallFqdnTagsServer.Do(req) case "AzureFirewallsClient": - initServer(s, &s.trAzureFirewallsServer, func() *AzureFirewallsServerTransport { + initServer(&s.trMu, &s.trAzureFirewallsServer, func() *AzureFirewallsServerTransport { return NewAzureFirewallsServerTransport(&s.srv.AzureFirewallsServer) }) resp, err = s.trAzureFirewallsServer.Do(req) case "BastionHostsClient": - initServer(s, &s.trBastionHostsServer, func() *BastionHostsServerTransport { return NewBastionHostsServerTransport(&s.srv.BastionHostsServer) }) + initServer(&s.trMu, &s.trBastionHostsServer, func() *BastionHostsServerTransport { return NewBastionHostsServerTransport(&s.srv.BastionHostsServer) }) resp, err = s.trBastionHostsServer.Do(req) case "BgpServiceCommunitiesClient": - initServer(s, &s.trBgpServiceCommunitiesServer, func() *BgpServiceCommunitiesServerTransport { + initServer(&s.trMu, &s.trBgpServiceCommunitiesServer, func() *BgpServiceCommunitiesServerTransport { return NewBgpServiceCommunitiesServerTransport(&s.srv.BgpServiceCommunitiesServer) }) resp, err = s.trBgpServiceCommunitiesServer.Do(req) + case "CommitsClient": + initServer(&s.trMu, &s.trCommitsServer, func() *CommitsServerTransport { return NewCommitsServerTransport(&s.srv.CommitsServer) }) + resp, err = s.trCommitsServer.Do(req) case "ConfigurationPolicyGroupsClient": - initServer(s, &s.trConfigurationPolicyGroupsServer, func() *ConfigurationPolicyGroupsServerTransport { + initServer(&s.trMu, &s.trConfigurationPolicyGroupsServer, func() *ConfigurationPolicyGroupsServerTransport { return NewConfigurationPolicyGroupsServerTransport(&s.srv.ConfigurationPolicyGroupsServer) }) resp, err = s.trConfigurationPolicyGroupsServer.Do(req) case "ConnectionMonitorsClient": - initServer(s, &s.trConnectionMonitorsServer, func() *ConnectionMonitorsServerTransport { + initServer(&s.trMu, &s.trConnectionMonitorsServer, func() *ConnectionMonitorsServerTransport { return NewConnectionMonitorsServerTransport(&s.srv.ConnectionMonitorsServer) }) resp, err = s.trConnectionMonitorsServer.Do(req) + case "ConnectionPoliciesClient": + initServer(&s.trMu, &s.trConnectionPoliciesServer, func() *ConnectionPoliciesServerTransport { + return NewConnectionPoliciesServerTransport(&s.srv.ConnectionPoliciesServer) + }) + resp, err = s.trConnectionPoliciesServer.Do(req) case "ConnectivityConfigurationsClient": - initServer(s, &s.trConnectivityConfigurationsServer, func() *ConnectivityConfigurationsServerTransport { + initServer(&s.trMu, &s.trConnectivityConfigurationsServer, func() *ConnectivityConfigurationsServerTransport { return NewConnectivityConfigurationsServerTransport(&s.srv.ConnectivityConfigurationsServer) }) resp, err = s.trConnectivityConfigurationsServer.Do(req) case "CustomIPPrefixesClient": - initServer(s, &s.trCustomIPPrefixesServer, func() *CustomIPPrefixesServerTransport { + initServer(&s.trMu, &s.trCustomIPPrefixesServer, func() *CustomIPPrefixesServerTransport { return NewCustomIPPrefixesServerTransport(&s.srv.CustomIPPrefixesServer) }) resp, err = s.trCustomIPPrefixesServer.Do(req) case "DdosCustomPoliciesClient": - initServer(s, &s.trDdosCustomPoliciesServer, func() *DdosCustomPoliciesServerTransport { + initServer(&s.trMu, &s.trDdosCustomPoliciesServer, func() *DdosCustomPoliciesServerTransport { return NewDdosCustomPoliciesServerTransport(&s.srv.DdosCustomPoliciesServer) }) resp, err = s.trDdosCustomPoliciesServer.Do(req) case "DdosProtectionPlansClient": - initServer(s, &s.trDdosProtectionPlansServer, func() *DdosProtectionPlansServerTransport { + initServer(&s.trMu, &s.trDdosProtectionPlansServer, func() *DdosProtectionPlansServerTransport { return NewDdosProtectionPlansServerTransport(&s.srv.DdosProtectionPlansServer) }) resp, err = s.trDdosProtectionPlansServer.Do(req) case "DefaultSecurityRulesClient": - initServer(s, &s.trDefaultSecurityRulesServer, func() *DefaultSecurityRulesServerTransport { + initServer(&s.trMu, &s.trDefaultSecurityRulesServer, func() *DefaultSecurityRulesServerTransport { return NewDefaultSecurityRulesServerTransport(&s.srv.DefaultSecurityRulesServer) }) resp, err = s.trDefaultSecurityRulesServer.Do(req) case "DscpConfigurationClient": - initServer(s, &s.trDscpConfigurationServer, func() *DscpConfigurationServerTransport { + initServer(&s.trMu, &s.trDscpConfigurationServer, func() *DscpConfigurationServerTransport { return NewDscpConfigurationServerTransport(&s.srv.DscpConfigurationServer) }) resp, err = s.trDscpConfigurationServer.Do(req) case "ExpressRouteCircuitAuthorizationsClient": - initServer(s, &s.trExpressRouteCircuitAuthorizationsServer, func() *ExpressRouteCircuitAuthorizationsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCircuitAuthorizationsServer, func() *ExpressRouteCircuitAuthorizationsServerTransport { return NewExpressRouteCircuitAuthorizationsServerTransport(&s.srv.ExpressRouteCircuitAuthorizationsServer) }) resp, err = s.trExpressRouteCircuitAuthorizationsServer.Do(req) case "ExpressRouteCircuitConnectionsClient": - initServer(s, &s.trExpressRouteCircuitConnectionsServer, func() *ExpressRouteCircuitConnectionsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCircuitConnectionsServer, func() *ExpressRouteCircuitConnectionsServerTransport { return NewExpressRouteCircuitConnectionsServerTransport(&s.srv.ExpressRouteCircuitConnectionsServer) }) resp, err = s.trExpressRouteCircuitConnectionsServer.Do(req) case "ExpressRouteCircuitPeeringsClient": - initServer(s, &s.trExpressRouteCircuitPeeringsServer, func() *ExpressRouteCircuitPeeringsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCircuitPeeringsServer, func() *ExpressRouteCircuitPeeringsServerTransport { return NewExpressRouteCircuitPeeringsServerTransport(&s.srv.ExpressRouteCircuitPeeringsServer) }) resp, err = s.trExpressRouteCircuitPeeringsServer.Do(req) case "ExpressRouteCircuitsClient": - initServer(s, &s.trExpressRouteCircuitsServer, func() *ExpressRouteCircuitsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCircuitsServer, func() *ExpressRouteCircuitsServerTransport { return NewExpressRouteCircuitsServerTransport(&s.srv.ExpressRouteCircuitsServer) }) resp, err = s.trExpressRouteCircuitsServer.Do(req) case "ExpressRouteConnectionsClient": - initServer(s, &s.trExpressRouteConnectionsServer, func() *ExpressRouteConnectionsServerTransport { + initServer(&s.trMu, &s.trExpressRouteConnectionsServer, func() *ExpressRouteConnectionsServerTransport { return NewExpressRouteConnectionsServerTransport(&s.srv.ExpressRouteConnectionsServer) }) resp, err = s.trExpressRouteConnectionsServer.Do(req) case "ExpressRouteCrossConnectionPeeringsClient": - initServer(s, &s.trExpressRouteCrossConnectionPeeringsServer, func() *ExpressRouteCrossConnectionPeeringsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCrossConnectionPeeringsServer, func() *ExpressRouteCrossConnectionPeeringsServerTransport { return NewExpressRouteCrossConnectionPeeringsServerTransport(&s.srv.ExpressRouteCrossConnectionPeeringsServer) }) resp, err = s.trExpressRouteCrossConnectionPeeringsServer.Do(req) case "ExpressRouteCrossConnectionsClient": - initServer(s, &s.trExpressRouteCrossConnectionsServer, func() *ExpressRouteCrossConnectionsServerTransport { + initServer(&s.trMu, &s.trExpressRouteCrossConnectionsServer, func() *ExpressRouteCrossConnectionsServerTransport { return NewExpressRouteCrossConnectionsServerTransport(&s.srv.ExpressRouteCrossConnectionsServer) }) resp, err = s.trExpressRouteCrossConnectionsServer.Do(req) case "ExpressRouteGatewaysClient": - initServer(s, &s.trExpressRouteGatewaysServer, func() *ExpressRouteGatewaysServerTransport { + initServer(&s.trMu, &s.trExpressRouteGatewaysServer, func() *ExpressRouteGatewaysServerTransport { return NewExpressRouteGatewaysServerTransport(&s.srv.ExpressRouteGatewaysServer) }) resp, err = s.trExpressRouteGatewaysServer.Do(req) case "ExpressRouteLinksClient": - initServer(s, &s.trExpressRouteLinksServer, func() *ExpressRouteLinksServerTransport { + initServer(&s.trMu, &s.trExpressRouteLinksServer, func() *ExpressRouteLinksServerTransport { return NewExpressRouteLinksServerTransport(&s.srv.ExpressRouteLinksServer) }) resp, err = s.trExpressRouteLinksServer.Do(req) case "ExpressRoutePortAuthorizationsClient": - initServer(s, &s.trExpressRoutePortAuthorizationsServer, func() *ExpressRoutePortAuthorizationsServerTransport { + initServer(&s.trMu, &s.trExpressRoutePortAuthorizationsServer, func() *ExpressRoutePortAuthorizationsServerTransport { return NewExpressRoutePortAuthorizationsServerTransport(&s.srv.ExpressRoutePortAuthorizationsServer) }) resp, err = s.trExpressRoutePortAuthorizationsServer.Do(req) case "ExpressRoutePortsClient": - initServer(s, &s.trExpressRoutePortsServer, func() *ExpressRoutePortsServerTransport { + initServer(&s.trMu, &s.trExpressRoutePortsServer, func() *ExpressRoutePortsServerTransport { return NewExpressRoutePortsServerTransport(&s.srv.ExpressRoutePortsServer) }) resp, err = s.trExpressRoutePortsServer.Do(req) case "ExpressRoutePortsLocationsClient": - initServer(s, &s.trExpressRoutePortsLocationsServer, func() *ExpressRoutePortsLocationsServerTransport { + initServer(&s.trMu, &s.trExpressRoutePortsLocationsServer, func() *ExpressRoutePortsLocationsServerTransport { return NewExpressRoutePortsLocationsServerTransport(&s.srv.ExpressRoutePortsLocationsServer) }) resp, err = s.trExpressRoutePortsLocationsServer.Do(req) case "ExpressRouteProviderPortsLocationClient": - initServer(s, &s.trExpressRouteProviderPortsLocationServer, func() *ExpressRouteProviderPortsLocationServerTransport { + initServer(&s.trMu, &s.trExpressRouteProviderPortsLocationServer, func() *ExpressRouteProviderPortsLocationServerTransport { return NewExpressRouteProviderPortsLocationServerTransport(&s.srv.ExpressRouteProviderPortsLocationServer) }) resp, err = s.trExpressRouteProviderPortsLocationServer.Do(req) case "ExpressRouteServiceProvidersClient": - initServer(s, &s.trExpressRouteServiceProvidersServer, func() *ExpressRouteServiceProvidersServerTransport { + initServer(&s.trMu, &s.trExpressRouteServiceProvidersServer, func() *ExpressRouteServiceProvidersServerTransport { return NewExpressRouteServiceProvidersServerTransport(&s.srv.ExpressRouteServiceProvidersServer) }) resp, err = s.trExpressRouteServiceProvidersServer.Do(req) case "FirewallPoliciesClient": - initServer(s, &s.trFirewallPoliciesServer, func() *FirewallPoliciesServerTransport { + initServer(&s.trMu, &s.trFirewallPoliciesServer, func() *FirewallPoliciesServerTransport { return NewFirewallPoliciesServerTransport(&s.srv.FirewallPoliciesServer) }) resp, err = s.trFirewallPoliciesServer.Do(req) case "FirewallPolicyDeploymentsClient": - initServer(s, &s.trFirewallPolicyDeploymentsServer, func() *FirewallPolicyDeploymentsServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyDeploymentsServer, func() *FirewallPolicyDeploymentsServerTransport { return NewFirewallPolicyDeploymentsServerTransport(&s.srv.FirewallPolicyDeploymentsServer) }) resp, err = s.trFirewallPolicyDeploymentsServer.Do(req) case "FirewallPolicyDraftsClient": - initServer(s, &s.trFirewallPolicyDraftsServer, func() *FirewallPolicyDraftsServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyDraftsServer, func() *FirewallPolicyDraftsServerTransport { return NewFirewallPolicyDraftsServerTransport(&s.srv.FirewallPolicyDraftsServer) }) resp, err = s.trFirewallPolicyDraftsServer.Do(req) case "FirewallPolicyIdpsSignaturesClient": - initServer(s, &s.trFirewallPolicyIdpsSignaturesServer, func() *FirewallPolicyIdpsSignaturesServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyIdpsSignaturesServer, func() *FirewallPolicyIdpsSignaturesServerTransport { return NewFirewallPolicyIdpsSignaturesServerTransport(&s.srv.FirewallPolicyIdpsSignaturesServer) }) resp, err = s.trFirewallPolicyIdpsSignaturesServer.Do(req) case "FirewallPolicyIdpsSignaturesFilterValuesClient": - initServer(s, &s.trFirewallPolicyIdpsSignaturesFilterValuesServer, func() *FirewallPolicyIdpsSignaturesFilterValuesServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyIdpsSignaturesFilterValuesServer, func() *FirewallPolicyIdpsSignaturesFilterValuesServerTransport { return NewFirewallPolicyIdpsSignaturesFilterValuesServerTransport(&s.srv.FirewallPolicyIdpsSignaturesFilterValuesServer) }) resp, err = s.trFirewallPolicyIdpsSignaturesFilterValuesServer.Do(req) case "FirewallPolicyIdpsSignaturesOverridesClient": - initServer(s, &s.trFirewallPolicyIdpsSignaturesOverridesServer, func() *FirewallPolicyIdpsSignaturesOverridesServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyIdpsSignaturesOverridesServer, func() *FirewallPolicyIdpsSignaturesOverridesServerTransport { return NewFirewallPolicyIdpsSignaturesOverridesServerTransport(&s.srv.FirewallPolicyIdpsSignaturesOverridesServer) }) resp, err = s.trFirewallPolicyIdpsSignaturesOverridesServer.Do(req) case "FirewallPolicyRuleCollectionGroupDraftsClient": - initServer(s, &s.trFirewallPolicyRuleCollectionGroupDraftsServer, func() *FirewallPolicyRuleCollectionGroupDraftsServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyRuleCollectionGroupDraftsServer, func() *FirewallPolicyRuleCollectionGroupDraftsServerTransport { return NewFirewallPolicyRuleCollectionGroupDraftsServerTransport(&s.srv.FirewallPolicyRuleCollectionGroupDraftsServer) }) resp, err = s.trFirewallPolicyRuleCollectionGroupDraftsServer.Do(req) case "FirewallPolicyRuleCollectionGroupsClient": - initServer(s, &s.trFirewallPolicyRuleCollectionGroupsServer, func() *FirewallPolicyRuleCollectionGroupsServerTransport { + initServer(&s.trMu, &s.trFirewallPolicyRuleCollectionGroupsServer, func() *FirewallPolicyRuleCollectionGroupsServerTransport { return NewFirewallPolicyRuleCollectionGroupsServerTransport(&s.srv.FirewallPolicyRuleCollectionGroupsServer) }) resp, err = s.trFirewallPolicyRuleCollectionGroupsServer.Do(req) case "FlowLogsClient": - initServer(s, &s.trFlowLogsServer, func() *FlowLogsServerTransport { return NewFlowLogsServerTransport(&s.srv.FlowLogsServer) }) + initServer(&s.trMu, &s.trFlowLogsServer, func() *FlowLogsServerTransport { return NewFlowLogsServerTransport(&s.srv.FlowLogsServer) }) resp, err = s.trFlowLogsServer.Do(req) case "GroupsClient": - initServer(s, &s.trGroupsServer, func() *GroupsServerTransport { return NewGroupsServerTransport(&s.srv.GroupsServer) }) + initServer(&s.trMu, &s.trGroupsServer, func() *GroupsServerTransport { return NewGroupsServerTransport(&s.srv.GroupsServer) }) resp, err = s.trGroupsServer.Do(req) case "HubRouteTablesClient": - initServer(s, &s.trHubRouteTablesServer, func() *HubRouteTablesServerTransport { + initServer(&s.trMu, &s.trHubRouteTablesServer, func() *HubRouteTablesServerTransport { return NewHubRouteTablesServerTransport(&s.srv.HubRouteTablesServer) }) resp, err = s.trHubRouteTablesServer.Do(req) case "HubVirtualNetworkConnectionsClient": - initServer(s, &s.trHubVirtualNetworkConnectionsServer, func() *HubVirtualNetworkConnectionsServerTransport { + initServer(&s.trMu, &s.trHubVirtualNetworkConnectionsServer, func() *HubVirtualNetworkConnectionsServerTransport { return NewHubVirtualNetworkConnectionsServerTransport(&s.srv.HubVirtualNetworkConnectionsServer) }) resp, err = s.trHubVirtualNetworkConnectionsServer.Do(req) case "IPAllocationsClient": - initServer(s, &s.trIPAllocationsServer, func() *IPAllocationsServerTransport { + initServer(&s.trMu, &s.trIPAllocationsServer, func() *IPAllocationsServerTransport { return NewIPAllocationsServerTransport(&s.srv.IPAllocationsServer) }) resp, err = s.trIPAllocationsServer.Do(req) case "IPGroupsClient": - initServer(s, &s.trIPGroupsServer, func() *IPGroupsServerTransport { return NewIPGroupsServerTransport(&s.srv.IPGroupsServer) }) + initServer(&s.trMu, &s.trIPGroupsServer, func() *IPGroupsServerTransport { return NewIPGroupsServerTransport(&s.srv.IPGroupsServer) }) resp, err = s.trIPGroupsServer.Do(req) case "InboundNatRulesClient": - initServer(s, &s.trInboundNatRulesServer, func() *InboundNatRulesServerTransport { + initServer(&s.trMu, &s.trInboundNatRulesServer, func() *InboundNatRulesServerTransport { return NewInboundNatRulesServerTransport(&s.srv.InboundNatRulesServer) }) resp, err = s.trInboundNatRulesServer.Do(req) case "InboundSecurityRuleClient": - initServer(s, &s.trInboundSecurityRuleServer, func() *InboundSecurityRuleServerTransport { + initServer(&s.trMu, &s.trInboundSecurityRuleServer, func() *InboundSecurityRuleServerTransport { return NewInboundSecurityRuleServerTransport(&s.srv.InboundSecurityRuleServer) }) resp, err = s.trInboundSecurityRuleServer.Do(req) + case "InterconnectGroupsClient": + initServer(&s.trMu, &s.trInterconnectGroupsServer, func() *InterconnectGroupsServerTransport { + return NewInterconnectGroupsServerTransport(&s.srv.InterconnectGroupsServer) + }) + resp, err = s.trInterconnectGroupsServer.Do(req) case "InterfaceIPConfigurationsClient": - initServer(s, &s.trInterfaceIPConfigurationsServer, func() *InterfaceIPConfigurationsServerTransport { + initServer(&s.trMu, &s.trInterfaceIPConfigurationsServer, func() *InterfaceIPConfigurationsServerTransport { return NewInterfaceIPConfigurationsServerTransport(&s.srv.InterfaceIPConfigurationsServer) }) resp, err = s.trInterfaceIPConfigurationsServer.Do(req) case "InterfaceLoadBalancersClient": - initServer(s, &s.trInterfaceLoadBalancersServer, func() *InterfaceLoadBalancersServerTransport { + initServer(&s.trMu, &s.trInterfaceLoadBalancersServer, func() *InterfaceLoadBalancersServerTransport { return NewInterfaceLoadBalancersServerTransport(&s.srv.InterfaceLoadBalancersServer) }) resp, err = s.trInterfaceLoadBalancersServer.Do(req) case "InterfaceTapConfigurationsClient": - initServer(s, &s.trInterfaceTapConfigurationsServer, func() *InterfaceTapConfigurationsServerTransport { + initServer(&s.trMu, &s.trInterfaceTapConfigurationsServer, func() *InterfaceTapConfigurationsServerTransport { return NewInterfaceTapConfigurationsServerTransport(&s.srv.InterfaceTapConfigurationsServer) }) resp, err = s.trInterfaceTapConfigurationsServer.Do(req) case "InterfacesClient": - initServer(s, &s.trInterfacesServer, func() *InterfacesServerTransport { return NewInterfacesServerTransport(&s.srv.InterfacesServer) }) + initServer(&s.trMu, &s.trInterfacesServer, func() *InterfacesServerTransport { return NewInterfacesServerTransport(&s.srv.InterfacesServer) }) resp, err = s.trInterfacesServer.Do(req) case "IpamPoolsClient": - initServer(s, &s.trIpamPoolsServer, func() *IpamPoolsServerTransport { return NewIpamPoolsServerTransport(&s.srv.IpamPoolsServer) }) + initServer(&s.trMu, &s.trIpamPoolsServer, func() *IpamPoolsServerTransport { return NewIpamPoolsServerTransport(&s.srv.IpamPoolsServer) }) resp, err = s.trIpamPoolsServer.Do(req) case "LoadBalancerBackendAddressPoolsClient": - initServer(s, &s.trLoadBalancerBackendAddressPoolsServer, func() *LoadBalancerBackendAddressPoolsServerTransport { + initServer(&s.trMu, &s.trLoadBalancerBackendAddressPoolsServer, func() *LoadBalancerBackendAddressPoolsServerTransport { return NewLoadBalancerBackendAddressPoolsServerTransport(&s.srv.LoadBalancerBackendAddressPoolsServer) }) resp, err = s.trLoadBalancerBackendAddressPoolsServer.Do(req) case "LoadBalancerFrontendIPConfigurationsClient": - initServer(s, &s.trLoadBalancerFrontendIPConfigurationsServer, func() *LoadBalancerFrontendIPConfigurationsServerTransport { + initServer(&s.trMu, &s.trLoadBalancerFrontendIPConfigurationsServer, func() *LoadBalancerFrontendIPConfigurationsServerTransport { return NewLoadBalancerFrontendIPConfigurationsServerTransport(&s.srv.LoadBalancerFrontendIPConfigurationsServer) }) resp, err = s.trLoadBalancerFrontendIPConfigurationsServer.Do(req) case "LoadBalancerLoadBalancingRulesClient": - initServer(s, &s.trLoadBalancerLoadBalancingRulesServer, func() *LoadBalancerLoadBalancingRulesServerTransport { + initServer(&s.trMu, &s.trLoadBalancerLoadBalancingRulesServer, func() *LoadBalancerLoadBalancingRulesServerTransport { return NewLoadBalancerLoadBalancingRulesServerTransport(&s.srv.LoadBalancerLoadBalancingRulesServer) }) resp, err = s.trLoadBalancerLoadBalancingRulesServer.Do(req) case "LoadBalancerNetworkInterfacesClient": - initServer(s, &s.trLoadBalancerNetworkInterfacesServer, func() *LoadBalancerNetworkInterfacesServerTransport { + initServer(&s.trMu, &s.trLoadBalancerNetworkInterfacesServer, func() *LoadBalancerNetworkInterfacesServerTransport { return NewLoadBalancerNetworkInterfacesServerTransport(&s.srv.LoadBalancerNetworkInterfacesServer) }) resp, err = s.trLoadBalancerNetworkInterfacesServer.Do(req) case "LoadBalancerOutboundRulesClient": - initServer(s, &s.trLoadBalancerOutboundRulesServer, func() *LoadBalancerOutboundRulesServerTransport { + initServer(&s.trMu, &s.trLoadBalancerOutboundRulesServer, func() *LoadBalancerOutboundRulesServerTransport { return NewLoadBalancerOutboundRulesServerTransport(&s.srv.LoadBalancerOutboundRulesServer) }) resp, err = s.trLoadBalancerOutboundRulesServer.Do(req) case "LoadBalancerProbesClient": - initServer(s, &s.trLoadBalancerProbesServer, func() *LoadBalancerProbesServerTransport { + initServer(&s.trMu, &s.trLoadBalancerProbesServer, func() *LoadBalancerProbesServerTransport { return NewLoadBalancerProbesServerTransport(&s.srv.LoadBalancerProbesServer) }) resp, err = s.trLoadBalancerProbesServer.Do(req) case "LoadBalancersClient": - initServer(s, &s.trLoadBalancersServer, func() *LoadBalancersServerTransport { + initServer(&s.trMu, &s.trLoadBalancersServer, func() *LoadBalancersServerTransport { return NewLoadBalancersServerTransport(&s.srv.LoadBalancersServer) }) resp, err = s.trLoadBalancersServer.Do(req) case "LocalNetworkGatewaysClient": - initServer(s, &s.trLocalNetworkGatewaysServer, func() *LocalNetworkGatewaysServerTransport { + initServer(&s.trMu, &s.trLocalNetworkGatewaysServer, func() *LocalNetworkGatewaysServerTransport { return NewLocalNetworkGatewaysServerTransport(&s.srv.LocalNetworkGatewaysServer) }) resp, err = s.trLocalNetworkGatewaysServer.Do(req) case "ManagementClient": - initServer(s, &s.trManagementServer, func() *ManagementServerTransport { return NewManagementServerTransport(&s.srv.ManagementServer) }) + initServer(&s.trMu, &s.trManagementServer, func() *ManagementServerTransport { return NewManagementServerTransport(&s.srv.ManagementServer) }) resp, err = s.trManagementServer.Do(req) case "ManagementGroupNetworkManagerConnectionsClient": - initServer(s, &s.trManagementGroupNetworkManagerConnectionsServer, func() *ManagementGroupNetworkManagerConnectionsServerTransport { + initServer(&s.trMu, &s.trManagementGroupNetworkManagerConnectionsServer, func() *ManagementGroupNetworkManagerConnectionsServerTransport { return NewManagementGroupNetworkManagerConnectionsServerTransport(&s.srv.ManagementGroupNetworkManagerConnectionsServer) }) resp, err = s.trManagementGroupNetworkManagerConnectionsServer.Do(req) case "ManagerCommitsClient": - initServer(s, &s.trManagerCommitsServer, func() *ManagerCommitsServerTransport { + initServer(&s.trMu, &s.trManagerCommitsServer, func() *ManagerCommitsServerTransport { return NewManagerCommitsServerTransport(&s.srv.ManagerCommitsServer) }) resp, err = s.trManagerCommitsServer.Do(req) case "ManagerDeploymentStatusClient": - initServer(s, &s.trManagerDeploymentStatusServer, func() *ManagerDeploymentStatusServerTransport { + initServer(&s.trMu, &s.trManagerDeploymentStatusServer, func() *ManagerDeploymentStatusServerTransport { return NewManagerDeploymentStatusServerTransport(&s.srv.ManagerDeploymentStatusServer) }) resp, err = s.trManagerDeploymentStatusServer.Do(req) case "ManagerRoutingConfigurationsClient": - initServer(s, &s.trManagerRoutingConfigurationsServer, func() *ManagerRoutingConfigurationsServerTransport { + initServer(&s.trMu, &s.trManagerRoutingConfigurationsServer, func() *ManagerRoutingConfigurationsServerTransport { return NewManagerRoutingConfigurationsServerTransport(&s.srv.ManagerRoutingConfigurationsServer) }) resp, err = s.trManagerRoutingConfigurationsServer.Do(req) case "ManagersClient": - initServer(s, &s.trManagersServer, func() *ManagersServerTransport { return NewManagersServerTransport(&s.srv.ManagersServer) }) + initServer(&s.trMu, &s.trManagersServer, func() *ManagersServerTransport { return NewManagersServerTransport(&s.srv.ManagersServer) }) resp, err = s.trManagersServer.Do(req) case "NatGatewaysClient": - initServer(s, &s.trNatGatewaysServer, func() *NatGatewaysServerTransport { return NewNatGatewaysServerTransport(&s.srv.NatGatewaysServer) }) + initServer(&s.trMu, &s.trNatGatewaysServer, func() *NatGatewaysServerTransport { return NewNatGatewaysServerTransport(&s.srv.NatGatewaysServer) }) resp, err = s.trNatGatewaysServer.Do(req) case "NatRulesClient": - initServer(s, &s.trNatRulesServer, func() *NatRulesServerTransport { return NewNatRulesServerTransport(&s.srv.NatRulesServer) }) + initServer(&s.trMu, &s.trNatRulesServer, func() *NatRulesServerTransport { return NewNatRulesServerTransport(&s.srv.NatRulesServer) }) resp, err = s.trNatRulesServer.Do(req) case "OperationsClient": - initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + initServer(&s.trMu, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) case "P2SVPNGatewaysClient": - initServer(s, &s.trP2SVPNGatewaysServer, func() *P2SVPNGatewaysServerTransport { + initServer(&s.trMu, &s.trP2SVPNGatewaysServer, func() *P2SVPNGatewaysServerTransport { return NewP2SVPNGatewaysServerTransport(&s.srv.P2SVPNGatewaysServer) }) resp, err = s.trP2SVPNGatewaysServer.Do(req) case "PacketCapturesClient": - initServer(s, &s.trPacketCapturesServer, func() *PacketCapturesServerTransport { + initServer(&s.trMu, &s.trPacketCapturesServer, func() *PacketCapturesServerTransport { return NewPacketCapturesServerTransport(&s.srv.PacketCapturesServer) }) resp, err = s.trPacketCapturesServer.Do(req) case "PeerExpressRouteCircuitConnectionsClient": - initServer(s, &s.trPeerExpressRouteCircuitConnectionsServer, func() *PeerExpressRouteCircuitConnectionsServerTransport { + initServer(&s.trMu, &s.trPeerExpressRouteCircuitConnectionsServer, func() *PeerExpressRouteCircuitConnectionsServerTransport { return NewPeerExpressRouteCircuitConnectionsServerTransport(&s.srv.PeerExpressRouteCircuitConnectionsServer) }) resp, err = s.trPeerExpressRouteCircuitConnectionsServer.Do(req) case "PrivateDNSZoneGroupsClient": - initServer(s, &s.trPrivateDNSZoneGroupsServer, func() *PrivateDNSZoneGroupsServerTransport { + initServer(&s.trMu, &s.trPrivateDNSZoneGroupsServer, func() *PrivateDNSZoneGroupsServerTransport { return NewPrivateDNSZoneGroupsServerTransport(&s.srv.PrivateDNSZoneGroupsServer) }) resp, err = s.trPrivateDNSZoneGroupsServer.Do(req) case "PrivateEndpointsClient": - initServer(s, &s.trPrivateEndpointsServer, func() *PrivateEndpointsServerTransport { + initServer(&s.trMu, &s.trPrivateEndpointsServer, func() *PrivateEndpointsServerTransport { return NewPrivateEndpointsServerTransport(&s.srv.PrivateEndpointsServer) }) resp, err = s.trPrivateEndpointsServer.Do(req) case "PrivateLinkServicesClient": - initServer(s, &s.trPrivateLinkServicesServer, func() *PrivateLinkServicesServerTransport { + initServer(&s.trMu, &s.trPrivateLinkServicesServer, func() *PrivateLinkServicesServerTransport { return NewPrivateLinkServicesServerTransport(&s.srv.PrivateLinkServicesServer) }) resp, err = s.trPrivateLinkServicesServer.Do(req) case "ProfilesClient": - initServer(s, &s.trProfilesServer, func() *ProfilesServerTransport { return NewProfilesServerTransport(&s.srv.ProfilesServer) }) + initServer(&s.trMu, &s.trProfilesServer, func() *ProfilesServerTransport { return NewProfilesServerTransport(&s.srv.ProfilesServer) }) resp, err = s.trProfilesServer.Do(req) case "PublicIPAddressesClient": - initServer(s, &s.trPublicIPAddressesServer, func() *PublicIPAddressesServerTransport { + initServer(&s.trMu, &s.trPublicIPAddressesServer, func() *PublicIPAddressesServerTransport { return NewPublicIPAddressesServerTransport(&s.srv.PublicIPAddressesServer) }) resp, err = s.trPublicIPAddressesServer.Do(req) case "PublicIPPrefixesClient": - initServer(s, &s.trPublicIPPrefixesServer, func() *PublicIPPrefixesServerTransport { + initServer(&s.trMu, &s.trPublicIPPrefixesServer, func() *PublicIPPrefixesServerTransport { return NewPublicIPPrefixesServerTransport(&s.srv.PublicIPPrefixesServer) }) resp, err = s.trPublicIPPrefixesServer.Do(req) case "ReachabilityAnalysisIntentsClient": - initServer(s, &s.trReachabilityAnalysisIntentsServer, func() *ReachabilityAnalysisIntentsServerTransport { + initServer(&s.trMu, &s.trReachabilityAnalysisIntentsServer, func() *ReachabilityAnalysisIntentsServerTransport { return NewReachabilityAnalysisIntentsServerTransport(&s.srv.ReachabilityAnalysisIntentsServer) }) resp, err = s.trReachabilityAnalysisIntentsServer.Do(req) case "ReachabilityAnalysisRunsClient": - initServer(s, &s.trReachabilityAnalysisRunsServer, func() *ReachabilityAnalysisRunsServerTransport { + initServer(&s.trMu, &s.trReachabilityAnalysisRunsServer, func() *ReachabilityAnalysisRunsServerTransport { return NewReachabilityAnalysisRunsServerTransport(&s.srv.ReachabilityAnalysisRunsServer) }) resp, err = s.trReachabilityAnalysisRunsServer.Do(req) case "ResourceNavigationLinksClient": - initServer(s, &s.trResourceNavigationLinksServer, func() *ResourceNavigationLinksServerTransport { + initServer(&s.trMu, &s.trResourceNavigationLinksServer, func() *ResourceNavigationLinksServerTransport { return NewResourceNavigationLinksServerTransport(&s.srv.ResourceNavigationLinksServer) }) resp, err = s.trResourceNavigationLinksServer.Do(req) case "RouteFilterRulesClient": - initServer(s, &s.trRouteFilterRulesServer, func() *RouteFilterRulesServerTransport { + initServer(&s.trMu, &s.trRouteFilterRulesServer, func() *RouteFilterRulesServerTransport { return NewRouteFilterRulesServerTransport(&s.srv.RouteFilterRulesServer) }) resp, err = s.trRouteFilterRulesServer.Do(req) case "RouteFiltersClient": - initServer(s, &s.trRouteFiltersServer, func() *RouteFiltersServerTransport { return NewRouteFiltersServerTransport(&s.srv.RouteFiltersServer) }) + initServer(&s.trMu, &s.trRouteFiltersServer, func() *RouteFiltersServerTransport { return NewRouteFiltersServerTransport(&s.srv.RouteFiltersServer) }) resp, err = s.trRouteFiltersServer.Do(req) case "RouteMapsClient": - initServer(s, &s.trRouteMapsServer, func() *RouteMapsServerTransport { return NewRouteMapsServerTransport(&s.srv.RouteMapsServer) }) + initServer(&s.trMu, &s.trRouteMapsServer, func() *RouteMapsServerTransport { return NewRouteMapsServerTransport(&s.srv.RouteMapsServer) }) resp, err = s.trRouteMapsServer.Do(req) case "RouteTablesClient": - initServer(s, &s.trRouteTablesServer, func() *RouteTablesServerTransport { return NewRouteTablesServerTransport(&s.srv.RouteTablesServer) }) + initServer(&s.trMu, &s.trRouteTablesServer, func() *RouteTablesServerTransport { return NewRouteTablesServerTransport(&s.srv.RouteTablesServer) }) resp, err = s.trRouteTablesServer.Do(req) case "RoutesClient": - initServer(s, &s.trRoutesServer, func() *RoutesServerTransport { return NewRoutesServerTransport(&s.srv.RoutesServer) }) + initServer(&s.trMu, &s.trRoutesServer, func() *RoutesServerTransport { return NewRoutesServerTransport(&s.srv.RoutesServer) }) resp, err = s.trRoutesServer.Do(req) case "RoutingIntentClient": - initServer(s, &s.trRoutingIntentServer, func() *RoutingIntentServerTransport { + initServer(&s.trMu, &s.trRoutingIntentServer, func() *RoutingIntentServerTransport { return NewRoutingIntentServerTransport(&s.srv.RoutingIntentServer) }) resp, err = s.trRoutingIntentServer.Do(req) case "RoutingRuleCollectionsClient": - initServer(s, &s.trRoutingRuleCollectionsServer, func() *RoutingRuleCollectionsServerTransport { + initServer(&s.trMu, &s.trRoutingRuleCollectionsServer, func() *RoutingRuleCollectionsServerTransport { return NewRoutingRuleCollectionsServerTransport(&s.srv.RoutingRuleCollectionsServer) }) resp, err = s.trRoutingRuleCollectionsServer.Do(req) case "RoutingRulesClient": - initServer(s, &s.trRoutingRulesServer, func() *RoutingRulesServerTransport { return NewRoutingRulesServerTransport(&s.srv.RoutingRulesServer) }) + initServer(&s.trMu, &s.trRoutingRulesServer, func() *RoutingRulesServerTransport { return NewRoutingRulesServerTransport(&s.srv.RoutingRulesServer) }) resp, err = s.trRoutingRulesServer.Do(req) case "ScopeConnectionsClient": - initServer(s, &s.trScopeConnectionsServer, func() *ScopeConnectionsServerTransport { + initServer(&s.trMu, &s.trScopeConnectionsServer, func() *ScopeConnectionsServerTransport { return NewScopeConnectionsServerTransport(&s.srv.ScopeConnectionsServer) }) resp, err = s.trScopeConnectionsServer.Do(req) case "SecurityAdminConfigurationsClient": - initServer(s, &s.trSecurityAdminConfigurationsServer, func() *SecurityAdminConfigurationsServerTransport { + initServer(&s.trMu, &s.trSecurityAdminConfigurationsServer, func() *SecurityAdminConfigurationsServerTransport { return NewSecurityAdminConfigurationsServerTransport(&s.srv.SecurityAdminConfigurationsServer) }) resp, err = s.trSecurityAdminConfigurationsServer.Do(req) case "SecurityGroupsClient": - initServer(s, &s.trSecurityGroupsServer, func() *SecurityGroupsServerTransport { + initServer(&s.trMu, &s.trSecurityGroupsServer, func() *SecurityGroupsServerTransport { return NewSecurityGroupsServerTransport(&s.srv.SecurityGroupsServer) }) resp, err = s.trSecurityGroupsServer.Do(req) case "SecurityPartnerProvidersClient": - initServer(s, &s.trSecurityPartnerProvidersServer, func() *SecurityPartnerProvidersServerTransport { + initServer(&s.trMu, &s.trSecurityPartnerProvidersServer, func() *SecurityPartnerProvidersServerTransport { return NewSecurityPartnerProvidersServerTransport(&s.srv.SecurityPartnerProvidersServer) }) resp, err = s.trSecurityPartnerProvidersServer.Do(req) case "SecurityPerimeterAccessRulesClient": - initServer(s, &s.trSecurityPerimeterAccessRulesServer, func() *SecurityPerimeterAccessRulesServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterAccessRulesServer, func() *SecurityPerimeterAccessRulesServerTransport { return NewSecurityPerimeterAccessRulesServerTransport(&s.srv.SecurityPerimeterAccessRulesServer) }) resp, err = s.trSecurityPerimeterAccessRulesServer.Do(req) case "SecurityPerimeterAssociableResourceTypesClient": - initServer(s, &s.trSecurityPerimeterAssociableResourceTypesServer, func() *SecurityPerimeterAssociableResourceTypesServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterAssociableResourceTypesServer, func() *SecurityPerimeterAssociableResourceTypesServerTransport { return NewSecurityPerimeterAssociableResourceTypesServerTransport(&s.srv.SecurityPerimeterAssociableResourceTypesServer) }) resp, err = s.trSecurityPerimeterAssociableResourceTypesServer.Do(req) case "SecurityPerimeterAssociationsClient": - initServer(s, &s.trSecurityPerimeterAssociationsServer, func() *SecurityPerimeterAssociationsServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterAssociationsServer, func() *SecurityPerimeterAssociationsServerTransport { return NewSecurityPerimeterAssociationsServerTransport(&s.srv.SecurityPerimeterAssociationsServer) }) resp, err = s.trSecurityPerimeterAssociationsServer.Do(req) case "SecurityPerimeterLinkReferencesClient": - initServer(s, &s.trSecurityPerimeterLinkReferencesServer, func() *SecurityPerimeterLinkReferencesServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterLinkReferencesServer, func() *SecurityPerimeterLinkReferencesServerTransport { return NewSecurityPerimeterLinkReferencesServerTransport(&s.srv.SecurityPerimeterLinkReferencesServer) }) resp, err = s.trSecurityPerimeterLinkReferencesServer.Do(req) case "SecurityPerimeterLinksClient": - initServer(s, &s.trSecurityPerimeterLinksServer, func() *SecurityPerimeterLinksServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterLinksServer, func() *SecurityPerimeterLinksServerTransport { return NewSecurityPerimeterLinksServerTransport(&s.srv.SecurityPerimeterLinksServer) }) resp, err = s.trSecurityPerimeterLinksServer.Do(req) case "SecurityPerimeterLoggingConfigurationsClient": - initServer(s, &s.trSecurityPerimeterLoggingConfigurationsServer, func() *SecurityPerimeterLoggingConfigurationsServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterLoggingConfigurationsServer, func() *SecurityPerimeterLoggingConfigurationsServerTransport { return NewSecurityPerimeterLoggingConfigurationsServerTransport(&s.srv.SecurityPerimeterLoggingConfigurationsServer) }) resp, err = s.trSecurityPerimeterLoggingConfigurationsServer.Do(req) case "SecurityPerimeterOperationStatusesClient": - initServer(s, &s.trSecurityPerimeterOperationStatusesServer, func() *SecurityPerimeterOperationStatusesServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterOperationStatusesServer, func() *SecurityPerimeterOperationStatusesServerTransport { return NewSecurityPerimeterOperationStatusesServerTransport(&s.srv.SecurityPerimeterOperationStatusesServer) }) resp, err = s.trSecurityPerimeterOperationStatusesServer.Do(req) case "SecurityPerimeterProfilesClient": - initServer(s, &s.trSecurityPerimeterProfilesServer, func() *SecurityPerimeterProfilesServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterProfilesServer, func() *SecurityPerimeterProfilesServerTransport { return NewSecurityPerimeterProfilesServerTransport(&s.srv.SecurityPerimeterProfilesServer) }) resp, err = s.trSecurityPerimeterProfilesServer.Do(req) case "SecurityPerimeterServiceTagsClient": - initServer(s, &s.trSecurityPerimeterServiceTagsServer, func() *SecurityPerimeterServiceTagsServerTransport { + initServer(&s.trMu, &s.trSecurityPerimeterServiceTagsServer, func() *SecurityPerimeterServiceTagsServerTransport { return NewSecurityPerimeterServiceTagsServerTransport(&s.srv.SecurityPerimeterServiceTagsServer) }) resp, err = s.trSecurityPerimeterServiceTagsServer.Do(req) case "SecurityPerimetersClient": - initServer(s, &s.trSecurityPerimetersServer, func() *SecurityPerimetersServerTransport { + initServer(&s.trMu, &s.trSecurityPerimetersServer, func() *SecurityPerimetersServerTransport { return NewSecurityPerimetersServerTransport(&s.srv.SecurityPerimetersServer) }) resp, err = s.trSecurityPerimetersServer.Do(req) case "SecurityRulesClient": - initServer(s, &s.trSecurityRulesServer, func() *SecurityRulesServerTransport { + initServer(&s.trMu, &s.trSecurityRulesServer, func() *SecurityRulesServerTransport { return NewSecurityRulesServerTransport(&s.srv.SecurityRulesServer) }) resp, err = s.trSecurityRulesServer.Do(req) case "SecurityUserConfigurationsClient": - initServer(s, &s.trSecurityUserConfigurationsServer, func() *SecurityUserConfigurationsServerTransport { + initServer(&s.trMu, &s.trSecurityUserConfigurationsServer, func() *SecurityUserConfigurationsServerTransport { return NewSecurityUserConfigurationsServerTransport(&s.srv.SecurityUserConfigurationsServer) }) resp, err = s.trSecurityUserConfigurationsServer.Do(req) case "SecurityUserRuleCollectionsClient": - initServer(s, &s.trSecurityUserRuleCollectionsServer, func() *SecurityUserRuleCollectionsServerTransport { + initServer(&s.trMu, &s.trSecurityUserRuleCollectionsServer, func() *SecurityUserRuleCollectionsServerTransport { return NewSecurityUserRuleCollectionsServerTransport(&s.srv.SecurityUserRuleCollectionsServer) }) resp, err = s.trSecurityUserRuleCollectionsServer.Do(req) case "SecurityUserRulesClient": - initServer(s, &s.trSecurityUserRulesServer, func() *SecurityUserRulesServerTransport { + initServer(&s.trMu, &s.trSecurityUserRulesServer, func() *SecurityUserRulesServerTransport { return NewSecurityUserRulesServerTransport(&s.srv.SecurityUserRulesServer) }) resp, err = s.trSecurityUserRulesServer.Do(req) case "ServiceAssociationLinksClient": - initServer(s, &s.trServiceAssociationLinksServer, func() *ServiceAssociationLinksServerTransport { + initServer(&s.trMu, &s.trServiceAssociationLinksServer, func() *ServiceAssociationLinksServerTransport { return NewServiceAssociationLinksServerTransport(&s.srv.ServiceAssociationLinksServer) }) resp, err = s.trServiceAssociationLinksServer.Do(req) case "ServiceEndpointPoliciesClient": - initServer(s, &s.trServiceEndpointPoliciesServer, func() *ServiceEndpointPoliciesServerTransport { + initServer(&s.trMu, &s.trServiceEndpointPoliciesServer, func() *ServiceEndpointPoliciesServerTransport { return NewServiceEndpointPoliciesServerTransport(&s.srv.ServiceEndpointPoliciesServer) }) resp, err = s.trServiceEndpointPoliciesServer.Do(req) case "ServiceEndpointPolicyDefinitionsClient": - initServer(s, &s.trServiceEndpointPolicyDefinitionsServer, func() *ServiceEndpointPolicyDefinitionsServerTransport { + initServer(&s.trMu, &s.trServiceEndpointPolicyDefinitionsServer, func() *ServiceEndpointPolicyDefinitionsServerTransport { return NewServiceEndpointPolicyDefinitionsServerTransport(&s.srv.ServiceEndpointPolicyDefinitionsServer) }) resp, err = s.trServiceEndpointPolicyDefinitionsServer.Do(req) case "ServiceGatewaysClient": - initServer(s, &s.trServiceGatewaysServer, func() *ServiceGatewaysServerTransport { + initServer(&s.trMu, &s.trServiceGatewaysServer, func() *ServiceGatewaysServerTransport { return NewServiceGatewaysServerTransport(&s.srv.ServiceGatewaysServer) }) resp, err = s.trServiceGatewaysServer.Do(req) case "ServiceTagInformationClient": - initServer(s, &s.trServiceTagInformationServer, func() *ServiceTagInformationServerTransport { + initServer(&s.trMu, &s.trServiceTagInformationServer, func() *ServiceTagInformationServerTransport { return NewServiceTagInformationServerTransport(&s.srv.ServiceTagInformationServer) }) resp, err = s.trServiceTagInformationServer.Do(req) case "ServiceTagsClient": - initServer(s, &s.trServiceTagsServer, func() *ServiceTagsServerTransport { return NewServiceTagsServerTransport(&s.srv.ServiceTagsServer) }) + initServer(&s.trMu, &s.trServiceTagsServer, func() *ServiceTagsServerTransport { return NewServiceTagsServerTransport(&s.srv.ServiceTagsServer) }) resp, err = s.trServiceTagsServer.Do(req) case "StaticCidrsClient": - initServer(s, &s.trStaticCidrsServer, func() *StaticCidrsServerTransport { return NewStaticCidrsServerTransport(&s.srv.StaticCidrsServer) }) + initServer(&s.trMu, &s.trStaticCidrsServer, func() *StaticCidrsServerTransport { return NewStaticCidrsServerTransport(&s.srv.StaticCidrsServer) }) resp, err = s.trStaticCidrsServer.Do(req) case "StaticMembersClient": - initServer(s, &s.trStaticMembersServer, func() *StaticMembersServerTransport { + initServer(&s.trMu, &s.trStaticMembersServer, func() *StaticMembersServerTransport { return NewStaticMembersServerTransport(&s.srv.StaticMembersServer) }) resp, err = s.trStaticMembersServer.Do(req) + case "SubgroupsClient": + initServer(&s.trMu, &s.trSubgroupsServer, func() *SubgroupsServerTransport { return NewSubgroupsServerTransport(&s.srv.SubgroupsServer) }) + resp, err = s.trSubgroupsServer.Do(req) case "SubnetsClient": - initServer(s, &s.trSubnetsServer, func() *SubnetsServerTransport { return NewSubnetsServerTransport(&s.srv.SubnetsServer) }) + initServer(&s.trMu, &s.trSubnetsServer, func() *SubnetsServerTransport { return NewSubnetsServerTransport(&s.srv.SubnetsServer) }) resp, err = s.trSubnetsServer.Do(req) case "SubscriptionNetworkManagerConnectionsClient": - initServer(s, &s.trSubscriptionNetworkManagerConnectionsServer, func() *SubscriptionNetworkManagerConnectionsServerTransport { + initServer(&s.trMu, &s.trSubscriptionNetworkManagerConnectionsServer, func() *SubscriptionNetworkManagerConnectionsServerTransport { return NewSubscriptionNetworkManagerConnectionsServerTransport(&s.srv.SubscriptionNetworkManagerConnectionsServer) }) resp, err = s.trSubscriptionNetworkManagerConnectionsServer.Do(req) case "UsagesClient": - initServer(s, &s.trUsagesServer, func() *UsagesServerTransport { return NewUsagesServerTransport(&s.srv.UsagesServer) }) + initServer(&s.trMu, &s.trUsagesServer, func() *UsagesServerTransport { return NewUsagesServerTransport(&s.srv.UsagesServer) }) resp, err = s.trUsagesServer.Do(req) case "VPNConnectionsClient": - initServer(s, &s.trVPNConnectionsServer, func() *VPNConnectionsServerTransport { + initServer(&s.trMu, &s.trVPNConnectionsServer, func() *VPNConnectionsServerTransport { return NewVPNConnectionsServerTransport(&s.srv.VPNConnectionsServer) }) resp, err = s.trVPNConnectionsServer.Do(req) case "VPNGatewaysClient": - initServer(s, &s.trVPNGatewaysServer, func() *VPNGatewaysServerTransport { return NewVPNGatewaysServerTransport(&s.srv.VPNGatewaysServer) }) + initServer(&s.trMu, &s.trVPNGatewaysServer, func() *VPNGatewaysServerTransport { return NewVPNGatewaysServerTransport(&s.srv.VPNGatewaysServer) }) resp, err = s.trVPNGatewaysServer.Do(req) case "VPNLinkConnectionsClient": - initServer(s, &s.trVPNLinkConnectionsServer, func() *VPNLinkConnectionsServerTransport { + initServer(&s.trMu, &s.trVPNLinkConnectionsServer, func() *VPNLinkConnectionsServerTransport { return NewVPNLinkConnectionsServerTransport(&s.srv.VPNLinkConnectionsServer) }) resp, err = s.trVPNLinkConnectionsServer.Do(req) case "VPNServerConfigurationsAssociatedWithVirtualWanClient": - initServer(s, &s.trVPNServerConfigurationsAssociatedWithVirtualWanServer, func() *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport { + initServer(&s.trMu, &s.trVPNServerConfigurationsAssociatedWithVirtualWanServer, func() *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport { return NewVPNServerConfigurationsAssociatedWithVirtualWanServerTransport(&s.srv.VPNServerConfigurationsAssociatedWithVirtualWanServer) }) resp, err = s.trVPNServerConfigurationsAssociatedWithVirtualWanServer.Do(req) case "VPNServerConfigurationsClient": - initServer(s, &s.trVPNServerConfigurationsServer, func() *VPNServerConfigurationsServerTransport { + initServer(&s.trMu, &s.trVPNServerConfigurationsServer, func() *VPNServerConfigurationsServerTransport { return NewVPNServerConfigurationsServerTransport(&s.srv.VPNServerConfigurationsServer) }) resp, err = s.trVPNServerConfigurationsServer.Do(req) case "VPNSiteLinkConnectionsClient": - initServer(s, &s.trVPNSiteLinkConnectionsServer, func() *VPNSiteLinkConnectionsServerTransport { + initServer(&s.trMu, &s.trVPNSiteLinkConnectionsServer, func() *VPNSiteLinkConnectionsServerTransport { return NewVPNSiteLinkConnectionsServerTransport(&s.srv.VPNSiteLinkConnectionsServer) }) resp, err = s.trVPNSiteLinkConnectionsServer.Do(req) case "VPNSiteLinksClient": - initServer(s, &s.trVPNSiteLinksServer, func() *VPNSiteLinksServerTransport { return NewVPNSiteLinksServerTransport(&s.srv.VPNSiteLinksServer) }) + initServer(&s.trMu, &s.trVPNSiteLinksServer, func() *VPNSiteLinksServerTransport { return NewVPNSiteLinksServerTransport(&s.srv.VPNSiteLinksServer) }) resp, err = s.trVPNSiteLinksServer.Do(req) case "VPNSitesClient": - initServer(s, &s.trVPNSitesServer, func() *VPNSitesServerTransport { return NewVPNSitesServerTransport(&s.srv.VPNSitesServer) }) + initServer(&s.trMu, &s.trVPNSitesServer, func() *VPNSitesServerTransport { return NewVPNSitesServerTransport(&s.srv.VPNSitesServer) }) resp, err = s.trVPNSitesServer.Do(req) case "VPNSitesConfigurationClient": - initServer(s, &s.trVPNSitesConfigurationServer, func() *VPNSitesConfigurationServerTransport { + initServer(&s.trMu, &s.trVPNSitesConfigurationServer, func() *VPNSitesConfigurationServerTransport { return NewVPNSitesConfigurationServerTransport(&s.srv.VPNSitesConfigurationServer) }) resp, err = s.trVPNSitesConfigurationServer.Do(req) case "VerifierWorkspacesClient": - initServer(s, &s.trVerifierWorkspacesServer, func() *VerifierWorkspacesServerTransport { + initServer(&s.trMu, &s.trVerifierWorkspacesServer, func() *VerifierWorkspacesServerTransport { return NewVerifierWorkspacesServerTransport(&s.srv.VerifierWorkspacesServer) }) resp, err = s.trVerifierWorkspacesServer.Do(req) case "VipSwapClient": - initServer(s, &s.trVipSwapServer, func() *VipSwapServerTransport { return NewVipSwapServerTransport(&s.srv.VipSwapServer) }) + initServer(&s.trMu, &s.trVipSwapServer, func() *VipSwapServerTransport { return NewVipSwapServerTransport(&s.srv.VipSwapServer) }) resp, err = s.trVipSwapServer.Do(req) case "VirtualApplianceConnectionsClient": - initServer(s, &s.trVirtualApplianceConnectionsServer, func() *VirtualApplianceConnectionsServerTransport { + initServer(&s.trMu, &s.trVirtualApplianceConnectionsServer, func() *VirtualApplianceConnectionsServerTransport { return NewVirtualApplianceConnectionsServerTransport(&s.srv.VirtualApplianceConnectionsServer) }) resp, err = s.trVirtualApplianceConnectionsServer.Do(req) case "VirtualApplianceSKUsClient": - initServer(s, &s.trVirtualApplianceSKUsServer, func() *VirtualApplianceSKUsServerTransport { + initServer(&s.trMu, &s.trVirtualApplianceSKUsServer, func() *VirtualApplianceSKUsServerTransport { return NewVirtualApplianceSKUsServerTransport(&s.srv.VirtualApplianceSKUsServer) }) resp, err = s.trVirtualApplianceSKUsServer.Do(req) case "VirtualApplianceSitesClient": - initServer(s, &s.trVirtualApplianceSitesServer, func() *VirtualApplianceSitesServerTransport { + initServer(&s.trMu, &s.trVirtualApplianceSitesServer, func() *VirtualApplianceSitesServerTransport { return NewVirtualApplianceSitesServerTransport(&s.srv.VirtualApplianceSitesServer) }) resp, err = s.trVirtualApplianceSitesServer.Do(req) case "VirtualAppliancesClient": - initServer(s, &s.trVirtualAppliancesServer, func() *VirtualAppliancesServerTransport { + initServer(&s.trMu, &s.trVirtualAppliancesServer, func() *VirtualAppliancesServerTransport { return NewVirtualAppliancesServerTransport(&s.srv.VirtualAppliancesServer) }) resp, err = s.trVirtualAppliancesServer.Do(req) case "VirtualHubBgpConnectionClient": - initServer(s, &s.trVirtualHubBgpConnectionServer, func() *VirtualHubBgpConnectionServerTransport { + initServer(&s.trMu, &s.trVirtualHubBgpConnectionServer, func() *VirtualHubBgpConnectionServerTransport { return NewVirtualHubBgpConnectionServerTransport(&s.srv.VirtualHubBgpConnectionServer) }) resp, err = s.trVirtualHubBgpConnectionServer.Do(req) case "VirtualHubBgpConnectionsClient": - initServer(s, &s.trVirtualHubBgpConnectionsServer, func() *VirtualHubBgpConnectionsServerTransport { + initServer(&s.trMu, &s.trVirtualHubBgpConnectionsServer, func() *VirtualHubBgpConnectionsServerTransport { return NewVirtualHubBgpConnectionsServerTransport(&s.srv.VirtualHubBgpConnectionsServer) }) resp, err = s.trVirtualHubBgpConnectionsServer.Do(req) case "VirtualHubIPConfigurationClient": - initServer(s, &s.trVirtualHubIPConfigurationServer, func() *VirtualHubIPConfigurationServerTransport { + initServer(&s.trMu, &s.trVirtualHubIPConfigurationServer, func() *VirtualHubIPConfigurationServerTransport { return NewVirtualHubIPConfigurationServerTransport(&s.srv.VirtualHubIPConfigurationServer) }) resp, err = s.trVirtualHubIPConfigurationServer.Do(req) case "VirtualHubRouteTableV2SClient": - initServer(s, &s.trVirtualHubRouteTableV2SServer, func() *VirtualHubRouteTableV2SServerTransport { + initServer(&s.trMu, &s.trVirtualHubRouteTableV2SServer, func() *VirtualHubRouteTableV2SServerTransport { return NewVirtualHubRouteTableV2SServerTransport(&s.srv.VirtualHubRouteTableV2SServer) }) resp, err = s.trVirtualHubRouteTableV2SServer.Do(req) case "VirtualHubsClient": - initServer(s, &s.trVirtualHubsServer, func() *VirtualHubsServerTransport { return NewVirtualHubsServerTransport(&s.srv.VirtualHubsServer) }) + initServer(&s.trMu, &s.trVirtualHubsServer, func() *VirtualHubsServerTransport { return NewVirtualHubsServerTransport(&s.srv.VirtualHubsServer) }) resp, err = s.trVirtualHubsServer.Do(req) case "VirtualNetworkAppliancesClient": - initServer(s, &s.trVirtualNetworkAppliancesServer, func() *VirtualNetworkAppliancesServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkAppliancesServer, func() *VirtualNetworkAppliancesServerTransport { return NewVirtualNetworkAppliancesServerTransport(&s.srv.VirtualNetworkAppliancesServer) }) resp, err = s.trVirtualNetworkAppliancesServer.Do(req) case "VirtualNetworkGatewayConnectionsClient": - initServer(s, &s.trVirtualNetworkGatewayConnectionsServer, func() *VirtualNetworkGatewayConnectionsServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkGatewayConnectionsServer, func() *VirtualNetworkGatewayConnectionsServerTransport { return NewVirtualNetworkGatewayConnectionsServerTransport(&s.srv.VirtualNetworkGatewayConnectionsServer) }) resp, err = s.trVirtualNetworkGatewayConnectionsServer.Do(req) case "VirtualNetworkGatewayNatRulesClient": - initServer(s, &s.trVirtualNetworkGatewayNatRulesServer, func() *VirtualNetworkGatewayNatRulesServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkGatewayNatRulesServer, func() *VirtualNetworkGatewayNatRulesServerTransport { return NewVirtualNetworkGatewayNatRulesServerTransport(&s.srv.VirtualNetworkGatewayNatRulesServer) }) resp, err = s.trVirtualNetworkGatewayNatRulesServer.Do(req) case "VirtualNetworkGatewaysClient": - initServer(s, &s.trVirtualNetworkGatewaysServer, func() *VirtualNetworkGatewaysServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkGatewaysServer, func() *VirtualNetworkGatewaysServerTransport { return NewVirtualNetworkGatewaysServerTransport(&s.srv.VirtualNetworkGatewaysServer) }) resp, err = s.trVirtualNetworkGatewaysServer.Do(req) case "VirtualNetworkPeeringsClient": - initServer(s, &s.trVirtualNetworkPeeringsServer, func() *VirtualNetworkPeeringsServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkPeeringsServer, func() *VirtualNetworkPeeringsServerTransport { return NewVirtualNetworkPeeringsServerTransport(&s.srv.VirtualNetworkPeeringsServer) }) resp, err = s.trVirtualNetworkPeeringsServer.Do(req) case "VirtualNetworkTapsClient": - initServer(s, &s.trVirtualNetworkTapsServer, func() *VirtualNetworkTapsServerTransport { + initServer(&s.trMu, &s.trVirtualNetworkTapsServer, func() *VirtualNetworkTapsServerTransport { return NewVirtualNetworkTapsServerTransport(&s.srv.VirtualNetworkTapsServer) }) resp, err = s.trVirtualNetworkTapsServer.Do(req) case "VirtualNetworksClient": - initServer(s, &s.trVirtualNetworksServer, func() *VirtualNetworksServerTransport { + initServer(&s.trMu, &s.trVirtualNetworksServer, func() *VirtualNetworksServerTransport { return NewVirtualNetworksServerTransport(&s.srv.VirtualNetworksServer) }) resp, err = s.trVirtualNetworksServer.Do(req) case "VirtualRouterPeeringsClient": - initServer(s, &s.trVirtualRouterPeeringsServer, func() *VirtualRouterPeeringsServerTransport { + initServer(&s.trMu, &s.trVirtualRouterPeeringsServer, func() *VirtualRouterPeeringsServerTransport { return NewVirtualRouterPeeringsServerTransport(&s.srv.VirtualRouterPeeringsServer) }) resp, err = s.trVirtualRouterPeeringsServer.Do(req) case "VirtualRoutersClient": - initServer(s, &s.trVirtualRoutersServer, func() *VirtualRoutersServerTransport { + initServer(&s.trMu, &s.trVirtualRoutersServer, func() *VirtualRoutersServerTransport { return NewVirtualRoutersServerTransport(&s.srv.VirtualRoutersServer) }) resp, err = s.trVirtualRoutersServer.Do(req) case "VirtualWansClient": - initServer(s, &s.trVirtualWansServer, func() *VirtualWansServerTransport { return NewVirtualWansServerTransport(&s.srv.VirtualWansServer) }) + initServer(&s.trMu, &s.trVirtualWansServer, func() *VirtualWansServerTransport { return NewVirtualWansServerTransport(&s.srv.VirtualWansServer) }) resp, err = s.trVirtualWansServer.Do(req) case "WatchersClient": - initServer(s, &s.trWatchersServer, func() *WatchersServerTransport { return NewWatchersServerTransport(&s.srv.WatchersServer) }) + initServer(&s.trMu, &s.trWatchersServer, func() *WatchersServerTransport { return NewWatchersServerTransport(&s.srv.WatchersServer) }) resp, err = s.trWatchersServer.Do(req) case "WebApplicationFirewallPoliciesClient": - initServer(s, &s.trWebApplicationFirewallPoliciesServer, func() *WebApplicationFirewallPoliciesServerTransport { + initServer(&s.trMu, &s.trWebApplicationFirewallPoliciesServer, func() *WebApplicationFirewallPoliciesServerTransport { return NewWebApplicationFirewallPoliciesServerTransport(&s.srv.WebApplicationFirewallPoliciesServer) }) resp, err = s.trWebApplicationFirewallPoliciesServer.Do(req) case "WebCategoriesClient": - initServer(s, &s.trWebCategoriesServer, func() *WebCategoriesServerTransport { + initServer(&s.trMu, &s.trWebCategoriesServer, func() *WebCategoriesServerTransport { return NewWebCategoriesServerTransport(&s.srv.WebCategoriesServer) }) resp, err = s.trWebCategoriesServer.Do(req) @@ -1429,11 +1460,3 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } - -func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { - s.trMu.Lock() - if *dst == nil { - *dst = src() - } - s.trMu.Unlock() -} diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go index ba58d641abd2..4b72e32c089c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ServiceAssociationLinksServer is a fake server for instances of the armnetwork.ServiceAssociationLinksClient type. @@ -50,9 +50,7 @@ func (s *ServiceAssociationLinksServerTransport) Do(req *http.Request) (*http.Re } func (s *ServiceAssociationLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (s *ServiceAssociationLinksServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -86,7 +81,7 @@ func (s *ServiceAssociationLinksServerTransport) dispatchList(req *http.Request) if s.srv.List == nil { return nil, &nonRetriableError{errors.New("fake for method List not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ServiceAssociationLinks` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceAssociationLinks` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -109,7 +104,7 @@ func (s *ServiceAssociationLinksServerTransport) dispatchList(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceAssociationLinksListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go index b52d8db31c43..0147ac28082e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ServiceEndpointPoliciesServer is a fake server for instances of the armnetwork.ServiceEndpointPoliciesClient type. @@ -81,9 +81,7 @@ func (s *ServiceEndpointPoliciesServerTransport) Do(req *http.Request) (*http.Re } func (s *ServiceEndpointPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -234,11 +229,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchGet(req *http.Request) if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.ServiceEndpointPoliciesClientGetOptions if expandParam != nil { options = &armnetwork.ServiceEndpointPoliciesClientGetOptions{ @@ -250,7 +241,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceEndpointPolicy, req) @@ -266,7 +257,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchNewListPager(req *http. } newListPager := s.newListPager.get(req) if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/ServiceEndpointPolicies` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/serviceEndpointPolicies` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 2 { @@ -283,7 +274,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchNewListPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -320,7 +311,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchNewListByResourceGroupP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -357,7 +348,7 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchUpdateTags(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceEndpointPolicy, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go index 3d6d1e3f35a4..01cad2950ce0 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ServiceEndpointPolicyDefinitionsServer is a fake server for instances of the armnetwork.ServiceEndpointPolicyDefinitionsClient type. @@ -71,9 +71,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) Do(req *http.Request) } func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchToMethodFake(r } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchBeginCreateOrU return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchBeginDelete(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchGet(req *http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceEndpointPolicyDefinition, req) @@ -277,7 +272,7 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchNewListByResou if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/servicegateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicegateways_server.go index dd3a096453d1..5c21f47b6ed7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicegateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicegateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ServiceGatewaysServer is a fake server for instances of the armnetwork.ServiceGatewaysClient type. @@ -105,9 +105,7 @@ func (s *ServiceGatewaysServerTransport) Do(req *http.Request) (*http.Response, } func (s *ServiceGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -141,10 +139,7 @@ func (s *ServiceGatewaysServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -192,7 +187,7 @@ func (s *ServiceGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (s *ServiceGatewaysServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -270,7 +265,7 @@ func (s *ServiceGatewaysServerTransport) dispatchGet(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceGateway, req) @@ -311,7 +306,7 @@ func (s *ServiceGatewaysServerTransport) dispatchNewGetAddressLocationsPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newGetAddressLocationsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -352,7 +347,7 @@ func (s *ServiceGatewaysServerTransport) dispatchNewGetServicesPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newGetServicesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -389,7 +384,7 @@ func (s *ServiceGatewaysServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -422,7 +417,7 @@ func (s *ServiceGatewaysServerTransport) dispatchNewListAllPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -469,7 +464,7 @@ func (s *ServiceGatewaysServerTransport) dispatchBeginUpdateAddressLocations(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginUpdateAddressLocations.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -517,7 +512,7 @@ func (s *ServiceGatewaysServerTransport) dispatchBeginUpdateServices(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginUpdateServices.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -555,7 +550,7 @@ func (s *ServiceGatewaysServerTransport) dispatchUpdateTags(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceGateway, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go index b82f664bd051..4b62730a3755 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -55,9 +55,7 @@ func (s *ServiceTagInformationServerTransport) Do(req *http.Request) (*http.Resp } func (s *ServiceTagInformationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -73,10 +71,7 @@ func (s *ServiceTagInformationServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -104,19 +99,11 @@ func (s *ServiceTagInformationServerTransport) dispatchNewListPager(req *http.Re if err != nil { return nil, err } - noAddressPrefixesUnescaped, err := url.QueryUnescape(qp.Get("noAddressPrefixes")) - if err != nil { - return nil, err - } - noAddressPrefixesParam, err := parseOptional(noAddressPrefixesUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - tagNameUnescaped, err := url.QueryUnescape(qp.Get("tagName")) + noAddressPrefixesParam, err := parseOptional(qp.Get("noAddressPrefixes"), strconv.ParseBool) if err != nil { return nil, err } - tagNameParam := getOptional(tagNameUnescaped) + tagNameParam := getOptional(qp.Get("tagName")) var options *armnetwork.ServiceTagInformationClientListOptions if noAddressPrefixesParam != nil || tagNameParam != nil { options = &armnetwork.ServiceTagInformationClientListOptions{ @@ -135,7 +122,7 @@ func (s *ServiceTagInformationServerTransport) dispatchNewListPager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go index c12e5504d5a4..29f4d6df176d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // ServiceTagsServer is a fake server for instances of the armnetwork.ServiceTagsClient type. @@ -50,9 +50,7 @@ func (s *ServiceTagsServerTransport) Do(req *http.Request) (*http.Response, erro } func (s *ServiceTagsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (s *ServiceTagsServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -101,7 +96,7 @@ func (s *ServiceTagsServerTransport) dispatchList(req *http.Request) (*http.Resp return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceTagsListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go index dc16eb060cfa..9df5808ffe12 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" - "reflect" "regexp" + "slices" "strconv" ) @@ -25,7 +24,7 @@ import ( type StaticCidrsServer struct { // Create is the fake for method StaticCidrsClient.Create // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Create func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *armnetwork.StaticCidrsClientCreateOptions) (resp azfake.Responder[armnetwork.StaticCidrsClientCreateResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, body armnetwork.StaticCidr, options *armnetwork.StaticCidrsClientCreateOptions) (resp azfake.Responder[armnetwork.StaticCidrsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method StaticCidrsClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent @@ -71,9 +70,7 @@ func (s *StaticCidrsServerTransport) Do(req *http.Request) (*http.Response, erro } func (s *StaticCidrsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +92,7 @@ func (s *StaticCidrsServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -139,18 +133,12 @@ func (s *StaticCidrsServerTransport) dispatchCreate(req *http.Request) (*http.Re if err != nil { return nil, err } - var options *armnetwork.StaticCidrsClientCreateOptions - if !reflect.ValueOf(body).IsZero() { - options = &armnetwork.StaticCidrsClientCreateOptions{ - Body: &body, - } - } - respr, errRespr := s.srv.Create(req.Context(), resourceGroupNameParam, networkManagerNameParam, poolNameParam, staticCidrNameParam, options) + respr, errRespr := s.srv.Create(req.Context(), resourceGroupNameParam, networkManagerNameParam, poolNameParam, staticCidrNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StaticCidr, req) @@ -201,7 +189,7 @@ func (s *StaticCidrsServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -243,7 +231,7 @@ func (s *StaticCidrsServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StaticCidr, req) @@ -278,16 +266,8 @@ func (s *StaticCidrsServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) - skipUnescaped, err := url.QueryUnescape(qp.Get("skip")) - if err != nil { - return nil, err - } - skipParam, err := parseOptional(skipUnescaped, func(v string) (int32, error) { + skipTokenParam := getOptional(qp.Get("skipToken")) + skipParam, err := parseOptional(qp.Get("skip"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -297,11 +277,7 @@ func (s *StaticCidrsServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -311,16 +287,8 @@ func (s *StaticCidrsServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - sortKeyUnescaped, err := url.QueryUnescape(qp.Get("sortKey")) - if err != nil { - return nil, err - } - sortKeyParam := getOptional(sortKeyUnescaped) - sortValueUnescaped, err := url.QueryUnescape(qp.Get("sortValue")) - if err != nil { - return nil, err - } - sortValueParam := getOptional(sortValueUnescaped) + sortKeyParam := getOptional(qp.Get("sortKey")) + sortValueParam := getOptional(qp.Get("sortValue")) var options *armnetwork.StaticCidrsClientListOptions if skipTokenParam != nil || skipParam != nil || topParam != nil || sortKeyParam != nil || sortValueParam != nil { options = &armnetwork.StaticCidrsClientListOptions{ @@ -342,7 +310,7 @@ func (s *StaticCidrsServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go index 93bd0a851f06..c9d784de2a92 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (s *StaticMembersServerTransport) Do(req *http.Request) (*http.Response, er } func (s *StaticMembersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (s *StaticMembersServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -141,7 +136,7 @@ func (s *StaticMembersServerTransport) dispatchCreateOrUpdate(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StaticMember, req) @@ -182,7 +177,7 @@ func (s *StaticMembersServerTransport) dispatchDelete(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -223,7 +218,7 @@ func (s *StaticMembersServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StaticMember, req) @@ -258,11 +253,7 @@ func (s *StaticMembersServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -272,11 +263,7 @@ func (s *StaticMembersServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.StaticMembersClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.StaticMembersClientListOptions{ @@ -295,7 +282,7 @@ func (s *StaticMembersServerTransport) dispatchNewListPager(req *http.Request) ( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/subgroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/subgroups_server.go new file mode 100644 index 000000000000..377ce5aec783 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/subgroups_server.go @@ -0,0 +1,173 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "net/http" + "net/url" + "regexp" + "slices" +) + +// SubgroupsServer is a fake server for instances of the armnetwork.SubgroupsClient type. +type SubgroupsServer struct { + // Get is the fake for method SubgroupsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, interconnectGroupName string, subgroupName string, options *armnetwork.SubgroupsClientGetOptions) (resp azfake.Responder[armnetwork.SubgroupsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SubgroupsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, interconnectGroupName string, options *armnetwork.SubgroupsClientListOptions) (resp azfake.PagerResponder[armnetwork.SubgroupsClientListResponse]) +} + +// NewSubgroupsServerTransport creates a new instance of SubgroupsServerTransport with the provided implementation. +// The returned SubgroupsServerTransport instance is connected to an instance of armnetwork.SubgroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSubgroupsServerTransport(srv *SubgroupsServer) *SubgroupsServerTransport { + return &SubgroupsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armnetwork.SubgroupsClientListResponse]](), + } +} + +// SubgroupsServerTransport connects instances of armnetwork.SubgroupsClient to instances of SubgroupsServer. +// Don't use this type directly, use NewSubgroupsServerTransport instead. +type SubgroupsServerTransport struct { + srv *SubgroupsServer + newListPager *tracker[azfake.PagerResponder[armnetwork.SubgroupsClientListResponse]] +} + +// Do implements the policy.Transporter interface for SubgroupsServerTransport. +func (s *SubgroupsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SubgroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result, 1) + go func() { + var intercepted bool + var res result + if subgroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = subgroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SubgroupsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SubgroupsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + resultChan <- res + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SubgroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subgroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + subgroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("subgroupName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, interconnectGroupNameParam, subgroupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Subgroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SubgroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/interconnectGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subgroups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + interconnectGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("interconnectGroupName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListPager(resourceGroupNameParam, interconnectGroupNameParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SubgroupsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to SubgroupsServerTransport +var subgroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go b/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go index 4c03156ad932..790626be1583 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // SubnetsServer is a fake server for instances of the armnetwork.SubnetsClient type. @@ -83,9 +83,7 @@ func (s *SubnetsServerTransport) Do(req *http.Request) (*http.Response, error) { } func (s *SubnetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -111,10 +109,7 @@ func (s *SubnetsServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -166,7 +161,7 @@ func (s *SubnetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -214,7 +209,7 @@ func (s *SubnetsServerTransport) dispatchBeginDelete(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -248,11 +243,7 @@ func (s *SubnetsServerTransport) dispatchGet(req *http.Request) (*http.Response, if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.SubnetsClientGetOptions if expandParam != nil { options = &armnetwork.SubnetsClientGetOptions{ @@ -264,7 +255,7 @@ func (s *SubnetsServerTransport) dispatchGet(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Subnet, req) @@ -305,7 +296,7 @@ func (s *SubnetsServerTransport) dispatchNewListPager(req *http.Request) (*http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -321,7 +312,7 @@ func (s *SubnetsServerTransport) dispatchBeginPrepareNetworkPolicies(req *http.R } beginPrepareNetworkPolicies := s.beginPrepareNetworkPolicies.get(req) if beginPrepareNetworkPolicies == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/PrepareNetworkPolicies` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/prepareNetworkPolicies` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -356,7 +347,7 @@ func (s *SubnetsServerTransport) dispatchBeginPrepareNetworkPolicies(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginPrepareNetworkPolicies.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -373,7 +364,7 @@ func (s *SubnetsServerTransport) dispatchBeginUnprepareNetworkPolicies(req *http } beginUnprepareNetworkPolicies := s.beginUnprepareNetworkPolicies.get(req) if beginUnprepareNetworkPolicies == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/UnprepareNetworkPolicies` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subnets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/unprepareNetworkPolicies` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 5 { @@ -408,7 +399,7 @@ func (s *SubnetsServerTransport) dispatchBeginUnprepareNetworkPolicies(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginUnprepareNetworkPolicies.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go index 299fa4d5d571..43daf3dad3ec 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -68,9 +68,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) Do(req *http.Requ } func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -92,10 +90,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchToMethodF } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -129,7 +124,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchCreateOrU return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerConnection, req) @@ -158,7 +153,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchDelete(re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -187,7 +182,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchGet(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagerConnection, req) @@ -210,11 +205,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchNewListPa return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("$top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -224,11 +215,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchNewListPa if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("$skipToken")) var options *armnetwork.SubscriptionNetworkManagerConnectionsClientListOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.SubscriptionNetworkManagerConnectionsClientListOptions{ @@ -247,7 +234,7 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchNewListPa if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go index 441a07982827..b5892e01360f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // UsagesServer is a fake server for instances of the armnetwork.UsagesClient type. @@ -54,9 +54,7 @@ func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { } func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method s } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { u.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go index 3390e2d6f5fe..ca5c7fa8b1e6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" - "reflect" "regexp" + "slices" "strconv" ) @@ -41,7 +40,7 @@ type VerifierWorkspacesServer struct { // Update is the fake for method VerifierWorkspacesClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *armnetwork.VerifierWorkspacesClientUpdateOptions) (resp azfake.Responder[armnetwork.VerifierWorkspacesClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body armnetwork.VerifierWorkspaceUpdate, options *armnetwork.VerifierWorkspacesClientUpdateOptions) (resp azfake.Responder[armnetwork.VerifierWorkspacesClientUpdateResponse], errResp azfake.ErrorResponder) } // NewVerifierWorkspacesServerTransport creates a new instance of VerifierWorkspacesServerTransport with the provided implementation. @@ -75,9 +74,7 @@ func (v *VerifierWorkspacesServerTransport) Do(req *http.Request) (*http.Respons } func (v *VerifierWorkspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -101,10 +98,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -153,7 +147,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchCreate(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VerifierWorkspace, req) @@ -207,7 +201,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -245,7 +239,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VerifierWorkspace, req) @@ -276,16 +270,8 @@ func (v *VerifierWorkspacesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) - skipUnescaped, err := url.QueryUnescape(qp.Get("skip")) - if err != nil { - return nil, err - } - skipParam, err := parseOptional(skipUnescaped, func(v string) (int32, error) { + skipTokenParam := getOptional(qp.Get("skipToken")) + skipParam, err := parseOptional(qp.Get("skip"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -295,11 +281,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -309,16 +291,8 @@ func (v *VerifierWorkspacesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - sortKeyUnescaped, err := url.QueryUnescape(qp.Get("sortKey")) - if err != nil { - return nil, err - } - sortKeyParam := getOptional(sortKeyUnescaped) - sortValueUnescaped, err := url.QueryUnescape(qp.Get("sortValue")) - if err != nil { - return nil, err - } - sortValueParam := getOptional(sortValueUnescaped) + sortKeyParam := getOptional(qp.Get("sortKey")) + sortValueParam := getOptional(qp.Get("sortValue")) var options *armnetwork.VerifierWorkspacesClientListOptions if skipTokenParam != nil || skipParam != nil || topParam != nil || sortKeyParam != nil || sortValueParam != nil { options = &armnetwork.VerifierWorkspacesClientListOptions{ @@ -340,7 +314,7 @@ func (v *VerifierWorkspacesServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -378,18 +352,17 @@ func (v *VerifierWorkspacesServerTransport) dispatchUpdate(req *http.Request) (* } ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) var options *armnetwork.VerifierWorkspacesClientUpdateOptions - if ifMatchParam != nil || !reflect.ValueOf(body).IsZero() { + if ifMatchParam != nil { options = &armnetwork.VerifierWorkspacesClientUpdateOptions{ IfMatch: ifMatchParam, - Body: &body, } } - respr, errRespr := v.srv.Update(req.Context(), resourceGroupNameParam, networkManagerNameParam, workspaceNameParam, options) + respr, errRespr := v.srv.Update(req.Context(), resourceGroupNameParam, networkManagerNameParam, workspaceNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VerifierWorkspace, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go index 1234de1161bc..050391f08f62 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VipSwapServer is a fake server for instances of the armnetwork.VipSwapClient type. @@ -62,9 +62,7 @@ func (v *VipSwapServerTransport) Do(req *http.Request) (*http.Response, error) { } func (v *VipSwapServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -84,10 +82,7 @@ func (v *VipSwapServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -104,7 +99,7 @@ func (v *VipSwapServerTransport) dispatchBeginCreate(req *http.Request) (*http.R } beginCreate := v.beginCreate.get(req) if beginCreate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -135,7 +130,7 @@ func (v *VipSwapServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginCreate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -150,7 +145,7 @@ func (v *VipSwapServerTransport) dispatchGet(req *http.Request) (*http.Response, if v.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -169,7 +164,7 @@ func (v *VipSwapServerTransport) dispatchGet(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SwapResource, req) @@ -183,7 +178,7 @@ func (v *VipSwapServerTransport) dispatchList(req *http.Request) (*http.Response if v.srv.List == nil { return nil, &nonRetriableError{errors.New("fake for method List not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft\.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/cloudServiceSlots` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -202,7 +197,7 @@ func (v *VipSwapServerTransport) dispatchList(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SwapResourceListResult, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go index 65e765420aff..eeecff5984d6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualApplianceConnectionsServer is a fake server for instances of the armnetwork.VirtualApplianceConnectionsClient type. @@ -71,9 +71,7 @@ func (v *VirtualApplianceConnectionsServerTransport) Do(req *http.Request) (*htt } func (v *VirtualApplianceConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchToMethodFake(req *h } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchBeginCreateOrUpdate return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchBeginDelete(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchGet(req *http.Reque return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualApplianceConnection, req) @@ -277,7 +272,7 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchNewListPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go index fca3d2881ac6..ad70798f8c00 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // VirtualAppliancesServer is a fake server for instances of the armnetwork.VirtualAppliancesClient type. @@ -100,9 +100,7 @@ func (v *VirtualAppliancesServerTransport) Do(req *http.Request) (*http.Response } func (v *VirtualAppliancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -134,10 +132,7 @@ func (v *VirtualAppliancesServerTransport) dispatchToMethodFake(req *http.Reques } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -185,7 +180,7 @@ func (v *VirtualAppliancesServerTransport) dispatchBeginCreateOrUpdate(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -229,7 +224,7 @@ func (v *VirtualAppliancesServerTransport) dispatchBeginDelete(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -259,11 +254,7 @@ func (v *VirtualAppliancesServerTransport) dispatchGet(req *http.Request) (*http if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.VirtualAppliancesClientGetOptions if expandParam != nil { options = &armnetwork.VirtualAppliancesClientGetOptions{ @@ -275,7 +266,7 @@ func (v *VirtualAppliancesServerTransport) dispatchGet(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualAppliance, req) @@ -322,7 +313,7 @@ func (v *VirtualAppliancesServerTransport) dispatchBeginGetBootDiagnosticLogs(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetBootDiagnosticLogs.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -356,7 +347,7 @@ func (v *VirtualAppliancesServerTransport) dispatchNewListPager(req *http.Reques if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -393,7 +384,7 @@ func (v *VirtualAppliancesServerTransport) dispatchNewListByResourceGroupPager(r if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -446,7 +437,7 @@ func (v *VirtualAppliancesServerTransport) dispatchBeginReimage(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -500,7 +491,7 @@ func (v *VirtualAppliancesServerTransport) dispatchBeginRestart(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -538,7 +529,7 @@ func (v *VirtualAppliancesServerTransport) dispatchUpdateTags(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualAppliance, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go index 365c95ba0419..062e29265ecb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualApplianceSitesServer is a fake server for instances of the armnetwork.VirtualApplianceSitesClient type. @@ -71,9 +71,7 @@ func (v *VirtualApplianceSitesServerTransport) Do(req *http.Request) (*http.Resp } func (v *VirtualApplianceSitesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualApplianceSitesServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualApplianceSitesServerTransport) dispatchBeginCreateOrUpdate(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualApplianceSitesServerTransport) dispatchBeginDelete(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualApplianceSitesServerTransport) dispatchGet(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualApplianceSite, req) @@ -277,7 +272,7 @@ func (v *VirtualApplianceSitesServerTransport) dispatchNewListPager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go index af060b7f6019..6d6c6fc2b99a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualApplianceSKUsServer is a fake server for instances of the armnetwork.VirtualApplianceSKUsClient type. @@ -59,9 +59,7 @@ func (v *VirtualApplianceSKUsServerTransport) Do(req *http.Request) (*http.Respo } func (v *VirtualApplianceSKUsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (v *VirtualApplianceSKUsServerTransport) dispatchToMethodFake(req *http.Req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -112,7 +107,7 @@ func (v *VirtualApplianceSKUsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualApplianceSKU, req) @@ -145,7 +140,7 @@ func (v *VirtualApplianceSKUsServerTransport) dispatchNewListPager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go index 3dce9616c8ef..3e68ce8a82d2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualHubBgpConnectionServer is a fake server for instances of the armnetwork.VirtualHubBgpConnectionClient type. @@ -64,9 +64,7 @@ func (v *VirtualHubBgpConnectionServerTransport) Do(req *http.Request) (*http.Re } func (v *VirtualHubBgpConnectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -86,10 +84,7 @@ func (v *VirtualHubBgpConnectionServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -141,7 +136,7 @@ func (v *VirtualHubBgpConnectionServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -189,7 +184,7 @@ func (v *VirtualHubBgpConnectionServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -227,7 +222,7 @@ func (v *VirtualHubBgpConnectionServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BgpConnection, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go index c9ed15cb3ccd..86166ba64ad6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualHubBgpConnectionsServer is a fake server for instances of the armnetwork.VirtualHubBgpConnectionsClient type. @@ -67,9 +67,7 @@ func (v *VirtualHubBgpConnectionsServerTransport) Do(req *http.Request) (*http.R } func (v *VirtualHubBgpConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -89,10 +87,7 @@ func (v *VirtualHubBgpConnectionsServerTransport) dispatchToMethodFake(req *http } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -134,7 +129,7 @@ func (v *VirtualHubBgpConnectionsServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -181,7 +176,7 @@ func (v *VirtualHubBgpConnectionsServerTransport) dispatchBeginListAdvertisedRou return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginListAdvertisedRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -229,7 +224,7 @@ func (v *VirtualHubBgpConnectionsServerTransport) dispatchBeginListLearnedRoutes return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginListLearnedRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go index ab45adc261bb..7108a3e545cd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualHubIPConfigurationServer is a fake server for instances of the armnetwork.VirtualHubIPConfigurationClient type. @@ -71,9 +71,7 @@ func (v *VirtualHubIPConfigurationServerTransport) Do(req *http.Request) (*http. } func (v *VirtualHubIPConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchBeginCreateOrUpdate(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).HubIPConfiguration, req) @@ -277,7 +272,7 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchNewListPager(req *htt if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go index 5ce1b3e11e46..a8f6ea6dce9a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualHubRouteTableV2SServer is a fake server for instances of the armnetwork.VirtualHubRouteTableV2SClient type. @@ -71,9 +71,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) Do(req *http.Request) (*http.Re } func (v *VirtualHubRouteTableV2SServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualHubRouteTableV2, req) @@ -277,7 +272,7 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchNewListPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go index b52f639fe6d5..f5f238957847 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // VirtualHubsServer is a fake server for instances of the armnetwork.VirtualHubsClient type. @@ -100,9 +100,7 @@ func (v *VirtualHubsServerTransport) Do(req *http.Request) (*http.Response, erro } func (v *VirtualHubsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -134,10 +132,7 @@ func (v *VirtualHubsServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -185,7 +180,7 @@ func (v *VirtualHubsServerTransport) dispatchBeginCreateOrUpdate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -229,7 +224,7 @@ func (v *VirtualHubsServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -263,7 +258,7 @@ func (v *VirtualHubsServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualHub, req) @@ -316,7 +311,7 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetEffectiveVirtualHubRoutes(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetEffectiveVirtualHubRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -364,7 +359,7 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetInboundRoutes(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetInboundRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -412,7 +407,7 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetOutboundRoutes(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetOutboundRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -446,7 +441,7 @@ func (v *VirtualHubsServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -483,7 +478,7 @@ func (v *VirtualHubsServerTransport) dispatchNewListByResourceGroupPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -520,7 +515,7 @@ func (v *VirtualHubsServerTransport) dispatchUpdateTags(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualHub, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkappliances_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkappliances_server.go index ca35d0bb08c5..5623260f76cc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkappliances_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkappliances_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualNetworkAppliancesServer is a fake server for instances of the armnetwork.VirtualNetworkAppliancesClient type. @@ -81,9 +81,7 @@ func (v *VirtualNetworkAppliancesServerTransport) Do(req *http.Request) (*http.R } func (v *VirtualNetworkAppliancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchToMethodFake(req *http } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchBeginCreateOrUpdate(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchBeginDelete(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkAppliance, req) @@ -275,7 +270,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchNewListPager(req *http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchNewListAllPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (v *VirtualNetworkAppliancesServerTransport) dispatchUpdateTags(req *http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkAppliance, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go index dbda1f65aff3..a0004e99c6f5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // VirtualNetworkGatewayConnectionsServer is a fake server for instances of the armnetwork.VirtualNetworkGatewayConnectionsClient type. @@ -118,9 +118,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) Do(req *http.Request) } func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -158,10 +156,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchToMethodFake(r } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -209,7 +204,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginCreateOrU return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -253,7 +248,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginDelete(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -287,7 +282,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchGet(req *http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkGatewayConnection, req) @@ -330,7 +325,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginGetIkeSas return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetIkeSas.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -364,7 +359,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchGetSharedKey(r return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionSharedKey, req) @@ -401,7 +396,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchNewListPager(r if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -444,7 +439,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginResetConn return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetConnection.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -492,7 +487,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginResetShar return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginResetSharedKey.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -540,7 +535,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginSetShared return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginSetSharedKey.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -594,7 +589,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginStartPack return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStartPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -642,7 +637,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginStopPacke return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStopPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -690,7 +685,7 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginUpdateTag return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go index 7670d835c2ac..3b68ba185f7c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualNetworkGatewayNatRulesServer is a fake server for instances of the armnetwork.VirtualNetworkGatewayNatRulesClient type. @@ -71,9 +71,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) Do(req *http.Request) (*h } func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchBeginCreateOrUpda return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchBeginDelete(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchGet(req *http.Req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkGatewayNatRule, req) @@ -277,7 +272,7 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchNewListByVirtualN if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByVirtualNetworkGatewayPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go index f0f9c816719b..f5e36e7207e8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" "strconv" ) @@ -241,9 +241,7 @@ func (v *VirtualNetworkGatewaysServerTransport) Do(req *http.Request) (*http.Res } func (v *VirtualNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -323,10 +321,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -374,7 +369,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -418,7 +413,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDelete(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -466,7 +461,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDisconnectVirtualNe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -514,7 +509,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGenerateVPNProfile( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGenerateVPNProfile.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -562,7 +557,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGeneratevpnclientpa return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGeneratevpnclientpackage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -596,7 +591,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchGet(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkGateway, req) @@ -627,11 +622,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetAdvertisedRoutes if err != nil { return nil, err } - peerParam, err := url.QueryUnescape(qp.Get("peer")) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginGetAdvertisedRoutes(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peerParam, nil) + respr, errRespr := v.srv.BeginGetAdvertisedRoutes(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, qp.Get("peer"), nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -644,7 +635,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetAdvertisedRoutes return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetAdvertisedRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -676,11 +667,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetBgpPeerStatus(re if err != nil { return nil, err } - peerUnescaped, err := url.QueryUnescape(qp.Get("peer")) - if err != nil { - return nil, err - } - peerParam := getOptional(peerUnescaped) + peerParam := getOptional(qp.Get("peer")) var options *armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions if peerParam != nil { options = &armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions{ @@ -700,7 +687,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetBgpPeerStatus(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetBgpPeerStatus.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -732,19 +719,11 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverAllTestD if err != nil { return nil, err } - typeParamParam, err := url.QueryUnescape(qp.Get("type")) + fetchLatestParam, err := strconv.ParseBool(qp.Get("fetchLatest")) if err != nil { return nil, err } - fetchLatestUnescaped, err := url.QueryUnescape(qp.Get("fetchLatest")) - if err != nil { - return nil, err - } - fetchLatestParam, err := strconv.ParseBool(fetchLatestUnescaped) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginGetFailoverAllTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, typeParamParam, fetchLatestParam, nil) + respr, errRespr := v.srv.BeginGetFailoverAllTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, qp.Get("type"), fetchLatestParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -757,7 +736,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverAllTestD return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetFailoverAllTestDetails.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -789,15 +768,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverSingleTe if err != nil { return nil, err } - peeringLocationParam, err := url.QueryUnescape(qp.Get("peeringLocation")) - if err != nil { - return nil, err - } - failoverTestIDParam, err := url.QueryUnescape(qp.Get("failoverTestId")) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginGetFailoverSingleTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peeringLocationParam, failoverTestIDParam, nil) + respr, errRespr := v.srv.BeginGetFailoverSingleTestDetails(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, qp.Get("peeringLocation"), qp.Get("failoverTestId"), nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -810,7 +781,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetFailoverSingleTe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetFailoverSingleTestDetails.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -854,7 +825,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetLearnedRoutes(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetLearnedRoutes.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -886,11 +857,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetResiliencyInform if err != nil { return nil, err } - attemptRefreshUnescaped, err := url.QueryUnescape(qp.Get("attemptRefresh")) - if err != nil { - return nil, err - } - attemptRefreshParam, err := parseOptional(attemptRefreshUnescaped, strconv.ParseBool) + attemptRefreshParam, err := parseOptional(qp.Get("attemptRefresh"), strconv.ParseBool) if err != nil { return nil, err } @@ -913,7 +880,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetResiliencyInform return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetResiliencyInformation.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -945,11 +912,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetRoutesInformatio if err != nil { return nil, err } - attemptRefreshUnescaped, err := url.QueryUnescape(qp.Get("attemptRefresh")) - if err != nil { - return nil, err - } - attemptRefreshParam, err := parseOptional(attemptRefreshUnescaped, strconv.ParseBool) + attemptRefreshParam, err := parseOptional(qp.Get("attemptRefresh"), strconv.ParseBool) if err != nil { return nil, err } @@ -972,7 +935,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetRoutesInformatio return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetRoutesInformation.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1016,7 +979,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVPNProfilePackag return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetVPNProfilePackageURL.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1060,7 +1023,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVpnclientConnect return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetVpnclientConnectionHealth.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1104,7 +1067,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVpnclientIPSecPa return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.beginGetVpnclientIPSecParameters.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -1148,7 +1111,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeAbortMigratio return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginInvokeAbortMigration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -1192,7 +1155,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeCommitMigrati return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginInvokeCommitMigration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -1236,7 +1199,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeExecuteMigrat return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginInvokeExecuteMigration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -1284,7 +1247,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokePrepareMigrat return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginInvokePrepareMigration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -1322,7 +1285,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -1363,7 +1326,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchNewListConnectionsPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListConnectionsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -1396,7 +1359,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchListRadiusSecrets(req *h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RadiusAuthServerListResult, req) @@ -1427,11 +1390,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginReset(req *http.Req if err != nil { return nil, err } - gatewayVipUnescaped, err := url.QueryUnescape(qp.Get("gatewayVip")) - if err != nil { - return nil, err - } - gatewayVipParam := getOptional(gatewayVipUnescaped) + gatewayVipParam := getOptional(qp.Get("gatewayVip")) var options *armnetwork.VirtualNetworkGatewaysClientBeginResetOptions if gatewayVipParam != nil { options = &armnetwork.VirtualNetworkGatewaysClientBeginResetOptions{ @@ -1451,7 +1410,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginReset(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginReset.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1495,7 +1454,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginResetVPNClientShare return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetVPNClientSharedKey.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -1543,7 +1502,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginSetVpnclientIPSecPa return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginSetVpnclientIPSecParameters.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1575,11 +1534,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStartExpressRouteSi if err != nil { return nil, err } - peeringLocationParam, err := url.QueryUnescape(qp.Get("peeringLocation")) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginStartExpressRouteSiteFailoverSimulation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, peeringLocationParam, nil) + respr, errRespr := v.srv.BeginStartExpressRouteSiteFailoverSimulation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, qp.Get("peeringLocation"), nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1592,7 +1547,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStartExpressRouteSi return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStartExpressRouteSiteFailoverSimulation.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1646,7 +1601,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStartPacketCapture( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStartPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1694,7 +1649,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStopExpressRouteSit return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStopExpressRouteSiteFailoverSimulation.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1742,7 +1697,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginStopPacketCapture(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStopPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1776,7 +1731,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchSupportedVPNDevices(req return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req) @@ -1823,7 +1778,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginUpdateTags(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -1861,7 +1816,7 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchVPNDeviceConfigurationSc return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Value, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go index 0f904b1da968..51d54c5f64d9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualNetworkPeeringsServer is a fake server for instances of the armnetwork.VirtualNetworkPeeringsClient type. @@ -71,9 +71,7 @@ func (v *VirtualNetworkPeeringsServerTransport) Do(req *http.Request) (*http.Res } func (v *VirtualNetworkPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -138,11 +133,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchBeginCreateOrUpdate(req if err != nil { return nil, err } - syncRemoteAddressSpaceUnescaped, err := url.QueryUnescape(qp.Get("syncRemoteAddressSpace")) - if err != nil { - return nil, err - } - syncRemoteAddressSpaceParam := getOptional(armnetwork.SyncRemoteAddressSpace(syncRemoteAddressSpaceUnescaped)) + syncRemoteAddressSpaceParam := getOptional(armnetwork.SyncRemoteAddressSpace(qp.Get("syncRemoteAddressSpace"))) var options *armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions if syncRemoteAddressSpaceParam != nil { options = &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{ @@ -162,7 +153,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -210,7 +201,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchBeginDelete(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -248,7 +239,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchGet(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkPeering, req) @@ -289,7 +280,7 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchNewListPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go index 8dcd5bf4a255..a4635287d5aa 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -98,9 +98,7 @@ func (v *VirtualNetworksServerTransport) Do(req *http.Request) (*http.Response, } func (v *VirtualNetworksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -132,10 +130,7 @@ func (v *VirtualNetworksServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualNetworksServerTransport) dispatchCheckIPAddressAvailability(req if v.srv.CheckIPAddressAvailability == nil { return nil, &nonRetriableError{errors.New("fake for method CheckIPAddressAvailability not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/CheckIPAddressAvailability` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkIPAddressAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if len(matches) < 4 { @@ -165,16 +160,12 @@ func (v *VirtualNetworksServerTransport) dispatchCheckIPAddressAvailability(req if err != nil { return nil, err } - ipAddressParam, err := url.QueryUnescape(qp.Get("ipAddress")) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.CheckIPAddressAvailability(req.Context(), resourceGroupNameParam, virtualNetworkNameParam, ipAddressParam, nil) + respr, errRespr := v.srv.CheckIPAddressAvailability(req.Context(), resourceGroupNameParam, virtualNetworkNameParam, qp.Get("ipAddress"), nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IPAddressAvailabilityResult, req) @@ -221,7 +212,7 @@ func (v *VirtualNetworksServerTransport) dispatchBeginCreateOrUpdate(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -265,7 +256,7 @@ func (v *VirtualNetworksServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -295,11 +286,7 @@ func (v *VirtualNetworksServerTransport) dispatchGet(req *http.Request) (*http.R if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.VirtualNetworksClientGetOptions if expandParam != nil { options = &armnetwork.VirtualNetworksClientGetOptions{ @@ -311,7 +298,7 @@ func (v *VirtualNetworksServerTransport) dispatchGet(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetwork, req) @@ -348,7 +335,7 @@ func (v *VirtualNetworksServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -381,7 +368,7 @@ func (v *VirtualNetworksServerTransport) dispatchNewListAllPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -412,11 +399,7 @@ func (v *VirtualNetworksServerTransport) dispatchBeginListDdosProtectionStatus(r if err != nil { return nil, err } - topUnescaped, err := url.QueryUnescape(qp.Get("top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + topParam, err := parseOptional(qp.Get("top"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -426,11 +409,7 @@ func (v *VirtualNetworksServerTransport) dispatchBeginListDdosProtectionStatus(r if err != nil { return nil, err } - skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) - if err != nil { - return nil, err - } - skipTokenParam := getOptional(skipTokenUnescaped) + skipTokenParam := getOptional(qp.Get("skipToken")) var options *armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions if topParam != nil || skipTokenParam != nil { options = &armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions{ @@ -451,7 +430,7 @@ func (v *VirtualNetworksServerTransport) dispatchBeginListDdosProtectionStatus(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginListDdosProtectionStatus.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -493,7 +472,7 @@ func (v *VirtualNetworksServerTransport) dispatchNewListUsagePager(req *http.Req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListUsagePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -530,7 +509,7 @@ func (v *VirtualNetworksServerTransport) dispatchUpdateTags(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetwork, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go index d85a3c312a5b..9706942157aa 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualNetworkTapsServer is a fake server for instances of the armnetwork.VirtualNetworkTapsClient type. @@ -81,9 +81,7 @@ func (v *VirtualNetworkTapsServerTransport) Do(req *http.Request) (*http.Respons } func (v *VirtualNetworkTapsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchBeginCreateOrUpdate(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkTap, req) @@ -271,7 +266,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchNewListAllPager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchNewListByResourceGroupPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (v *VirtualNetworkTapsServerTransport) dispatchUpdateTags(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualNetworkTap, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go index 29a90cb63b69..a937756bace1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualRouterPeeringsServer is a fake server for instances of the armnetwork.VirtualRouterPeeringsClient type. @@ -71,9 +71,7 @@ func (v *VirtualRouterPeeringsServerTransport) Do(req *http.Request) (*http.Resp } func (v *VirtualRouterPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +93,7 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -150,7 +145,7 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchBeginCreateOrUpdate(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchBeginDelete(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -236,7 +231,7 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchGet(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualRouterPeering, req) @@ -277,7 +272,7 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchNewListPager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go index e3403f72c82a..ff29fd61dfef 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualRoutersServer is a fake server for instances of the armnetwork.VirtualRoutersClient type. @@ -77,9 +77,7 @@ func (v *VirtualRoutersServerTransport) Do(req *http.Request) (*http.Response, e } func (v *VirtualRoutersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -103,10 +101,7 @@ func (v *VirtualRoutersServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -154,7 +149,7 @@ func (v *VirtualRoutersServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -198,7 +193,7 @@ func (v *VirtualRoutersServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -228,11 +223,7 @@ func (v *VirtualRoutersServerTransport) dispatchGet(req *http.Request) (*http.Re if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.VirtualRoutersClientGetOptions if expandParam != nil { options = &armnetwork.VirtualRoutersClientGetOptions{ @@ -244,7 +235,7 @@ func (v *VirtualRoutersServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualRouter, req) @@ -277,7 +268,7 @@ func (v *VirtualRoutersServerTransport) dispatchNewListPager(req *http.Request) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -314,7 +305,7 @@ func (v *VirtualRoutersServerTransport) dispatchNewListByResourceGroupPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go index ac07d553cc40..8607b28b509a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VirtualWansServer is a fake server for instances of the armnetwork.VirtualWansClient type. @@ -81,9 +81,7 @@ func (v *VirtualWansServerTransport) Do(req *http.Request) (*http.Response, erro } func (v *VirtualWansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (v *VirtualWansServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (v *VirtualWansServerTransport) dispatchBeginCreateOrUpdate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (v *VirtualWansServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (v *VirtualWansServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualWAN, req) @@ -271,7 +266,7 @@ func (v *VirtualWansServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (v *VirtualWansServerTransport) dispatchNewListByResourceGroupPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (v *VirtualWansServerTransport) dispatchUpdateTags(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualWAN, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go index 056545f61ea5..3b7736f3602d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // VPNConnectionsServer is a fake server for instances of the armnetwork.VPNConnectionsClient type. @@ -84,9 +84,7 @@ func (v *VPNConnectionsServerTransport) Do(req *http.Request) (*http.Response, e } func (v *VPNConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -112,10 +110,7 @@ func (v *VPNConnectionsServerTransport) dispatchToMethodFake(req *http.Request, } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -167,7 +162,7 @@ func (v *VPNConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -215,7 +210,7 @@ func (v *VPNConnectionsServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -253,7 +248,7 @@ func (v *VPNConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNConnection, req) @@ -294,7 +289,7 @@ func (v *VPNConnectionsServerTransport) dispatchNewListByVPNGatewayPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByVPNGatewayPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -351,7 +346,7 @@ func (v *VPNConnectionsServerTransport) dispatchBeginStartPacketCapture(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStartPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -409,7 +404,7 @@ func (v *VPNConnectionsServerTransport) dispatchBeginStopPacketCapture(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStopPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go index a5009871491b..e0675fc0b9dd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,11 +12,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "reflect" "regexp" + "slices" ) // VPNGatewaysServer is a fake server for instances of the armnetwork.VPNGatewaysClient type. @@ -102,9 +102,7 @@ func (v *VPNGatewaysServerTransport) Do(req *http.Request) (*http.Response, erro } func (v *VPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -136,10 +134,7 @@ func (v *VPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -187,7 +182,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -231,7 +226,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -265,7 +260,7 @@ func (v *VPNGatewaysServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNGateway, req) @@ -298,7 +293,7 @@ func (v *VPNGatewaysServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -335,7 +330,7 @@ func (v *VPNGatewaysServerTransport) dispatchNewListByResourceGroupPager(req *ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -366,11 +361,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginReset(req *http.Request) (*htt if err != nil { return nil, err } - iPConfigurationIDUnescaped, err := url.QueryUnescape(qp.Get("ipConfigurationId")) - if err != nil { - return nil, err - } - iPConfigurationIDParam := getOptional(iPConfigurationIDUnescaped) + iPConfigurationIDParam := getOptional(qp.Get("ipConfigurationId")) var options *armnetwork.VPNGatewaysClientBeginResetOptions if iPConfigurationIDParam != nil { options = &armnetwork.VPNGatewaysClientBeginResetOptions{ @@ -390,7 +381,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginReset(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginReset.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -444,7 +435,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginStartPacketCapture(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStartPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -498,7 +489,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginStopPacketCapture(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginStopPacketCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -546,7 +537,7 @@ func (v *VPNGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginUpdateTags.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go index 039a1e98f555..417aaa6c0c2d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNLinkConnectionsServer is a fake server for instances of the armnetwork.VPNLinkConnectionsClient type. @@ -87,9 +87,7 @@ func (v *VPNLinkConnectionsServerTransport) Do(req *http.Request) (*http.Respons } func (v *VPNLinkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -117,10 +115,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -170,7 +165,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchNewGetAllSharedKeysPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newGetAllSharedKeysPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -211,7 +206,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchGetDefaultSharedKey(req *htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionSharedKeyResult, req) @@ -262,7 +257,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginGetIkeSas(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginGetIkeSas.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchNewListByVPNConnectionPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByVPNConnectionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -349,7 +344,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchListDefaultSharedKey(req *ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ConnectionSharedKeyResult, req) @@ -400,7 +395,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginResetConnection(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetConnection.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -456,7 +451,7 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginSetOrInitDefaultSharedK return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginSetOrInitDefaultSharedKey.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go index 83d6c54da66d..7e7739cfcec5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNServerConfigurationsServer is a fake server for instances of the armnetwork.VPNServerConfigurationsClient type. @@ -85,9 +85,7 @@ func (v *VPNServerConfigurationsServerTransport) Do(req *http.Request) (*http.Re } func (v *VPNServerConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -115,10 +113,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchToMethodFake(req *http. } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -166,7 +161,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -210,7 +205,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -244,7 +239,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchGet(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNServerConfiguration, req) @@ -277,7 +272,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchNewListPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -314,7 +309,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchNewListByResourceGroupP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -347,7 +342,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchListRadiusSecrets(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RadiusAuthServerListResult, req) @@ -384,7 +379,7 @@ func (v *VPNServerConfigurationsServerTransport) dispatchUpdateTags(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNServerConfiguration, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go index ae9a60aa34bb..03b39fcde96e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNServerConfigurationsAssociatedWithVirtualWanServer is a fake server for instances of the armnetwork.VPNServerConfigurationsAssociatedWithVirtualWanClient type. @@ -54,9 +54,7 @@ func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) Do(req } func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatc } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -119,7 +114,7 @@ func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatc return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { v.beginList.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go index 75ddc19505cd..3bb592dd6c7e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNSiteLinkConnectionsServer is a fake server for instances of the armnetwork.VPNSiteLinkConnectionsClient type. @@ -50,9 +50,7 @@ func (v *VPNSiteLinkConnectionsServerTransport) Do(req *http.Request) (*http.Res } func (v *VPNSiteLinkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -68,10 +66,7 @@ func (v *VPNSiteLinkConnectionsServerTransport) dispatchToMethodFake(req *http.R } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -113,7 +108,7 @@ func (v *VPNSiteLinkConnectionsServerTransport) dispatchGet(req *http.Request) ( return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNSiteLinkConnection, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go index 15ffaef3f303..203bcf41b6cf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNSiteLinksServer is a fake server for instances of the armnetwork.VPNSiteLinksClient type. @@ -59,9 +59,7 @@ func (v *VPNSiteLinksServerTransport) Do(req *http.Request) (*http.Response, err } func (v *VPNSiteLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (v *VPNSiteLinksServerTransport) dispatchToMethodFake(req *http.Request, me } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +115,7 @@ func (v *VPNSiteLinksServerTransport) dispatchGet(req *http.Request) (*http.Resp return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNSiteLink, req) @@ -161,7 +156,7 @@ func (v *VPNSiteLinksServerTransport) dispatchNewListByVPNSitePager(req *http.Re if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByVPNSitePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go index d410890e1e06..ce0942e9363a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNSitesServer is a fake server for instances of the armnetwork.VPNSitesClient type. @@ -81,9 +81,7 @@ func (v *VPNSitesServerTransport) Do(req *http.Request) (*http.Response, error) } func (v *VPNSitesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -109,10 +107,7 @@ func (v *VPNSitesServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -160,7 +155,7 @@ func (v *VPNSitesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } @@ -204,7 +199,7 @@ func (v *VPNSitesServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -238,7 +233,7 @@ func (v *VPNSitesServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNSite, req) @@ -271,7 +266,7 @@ func (v *VPNSitesServerTransport) dispatchNewListPager(req *http.Request) (*http if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -308,7 +303,7 @@ func (v *VPNSitesServerTransport) dispatchNewListByResourceGroupPager(req *http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { v.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -345,7 +340,7 @@ func (v *VPNSitesServerTransport) dispatchUpdateTags(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VPNSite, req) diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go index 10badcbe0c38..12381a34fd64 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,11 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // VPNSitesConfigurationServer is a fake server for instances of the armnetwork.VPNSitesConfigurationClient type. @@ -54,9 +54,7 @@ func (v *VPNSitesConfigurationServerTransport) Do(req *http.Request) (*http.Resp } func (v *VPNSitesConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -72,10 +70,7 @@ func (v *VPNSitesConfigurationServerTransport) dispatchToMethodFake(req *http.Re } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -123,7 +118,7 @@ func (v *VPNSitesConfigurationServerTransport) dispatchBeginDownload(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDownload.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go index 3f46be5dc45d..9a991cdf92a3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,10 +11,12 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // WatchersServer is a fake server for instances of the armnetwork.WatchersClient type. @@ -148,9 +149,7 @@ func (w *WatchersServerTransport) Do(req *http.Request) (*http.Response, error) } func (w *WatchersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -200,10 +199,7 @@ func (w *WatchersServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -251,7 +247,7 @@ func (w *WatchersServerTransport) dispatchBeginCheckConnectivity(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginCheckConnectivity.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -289,7 +285,7 @@ func (w *WatchersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Watcher, req) @@ -332,7 +328,7 @@ func (w *WatchersServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { w.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -366,7 +362,7 @@ func (w *WatchersServerTransport) dispatchGet(req *http.Request) (*http.Response return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Watcher, req) @@ -413,7 +409,7 @@ func (w *WatchersServerTransport) dispatchBeginGetAzureReachabilityReport(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetAzureReachabilityReport.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -461,7 +457,7 @@ func (w *WatchersServerTransport) dispatchBeginGetFlowLogStatus(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetFlowLogStatus.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -509,7 +505,7 @@ func (w *WatchersServerTransport) dispatchBeginGetNetworkConfigurationDiagnostic return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetNetworkConfigurationDiagnostic.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -557,7 +553,7 @@ func (w *WatchersServerTransport) dispatchBeginGetNextHop(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetNextHop.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -595,7 +591,7 @@ func (w *WatchersServerTransport) dispatchGetTopology(req *http.Request) (*http. return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Topology, req) @@ -642,7 +638,7 @@ func (w *WatchersServerTransport) dispatchBeginGetTroubleshooting(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetTroubleshooting.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -690,7 +686,7 @@ func (w *WatchersServerTransport) dispatchBeginGetTroubleshootingResult(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetTroubleshootingResult.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -738,7 +734,7 @@ func (w *WatchersServerTransport) dispatchBeginGetVMSecurityRules(req *http.Requ return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginGetVMSecurityRules.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -768,12 +764,15 @@ func (w *WatchersServerTransport) dispatchNewListPager(req *http.Request) (*http resp := w.srv.NewListPager(resourceGroupNameParam, nil) newListPager = &resp w.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.WatchersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { w.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -798,12 +797,15 @@ func (w *WatchersServerTransport) dispatchNewListAllPager(req *http.Request) (*h resp := w.srv.NewListAllPager(nil) newListAllPager = &resp w.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armnetwork.WatchersClientListAllResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListAllPager, req) if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { w.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -850,7 +852,7 @@ func (w *WatchersServerTransport) dispatchBeginListAvailableProviders(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginListAvailableProviders.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -898,7 +900,7 @@ func (w *WatchersServerTransport) dispatchBeginSetFlowLogConfiguration(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginSetFlowLogConfiguration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -936,7 +938,7 @@ func (w *WatchersServerTransport) dispatchUpdateTags(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Watcher, req) @@ -983,7 +985,7 @@ func (w *WatchersServerTransport) dispatchBeginVerifyIPFlow(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { w.beginVerifyIPFlow.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go index 2ee65565956d..7ce01081d8ef 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // WebApplicationFirewallPoliciesServer is a fake server for instances of the armnetwork.WebApplicationFirewallPoliciesClient type. @@ -75,9 +75,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) Do(req *http.Request) (* } func (w *WebApplicationFirewallPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -101,10 +99,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchToMethodFake(req } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -142,7 +137,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchCreateOrUpdate(r return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WebApplicationFirewallPolicy, req) @@ -185,7 +180,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchBeginDelete(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { w.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -219,7 +214,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchGet(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WebApplicationFirewallPolicy, req) @@ -256,7 +251,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchNewListPager(req if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { w.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -289,7 +284,7 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchNewListAllPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { w.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go index 9cd29a12a3fd..00d58db66a80 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "net/http" "net/url" "regexp" + "slices" ) // WebCategoriesServer is a fake server for instances of the armnetwork.WebCategoriesClient type. @@ -59,9 +59,7 @@ func (w *WebCategoriesServerTransport) Do(req *http.Request) (*http.Response, er } func (w *WebCategoriesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +77,7 @@ func (w *WebCategoriesServerTransport) dispatchToMethodFake(req *http.Request, m } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -108,11 +103,7 @@ func (w *WebCategoriesServerTransport) dispatchGet(req *http.Request) (*http.Res if err != nil { return nil, err } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(qp.Get("$expand")) var options *armnetwork.WebCategoriesClientGetOptions if expandParam != nil { options = &armnetwork.WebCategoriesClientGetOptions{ @@ -124,7 +115,7 @@ func (w *WebCategoriesServerTransport) dispatchGet(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AzureWebCategory, req) @@ -157,7 +148,7 @@ func (w *WebCategoriesServerTransport) dispatchNewListBySubscriptionPager(req *h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { w.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/network/armnetwork/fake_example_test.go b/sdk/resourcemanager/network/armnetwork/fake_example_test.go index 0ed325c8ed4c..8ddad38aec9d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/fake_example_test.go @@ -13,8 +13,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9/fake" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10/fake" ) func ExampleInterfacesServer() { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go index b06288fa66e1..1d1e645d1115 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPoliciesClient contains the methods for the FirewallPolicies group. // Don't use this type directly, use NewFirewallPoliciesClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPoliciesClient struct { internal *arm.Client subscriptionID string } // NewFirewallPoliciesClient creates a new instance of FirewallPoliciesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPoliciesClient, error) { @@ -43,9 +43,7 @@ func NewFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to the create or update Firewall Policy operation. // - options - FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *FirewallPoliciesClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *FirewallPoliciesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FirewallPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *FirewallPoliciesClient) createOrUpdate(ctx context.Context, resour // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, _ *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *FirewallPoliciesClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *FirewallPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. func (client *FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (FirewallPoliciesClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (Fi } // NewListPager - Lists all Firewall Policies in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager // method. func (client *FirewallPoliciesClient) NewListPager(resourceGroupName string, options *FirewallPoliciesClientListOptions) *runtime.Pager[FirewallPoliciesClientListResponse] { @@ -298,21 +284,21 @@ func (client *FirewallPoliciesClient) NewListPager(resourceGroupName string, opt // listCreateRequest creates the List request. func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *FirewallPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -327,8 +313,6 @@ func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (F } // NewListAllPager - Gets all the Firewall Policies in a subscription. -// -// Generated from API version 2025-05-01 // - options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager // method. func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { @@ -366,8 +350,8 @@ func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -383,9 +367,7 @@ func (client *FirewallPoliciesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates tags of a Azure Firewall Policy resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to update Azure Firewall Policy tags. // - options - FirewallPoliciesClientUpdateTagsOptions contains the optional parameters for the FirewallPoliciesClient.UpdateTags @@ -415,6 +397,10 @@ func (client *FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGr // updateTagsCreateRequest creates the UpdateTags request. func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject, _ *FirewallPoliciesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -423,18 +409,15 @@ func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Contex return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go index 98818f9559a4..bd62a59604cb 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go @@ -1,196 +1,66 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyDelete.json -func ExampleFirewallPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPoliciesClient().BeginDelete(ctx, "rg1", "firewallPolicy", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyGet.json -func ExampleFirewallPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPoliciesClient().Get(ctx, "rg1", "firewallPolicy", &armnetwork.FirewallPoliciesClientGetOptions{Expand: 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.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // Insights: &armnetwork.FirewallPolicyInsights{ - // IsEnabled: to.Ptr(true), - // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ - // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), - // }, - // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ - // { - // Region: to.Ptr("westus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), - // }, - // }, - // { - // Region: to.Ptr("eastus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), - // }, - // }}, - // }, - // RetentionDays: to.Ptr[int32](100), - // }, - // IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ - // Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ - // BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ - // { - // Name: to.Ptr("bypassRule1"), - // Description: to.Ptr("Rule 1"), - // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, - // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // Size: to.Ptr("0.5MB"), - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyPut.json +// Generated from example definition: 2025-07-01/FirewallPolicyPut.json func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewFirewallPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", armnetwork.FirewallPolicy{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.FirewallPolicyPropertiesFormat{ DNSSettings: &armnetwork.DNSSettings{ EnableProxy: to.Ptr(true), RequireProxyForNetworkRules: to.Ptr(false), Servers: []*string{ - to.Ptr("30.3.4.5")}, + to.Ptr("30.3.4.5"), + }, + }, + ExplicitProxySettings: &armnetwork.ExplicitProxySettings{ + EnableExplicitProxy: to.Ptr(true), + EnablePacFile: to.Ptr(true), + HTTPPort: to.Ptr[int32](8087), + HTTPSPort: to.Ptr[int32](8087), + PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), + PacFilePort: to.Ptr[int32](8087), }, Insights: &armnetwork.FirewallPolicyInsights{ IsEnabled: to.Ptr(true), LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ DefaultWorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), }, Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ { Region: to.Ptr("westus"), WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), }, }, { Region: to.Ptr("eastus"), WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), }, - }}, + }, + }, }, RetentionDays: to.Ptr[int32](100), }, @@ -201,28 +71,34 @@ func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { Name: to.Ptr("bypassRule1"), Description: to.Ptr("Rule 1"), DestinationAddresses: []*string{ - to.Ptr("5.6.7.8")}, + to.Ptr("5.6.7.8"), + }, DestinationPorts: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, SourceAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - }}, + }, + }, SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ { ID: to.Ptr("2525004"), Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - }}, + }, + }, }, Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileTypeCore), + Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), }, SKU: &armnetwork.FirewallPolicySKU{ Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), }, Snat: &armnetwork.FirewallPolicySNAT{ PrivateRanges: []*string{ - to.Ptr("IANAPrivateRanges")}, + to.Ptr("IANAPrivateRanges"), + }, }, SQL: &armnetwork.FirewallPolicySQL{ AllowSQLRedirect: to.Ptr(true), @@ -230,9 +106,11 @@ func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ Fqdns: []*string{ - to.Ptr("*.microsoft.com")}, + to.Ptr("*.microsoft.com"), + }, IPAddresses: []*string{ - to.Ptr("20.3.4.5")}, + to.Ptr("20.3.4.5"), + }, }, TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ @@ -241,32 +119,42 @@ func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { }, }, }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // res = armnetwork.FirewallPoliciesClientCreateOrUpdateResponse{ + // FirewallPolicy: armnetwork.FirewallPolicy{ + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, + // }, + // ExplicitProxySettings: &armnetwork.ExplicitProxySettings{ + // EnableExplicitProxy: to.Ptr(true), + // EnablePacFile: to.Ptr(true), + // HTTPPort: to.Ptr[int32](8087), + // HTTPSPort: to.Ptr[int32](8087), + // PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), + // PacFilePort: to.Ptr[int32](8087), // }, // Firewalls: []*armnetwork.SubResource{ // }, @@ -274,21 +162,22 @@ func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { // IsEnabled: to.Ptr(true), // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), // }, // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ // { // Region: to.Ptr("westus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), // }, // }, // { // Region: to.Ptr("eastus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), // }, - // }}, + // }, + // }, // }, // RetentionDays: to.Ptr[int32](100), // }, @@ -299,97 +188,137 @@ func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { // Name: to.Ptr("bypassRule1"), // Description: to.Ptr("Rule 1"), // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, + // to.Ptr("5.6.7.8"), // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileTypeCore), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup2"), - // }}, - // Size: to.Ptr("0.5MB"), - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, + // DestinationPorts: []*string{ + // to.Ptr("*"), // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), + // SourceAddresses: []*string{ + // to.Ptr("1.2.3.4"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } + // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), + // }, + // }, + // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ + // { + // ID: to.Ptr("2525004"), + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), + // }, + // }, + // }, + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), + // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollectionGroups: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup2"), + // }, + // }, + // Size: to.Ptr("0.5MB"), + // SKU: &armnetwork.FirewallPolicySKU{ + // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), + // }, + // Snat: &armnetwork.FirewallPolicySNAT{ + // PrivateRanges: []*string{ + // to.Ptr("IANAPrivateRanges"), + // }, + // }, + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ + // Fqdns: []*string{ + // to.Ptr("*.microsoft.com"), + // }, + // IPAddresses: []*string{ + // to.Ptr("20.3.4.5"), + // }, + // }, + // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ + // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ + // Name: to.Ptr("clientcert"), + // KeyVaultSecretID: to.Ptr("https://kv/secret"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyPatch.json -func ExampleFirewallPoliciesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/FirewallPolicyDelete.json +func ExampleFirewallPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPoliciesClient().UpdateTags(ctx, "myResourceGroup", "firewallPolicy", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewFirewallPoliciesClient().BeginDelete(ctx, "rg1", "firewallPolicy", 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 poll 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.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/myResourceGroup/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // res = armnetwork.FirewallPoliciesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyGet.json +func ExampleFirewallPoliciesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPoliciesClient().Get(ctx, "rg1", "firewallPolicy", 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 = armnetwork.FirewallPoliciesClientGetResponse{ + // FirewallPolicy: armnetwork.FirewallPolicy{ + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, + // }, + // ExplicitProxySettings: &armnetwork.ExplicitProxySettings{ + // EnableExplicitProxy: to.Ptr(true), + // EnablePacFile: to.Ptr(true), + // HTTPPort: to.Ptr[int32](8087), + // HTTPSPort: to.Ptr[int32](8087), + // PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), + // PacFilePort: to.Ptr[int32](8087), // }, // Firewalls: []*armnetwork.SubResource{ // }, @@ -397,21 +326,22 @@ func ExampleFirewallPoliciesClient_UpdateTags() { // IsEnabled: to.Ptr(true), // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), // }, // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ // { // Region: to.Ptr("westus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), // }, // }, // { // Region: to.Ptr("eastus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), // }, - // }}, + // }, + // }, // }, // RetentionDays: to.Ptr[int32](100), // }, @@ -422,61 +352,75 @@ func ExampleFirewallPoliciesClient_UpdateTags() { // Name: to.Ptr("bypassRule1"), // Description: to.Ptr("Rule 1"), // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, + // to.Ptr("5.6.7.8"), // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, + // DestinationPorts: []*string{ + // to.Ptr("*"), // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), + // SourceAddresses: []*string{ + // to.Ptr("1.2.3.4"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } + // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), + // }, + // }, + // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ + // { + // ID: to.Ptr("2525004"), + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), + // }, + // }, + // }, + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollectionGroups: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // }, + // }, + // Size: to.Ptr("0.5MB"), + // SKU: &armnetwork.FirewallPolicySKU{ + // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), + // }, + // Snat: &armnetwork.FirewallPolicySNAT{ + // PrivateRanges: []*string{ + // to.Ptr("IANAPrivateRanges"), + // }, + // }, + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ + // Fqdns: []*string{ + // to.Ptr("*.microsoft.com"), + // }, + // IPAddresses: []*string{ + // to.Ptr("20.3.4.5"), + // }, + // }, + // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ + // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ + // Name: to.Ptr("clientcert"), + // KeyVaultSecretID: to.Ptr("https://kv/secret"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyListByResourceGroup.json +// Generated from example definition: 2025-07-01/FirewallPolicyListByResourceGroup.json func ExampleFirewallPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -491,56 +435,62 @@ func ExampleFirewallPoliciesClient_NewListPager() { _ = 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.FirewallPolicyListResult = armnetwork.FirewallPolicyListResult{ - // Value: []*armnetwork.FirewallPolicy{ - // { - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // page = armnetwork.FirewallPoliciesClientListResponse{ + // FirewallPolicyListResult: armnetwork.FirewallPolicyListResult{ + // Value: []*armnetwork.FirewallPolicy{ + // { + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, // }, // Firewalls: []*armnetwork.SubResource{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RuleCollectionGroups: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // }, + // }, // SKU: &armnetwork.FirewallPolicySKU{ // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), // }, // Snat: &armnetwork.FirewallPolicySNAT{ // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), + // to.Ptr("IANAPrivateRanges"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), // }, - // }}, - // } + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyListBySubscription.json +// Generated from example definition: 2025-07-01/FirewallPolicyListBySubscription.json func ExampleFirewallPoliciesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -555,44 +505,188 @@ func ExampleFirewallPoliciesClient_NewListAllPager() { _ = 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.FirewallPolicyListResult = armnetwork.FirewallPolicyListResult{ - // Value: []*armnetwork.FirewallPolicy{ - // { - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // page = armnetwork.FirewallPoliciesClientListAllResponse{ + // FirewallPolicyListResult: armnetwork.FirewallPolicyListResult{ + // Value: []*armnetwork.FirewallPolicy{ + // { + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, // }, // Firewalls: []*armnetwork.SubResource{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RuleCollectionGroups: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // }, + // }, // SKU: &armnetwork.FirewallPolicySKU{ // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), // }, // Snat: &armnetwork.FirewallPolicySNAT{ // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, + // to.Ptr("IANAPrivateRanges"), // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), // }, - // }}, - // } + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyPatch.json +func ExampleFirewallPoliciesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + res, err := clientFactory.NewFirewallPoliciesClient().UpdateTags(ctx, "myResourceGroup", "firewallPolicy", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.FirewallPoliciesClientUpdateTagsResponse{ + // FirewallPolicy: armnetwork.FirewallPolicy{ + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, + // }, + // ExplicitProxySettings: &armnetwork.ExplicitProxySettings{ + // EnableExplicitProxy: to.Ptr(true), + // HTTPPort: to.Ptr[int32](8087), + // HTTPSPort: to.Ptr[int32](8087), + // PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), + // PacFilePort: to.Ptr[int32](8087), + // }, + // Firewalls: []*armnetwork.SubResource{ + // }, + // Insights: &armnetwork.FirewallPolicyInsights{ + // IsEnabled: to.Ptr(true), + // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ + // DefaultWorkspaceID: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + // }, + // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ + // { + // Region: to.Ptr("westus"), + // WorkspaceID: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + // }, + // }, + // { + // Region: to.Ptr("eastus"), + // WorkspaceID: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + // }, + // }, + // }, + // }, + // RetentionDays: to.Ptr[int32](100), + // }, + // IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ + // Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ + // BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ + // { + // Name: to.Ptr("bypassRule1"), + // Description: to.Ptr("Rule 1"), + // DestinationAddresses: []*string{ + // to.Ptr("5.6.7.8"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("*"), + // }, + // SourceAddresses: []*string{ + // to.Ptr("1.2.3.4"), + // }, + // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), + // }, + // }, + // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ + // { + // ID: to.Ptr("2525004"), + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), + // }, + // }, + // }, + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollectionGroups: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // }, + // }, + // SKU: &armnetwork.FirewallPolicySKU{ + // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), + // }, + // Snat: &armnetwork.FirewallPolicySNAT{ + // PrivateRanges: []*string{ + // to.Ptr("IANAPrivateRanges"), + // }, + // }, + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ + // Fqdns: []*string{ + // to.Ptr("*.microsoft.com"), + // }, + // IPAddresses: []*string{ + // to.Ptr("20.3.4.5"), + // }, + // }, + // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ + // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ + // Name: to.Ptr("clientcert"), + // KeyVaultSecretID: to.Ptr("https://kv/secret"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go index 33dce7a6c68f..bf62c5e613ef 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go index a59440db9a18..402ca9c05bd7 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyDeploymentsClient contains the methods for the FirewallPolicyDeployments group. // Don't use this type directly, use NewFirewallPolicyDeploymentsClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyDeploymentsClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyDeploymentsClient creates a new instance of FirewallPolicyDeploymentsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyDeploymentsClient, error) { @@ -43,9 +43,7 @@ func NewFirewallPolicyDeploymentsClient(subscriptionID string, credential azcore // BeginDeploy - Deploys the firewall policy draft and child rule collection group drafts. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDeploymentsClientBeginDeployOptions contains the optional parameters for the FirewallPolicyDeploymentsClient.BeginDeploy // method. @@ -69,8 +67,6 @@ func (client *FirewallPolicyDeploymentsClient) BeginDeploy(ctx context.Context, // Deploy - Deploys the firewall policy draft and child rule collection group drafts. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FirewallPolicyDeploymentsClient) deploy(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDeploymentsClientBeginDeployOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyDeploymentsClient.BeginDeploy" @@ -95,6 +91,10 @@ func (client *FirewallPolicyDeploymentsClient) deploy(ctx context.Context, resou // deployCreateRequest creates the Deploy request. func (client *FirewallPolicyDeploymentsClient) deployCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyDeploymentsClientBeginDeployOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/deploy" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -103,17 +103,12 @@ func (client *FirewallPolicyDeploymentsClient) deployCreateRequest(ctx context.C return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go index 69aff3b2b798..0097081df30f 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyDraftDeploy.json +// Generated from example definition: 2025-07-01/FirewallPolicyDraftDeploy.json func ExampleFirewallPolicyDeploymentsClient_BeginDeploy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -31,6 +28,6 @@ func ExampleFirewallPolicyDeploymentsClient_BeginDeploy() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go index 4488ae71d743..24237307b93e 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyDraftsClient contains the methods for the FirewallPolicyDrafts group. // Don't use this type directly, use NewFirewallPolicyDraftsClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyDraftsClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyDraftsClient creates a new instance of FirewallPolicyDraftsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyDraftsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyDraftsClient, error) { @@ -43,9 +43,7 @@ func NewFirewallPolicyDraftsClient(subscriptionID string, credential azcore.Toke // CreateOrUpdate - Create or update a draft Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to the create or update Firewall Policy Draft operation. // - options - FirewallPolicyDraftsClientCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyDraftsClient.CreateOrUpdate @@ -75,6 +73,10 @@ func (client *FirewallPolicyDraftsClient) CreateOrUpdate(ctx context.Context, re // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *FirewallPolicyDraftsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicyDraft, _ *FirewallPolicyDraftsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -83,18 +85,15 @@ func (client *FirewallPolicyDraftsClient) createOrUpdateCreateRequest(ctx contex return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -112,9 +111,7 @@ func (client *FirewallPolicyDraftsClient) createOrUpdateHandleResponse(resp *htt // Delete - Delete a draft policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientDeleteOptions contains the optional parameters for the FirewallPolicyDraftsClient.Delete // method. @@ -142,6 +139,10 @@ func (client *FirewallPolicyDraftsClient) Delete(ctx context.Context, resourceGr // deleteCreateRequest creates the Delete request. func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyDraftsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -150,26 +151,19 @@ func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Contex return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get a draft Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientGetOptions contains the optional parameters for the FirewallPolicyDraftsClient.Get // method. @@ -198,6 +192,10 @@ func (client *FirewallPolicyDraftsClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *FirewallPolicyDraftsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyDraftsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -206,17 +204,13 @@ func (client *FirewallPolicyDraftsClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go index 71456303495b..90fce0fb3717 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyDraftPut.json +// Generated from example definition: 2025-07-01/FirewallPolicyDraftPut.json func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,7 +29,8 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { EnableProxy: to.Ptr(true), RequireProxyForNetworkRules: to.Ptr(false), Servers: []*string{ - to.Ptr("30.3.4.5")}, + to.Ptr("30.3.4.5"), + }, }, ExplicitProxy: &armnetwork.ExplicitProxySettings{ EnableExplicitProxy: to.Ptr(true), @@ -46,21 +44,22 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { IsEnabled: to.Ptr(true), LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ DefaultWorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), }, Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ { Region: to.Ptr("westus"), WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), }, }, { Region: to.Ptr("eastus"), WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), }, - }}, + }, + }, }, RetentionDays: to.Ptr[int32](100), }, @@ -71,25 +70,31 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { Name: to.Ptr("bypassRule1"), Description: to.Ptr("Rule 1"), DestinationAddresses: []*string{ - to.Ptr("5.6.7.8")}, + to.Ptr("5.6.7.8"), + }, DestinationPorts: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, SourceAddresses: []*string{ - to.Ptr("1.2.3.4")}, + to.Ptr("1.2.3.4"), + }, Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - }}, + }, + }, SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ { ID: to.Ptr("2525004"), Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - }}, + }, + }, }, Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), }, Snat: &armnetwork.FirewallPolicySNAT{ PrivateRanges: []*string{ - to.Ptr("IANAPrivateRanges")}, + to.Ptr("IANAPrivateRanges"), + }, }, SQL: &armnetwork.FirewallPolicySQL{ AllowSQLRedirect: to.Ptr(true), @@ -97,9 +102,11 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ Fqdns: []*string{ - to.Ptr("*.microsoft.com")}, + to.Ptr("*.microsoft.com"), + }, IPAddresses: []*string{ - to.Ptr("20.3.4.5")}, + to.Ptr("20.3.4.5"), + }, }, }, }, nil) @@ -109,16 +116,18 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { // 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.FirewallPolicyDraft = armnetwork.FirewallPolicyDraft{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Properties: &armnetwork.FirewallPolicyDraftProperties{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // res = armnetwork.FirewallPolicyDraftsClientCreateOrUpdateResponse{ + // FirewallPolicyDraft: armnetwork.FirewallPolicyDraft{ + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Properties: &armnetwork.FirewallPolicyDraftProperties{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, // }, // ExplicitProxy: &armnetwork.ExplicitProxySettings{ // EnableExplicitProxy: to.Ptr(true), @@ -132,21 +141,22 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { // IsEnabled: to.Ptr(true), // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), // }, // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ // { // Region: to.Ptr("westus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), // }, // }, // { // Region: to.Ptr("eastus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), // }, - // }}, + // }, + // }, // }, // RetentionDays: to.Ptr[int32](100), // }, @@ -157,65 +167,79 @@ func ExampleFirewallPolicyDraftsClient_CreateOrUpdate() { // Name: to.Ptr("bypassRule1"), // Description: to.Ptr("Rule 1"), // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, + // to.Ptr("5.6.7.8"), // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, + // DestinationPorts: []*string{ + // to.Ptr("*"), // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), + // SourceAddresses: []*string{ + // to.Ptr("1.2.3.4"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // }, - // } + // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), + // }, + // }, + // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ + // { + // ID: to.Ptr("2525004"), + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), + // }, + // }, + // }, + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), + // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), + // }, + // Snat: &armnetwork.FirewallPolicySNAT{ + // PrivateRanges: []*string{ + // to.Ptr("IANAPrivateRanges"), + // }, + // }, + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ + // Fqdns: []*string{ + // to.Ptr("*.microsoft.com"), + // }, + // IPAddresses: []*string{ + // to.Ptr("20.3.4.5"), + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyDraftDelete.json +// Generated from example definition: 2025-07-01/FirewallPolicyDraftDelete.json func ExampleFirewallPolicyDraftsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewFirewallPolicyDraftsClient().Delete(ctx, "rg1", "firewallPolicy", nil) + res, err := clientFactory.NewFirewallPolicyDraftsClient().Delete(ctx, "rg1", "firewallPolicy", 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 = armnetwork.FirewallPolicyDraftsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyDraftGet.json +// Generated from example definition: 2025-07-01/FirewallPolicyDraftGet.json func ExampleFirewallPolicyDraftsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -226,16 +250,18 @@ func ExampleFirewallPolicyDraftsClient_Get() { // 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.FirewallPolicyDraft = armnetwork.FirewallPolicyDraft{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Properties: &armnetwork.FirewallPolicyDraftProperties{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, + // res = armnetwork.FirewallPolicyDraftsClientGetResponse{ + // FirewallPolicyDraft: armnetwork.FirewallPolicyDraft{ + // Name: to.Ptr("firewallPolicy"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), + // Properties: &armnetwork.FirewallPolicyDraftProperties{ + // DNSSettings: &armnetwork.DNSSettings{ + // EnableProxy: to.Ptr(true), + // RequireProxyForNetworkRules: to.Ptr(false), + // Servers: []*string{ + // to.Ptr("30.3.4.5"), + // }, // }, // ExplicitProxy: &armnetwork.ExplicitProxySettings{ // EnableExplicitProxy: to.Ptr(true), @@ -249,21 +275,22 @@ func ExampleFirewallPolicyDraftsClient_Get() { // IsEnabled: to.Ptr(true), // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), // }, // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ // { // Region: to.Ptr("westus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), // }, // }, // { // Region: to.Ptr("eastus"), // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), // }, - // }}, + // }, + // }, // }, // RetentionDays: to.Ptr[int32](100), // }, @@ -274,35 +301,44 @@ func ExampleFirewallPolicyDraftsClient_Get() { // Name: to.Ptr("bypassRule1"), // Description: to.Ptr("Rule 1"), // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, + // to.Ptr("5.6.7.8"), // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, + // DestinationPorts: []*string{ + // to.Ptr("*"), // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), + // SourceAddresses: []*string{ + // to.Ptr("1.2.3.4"), // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // }, - // } + // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), + // }, + // }, + // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ + // { + // ID: to.Ptr("2525004"), + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), + // }, + // }, + // }, + // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), + // }, + // Snat: &armnetwork.FirewallPolicySNAT{ + // PrivateRanges: []*string{ + // to.Ptr("IANAPrivateRanges"), + // }, + // }, + // SQL: &armnetwork.FirewallPolicySQL{ + // AllowSQLRedirect: to.Ptr(true), + // }, + // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), + // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ + // Fqdns: []*string{ + // to.Ptr("*.microsoft.com"), + // }, + // IPAddresses: []*string{ + // to.Ptr("20.3.4.5"), + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go index 804376470893..0466346c8647 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyIdpsSignaturesClient contains the methods for the FirewallPolicyIdpsSignatures group. // Don't use this type directly, use NewFirewallPolicyIdpsSignaturesClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyIdpsSignaturesClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyIdpsSignaturesClient creates a new instance of FirewallPolicyIdpsSignaturesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesClient, error) { @@ -44,9 +44,7 @@ func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azc // List - Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is // 1000. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List // method. @@ -75,6 +73,10 @@ func (client *FirewallPolicyIdpsSignaturesClient) List(ctx context.Context, reso // listCreateRequest creates the List request. func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject, _ *FirewallPolicyIdpsSignaturesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -83,18 +85,15 @@ func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context. return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go index 3e41b727ad53..fde3b5c3c6ea 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyQuerySignatureOverrides.json +// Generated from example definition: 2025-07-01/FirewallPolicyQuerySignatureOverrides.json func ExampleFirewallPolicyIdpsSignaturesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -31,8 +28,10 @@ func ExampleFirewallPolicyIdpsSignaturesClient_List() { { Field: to.Ptr("Mode"), Values: []*string{ - to.Ptr("Deny")}, - }}, + to.Ptr("Deny"), + }, + }, + }, OrderBy: &armnetwork.OrderBy{ Field: to.Ptr("severity"), Order: to.Ptr(armnetwork.FirewallPolicyIDPSQuerySortOrderAscending), @@ -47,38 +46,45 @@ func ExampleFirewallPolicyIdpsSignaturesClient_List() { // 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.QueryResults = armnetwork.QueryResults{ - // MatchingRecordsCount: to.Ptr[int64](2), - // Signatures: []*armnetwork.SingleQueryResult{ - // { - // Description: to.Ptr("P2P Phatbot Control Connection"), - // DestinationPorts: []*string{ - // to.Ptr("any")}, - // Direction: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureDirectionTwo), + // res = armnetwork.FirewallPolicyIdpsSignaturesClientListResponse{ + // QueryResults: armnetwork.QueryResults{ + // MatchingRecordsCount: to.Ptr[int64](2), + // Signatures: []*armnetwork.SingleQueryResult{ + // { + // Description: to.Ptr("P2P Phatbot Control Connection"), + // DestinationPorts: []*string{ + // to.Ptr("any"), + // }, + // Direction: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureDirectionTwo), // Group: to.Ptr("A Network Trojan was detected"), // InheritedFromParentPolicy: to.Ptr(false), // LastUpdated: to.Ptr("2010-07-30T00:00:00"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureModeTwo), - // Severity: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureSeverityOne), + // Mode: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureModeTwo), + // Severity: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureSeverityOne), // SignatureID: to.Ptr[int32](2000015), // SourcePorts: []*string{ - // to.Ptr("any")}, - // Protocol: to.Ptr("tcp"), + // to.Ptr("any"), + // }, + // Protocol: to.Ptr("tcp"), + // }, + // { + // Description: to.Ptr("WEB_SERVER SQL sp_delete_alert attempt"), + // DestinationPorts: []*string{ + // to.Ptr("any"), + // }, + // Direction: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureDirectionOne), + // Group: to.Ptr("Attempted User Privilege Gain"), + // InheritedFromParentPolicy: to.Ptr(false), + // LastUpdated: to.Ptr("2019-09-27T00:00:00"), + // Mode: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureModeTwo), + // Severity: to.Ptr( armnetwork.FirewallPolicyIDPSSignatureSeverityOne), + // SignatureID: to.Ptr[int32](2000106), + // SourcePorts: []*string{ + // to.Ptr("any"), // }, - // { - // Description: to.Ptr("WEB_SERVER SQL sp_delete_alert attempt"), - // DestinationPorts: []*string{ - // to.Ptr("any")}, - // Direction: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureDirectionOne), - // Group: to.Ptr("Attempted User Privilege Gain"), - // InheritedFromParentPolicy: to.Ptr(false), - // LastUpdated: to.Ptr("2019-09-27T00:00:00"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureModeTwo), - // Severity: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureSeverityOne), - // SignatureID: to.Ptr[int32](2000106), - // SourcePorts: []*string{ - // to.Ptr("any")}, - // Protocol: to.Ptr("http"), - // }}, - // } + // Protocol: to.Ptr("http"), + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go index c2cd1f979889..5c4d4ce3e3a2 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyIdpsSignaturesFilterValuesClient contains the methods for the FirewallPolicyIdpsSignaturesFilterValues group. // Don't use this type directly, use NewFirewallPolicyIdpsSignaturesFilterValuesClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyIdpsSignaturesFilterValuesClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyIdpsSignaturesFilterValuesClient creates a new instance of FirewallPolicyIdpsSignaturesFilterValuesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesFilterValuesClient, error) { @@ -43,9 +43,7 @@ func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string, cr // List - Retrieves the current filter values for the signatures overrides // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List // method. @@ -74,6 +72,10 @@ func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) List(ctx context.C // listCreateRequest creates the List request. func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignatureOverridesFilterValuesQuery, _ *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,18 +84,15 @@ func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest( return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go index 3a1fea5511f5..8c9adf123578 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyQuerySignatureOverridesFilterValues.json +// Generated from example definition: 2025-07-01/FirewallPolicyQuerySignatureOverridesFilterValues.json func ExampleFirewallPolicyIdpsSignaturesFilterValuesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,10 +32,13 @@ func ExampleFirewallPolicyIdpsSignaturesFilterValuesClient_List() { // 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.SignatureOverridesFilterValuesResponse = armnetwork.SignatureOverridesFilterValuesResponse{ - // FilterValues: []*string{ - // to.Ptr("low"), - // to.Ptr("medium"), - // to.Ptr("high")}, - // } + // res = armnetwork.FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{ + // SignatureOverridesFilterValuesResponse: armnetwork.SignatureOverridesFilterValuesResponse{ + // FilterValues: []*string{ + // to.Ptr("low"), + // to.Ptr("medium"), + // to.Ptr("high"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go index d00edee9a232..cc4e11700c06 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyIdpsSignaturesOverridesClient contains the methods for the FirewallPolicyIdpsSignaturesOverrides group. // Don't use this type directly, use NewFirewallPolicyIdpsSignaturesOverridesClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyIdpsSignaturesOverridesClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyIdpsSignaturesOverridesClient creates a new instance of FirewallPolicyIdpsSignaturesOverridesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesOverridesClient, error) { @@ -43,9 +43,7 @@ func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string, crede // Get - Returns all signatures overrides for a specific policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get // method. @@ -74,6 +72,10 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Conte // getCreateRequest creates the Get request. func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,17 +84,13 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -108,9 +106,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) getHandleResponse(res // List - Returns all signatures overrides objects for a specific policy as a list containing a single value. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List // method. @@ -139,6 +135,10 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Cont // listCreateRequest creates the List request. func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -147,17 +147,13 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -173,9 +169,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) listHandleResponse(re // Patch - Will update the status of policy's signature overrides for IDPS // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put // - options - FirewallPolicyIdpsSignaturesOverridesClientPatchOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Patch @@ -205,6 +199,10 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) Patch(ctx context.Con // patchCreateRequest creates the Patch request. func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, _ *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -213,18 +211,15 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ct return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -242,9 +237,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchHandleResponse(r // Put - Will override/create a new signature overrides for the policy's IDPS // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put // - options - FirewallPolicyIdpsSignaturesOverridesClientPutOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Put @@ -274,6 +267,10 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) Put(ctx context.Conte // putCreateRequest creates the Put request. func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, _ *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -282,18 +279,15 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go index 4cd0bad11bda..cb9686480b27 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go @@ -1,163 +1,169 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicySignatureOverridesPatch.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Patch() { +// Generated from example definition: 2025-07-01/FirewallPolicySignatureOverridesGet.json +func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Patch(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - Properties: &armnetwork.SignaturesOverridesProperties{ - Signatures: map[string]*string{ - "2000105": to.Ptr("Off"), - "2000106": to.Ptr("Deny"), - }, - }, - }, nil) + res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Get(ctx, "rg1", "firewallPolicy", 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.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), + // res = armnetwork.FirewallPolicyIdpsSignaturesOverridesClientGetResponse{ + // SignaturesOverrides: armnetwork.SignaturesOverrides{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + // Properties: &armnetwork.SignaturesOverridesProperties{ + // Signatures: map[string]*string{ + // "2000105": to.Ptr("Off"), + // "2000106": to.Ptr("Deny"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicySignatureOverridesPut.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Put() { +// Generated from example definition: 2025-07-01/FirewallPolicySignatureOverridesList.json +func ExampleFirewallPolicyIdpsSignaturesOverridesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Put(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - Properties: &armnetwork.SignaturesOverridesProperties{ - Signatures: map[string]*string{ - "2000105": to.Ptr("Off"), - "2000106": to.Ptr("Deny"), - }, - }, - }, nil) + res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().List(ctx, "rg1", "firewallPolicy", 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.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), + // res = armnetwork.FirewallPolicyIdpsSignaturesOverridesClientListResponse{ + // SignaturesOverridesList: armnetwork.SignaturesOverridesList{ + // Value: []*armnetwork.SignaturesOverrides{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + // Properties: &armnetwork.SignaturesOverridesProperties{ + // Signatures: map[string]*string{ + // "2000105": to.Ptr("Off"), + // "2000106": to.Ptr("Deny"), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicySignatureOverridesGet.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Get() { +// Generated from example definition: 2025-07-01/FirewallPolicySignatureOverridesPatch.json +func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Patch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Get(ctx, "rg1", "firewallPolicy", nil) + res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Patch(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ + Name: to.Ptr("default"), + Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + Properties: &armnetwork.SignaturesOverridesProperties{ + Signatures: map[string]*string{ + "2000105": to.Ptr("Off"), + "2000106": to.Ptr("Deny"), + }, + }, + }, 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.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), + // res = armnetwork.FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{ + // SignaturesOverrides: armnetwork.SignaturesOverrides{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + // Properties: &armnetwork.SignaturesOverridesProperties{ + // Signatures: map[string]*string{ + // "2000105": to.Ptr("Off"), + // "2000106": to.Ptr("Deny"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicySignatureOverridesList.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_List() { +// Generated from example definition: 2025-07-01/FirewallPolicySignatureOverridesPut.json +func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().List(ctx, "rg1", "firewallPolicy", nil) + res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Put(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ + Name: to.Ptr("default"), + Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + Properties: &armnetwork.SignaturesOverridesProperties{ + Signatures: map[string]*string{ + "2000105": to.Ptr("Off"), + "2000106": to.Ptr("Deny"), + }, + }, + }, 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.SignaturesOverridesList = armnetwork.SignaturesOverridesList{ - // Value: []*armnetwork.SignaturesOverrides{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), - // }, + // res = armnetwork.FirewallPolicyIdpsSignaturesOverridesClientPutResponse{ + // SignaturesOverrides: armnetwork.SignaturesOverrides{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), + // Properties: &armnetwork.SignaturesOverridesProperties{ + // Signatures: map[string]*string{ + // "2000105": to.Ptr("Off"), + // "2000106": to.Ptr("Deny"), // }, - // }}, + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go index 340b3af763ff..31a6bf23e93b 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyRuleCollectionGroupDraftsClient contains the methods for the FirewallPolicyRuleCollectionGroupDrafts group. // Don't use this type directly, use NewFirewallPolicyRuleCollectionGroupDraftsClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyRuleCollectionGroupDraftsClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyRuleCollectionGroupDraftsClient creates a new instance of FirewallPolicyRuleCollectionGroupDraftsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyRuleCollectionGroupDraftsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyRuleCollectionGroupDraftsClient, error) { @@ -43,11 +43,10 @@ func NewFirewallPolicyRuleCollectionGroupDraftsClient(subscriptionID string, cre // CreateOrUpdate - Create or Update Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - parameters - Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. // - options - FirewallPolicyRuleCollectionGroupDraftsClientCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupDraftsClient.CreateOrUpdate // method. @@ -76,6 +75,10 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) CreateOrUpdate(ctx // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroupDraft, _ *FirewallPolicyRuleCollectionGroupDraftsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,18 +91,15 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateCreat return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -117,11 +117,10 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateHandl // Delete - Delete Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - FirewallPolicyRuleCollectionGroupDraftsClientDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupDraftsClient.Delete // method. func (client *FirewallPolicyRuleCollectionGroupDraftsClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupDraftsClientDeleteOptions) (FirewallPolicyRuleCollectionGroupDraftsClientDeleteResponse, error) { @@ -148,6 +147,10 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) Delete(ctx context. // deleteCreateRequest creates the Delete request. func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, _ *FirewallPolicyRuleCollectionGroupDraftsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -160,28 +163,22 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - FirewallPolicyRuleCollectionGroupDraftsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupDraftsClient.Get // method. func (client *FirewallPolicyRuleCollectionGroupDraftsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupDraftsClientGetOptions) (FirewallPolicyRuleCollectionGroupDraftsClientGetResponse, error) { @@ -209,6 +206,10 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) Get(ctx context.Con // getCreateRequest creates the Get request. func (client *FirewallPolicyRuleCollectionGroupDraftsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, _ *FirewallPolicyRuleCollectionGroupDraftsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -221,17 +222,13 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) getCreateRequest(ct return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go index 2a0eb6039c1f..cd0a1c25fc94 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go @@ -1,45 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupDraftDelete.json -func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallPolicyRuleCollectionGroupDraftsClient().Delete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupDraftPut.json +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupDraftPut.json func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -48,26 +28,32 @@ func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_CreateOrUpdate() { Priority: to.Ptr[int32](100), RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - Priority: to.Ptr[int32](100), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + Name: to.Ptr("Example-Filter-Rule-Collection"), Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), }, + Priority: to.Ptr[int32](100), + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), Rules: []armnetwork.FirewallPolicyRuleClassification{ &armnetwork.Rule{ - Name: to.Ptr("network-rule1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + Name: to.Ptr("network-rule1"), DestinationAddresses: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, + to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), SourceAddresses: []*string{ - to.Ptr("10.1.25.0/24")}, - }}, - }}, + to.Ptr("10.1.25.0/24"), + }, + }, + }, + }, + }, }, }, nil) if err != nil { @@ -76,45 +62,75 @@ func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_CreateOrUpdate() { // 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.FirewallPolicyRuleCollectionGroupDraft = armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ - // Priority: to.Ptr[int32](100), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, + // res = armnetwork.FirewallPolicyRuleCollectionGroupDraftsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroupDraft: armnetwork.FirewallPolicyRuleCollectionGroupDraft{ + // Name: to.Ptr("ruleCollectionGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ + // Priority: to.Ptr[int32](100), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](100), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule1"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceAddresses: []*string{ + // to.Ptr("10.1.25.0/24"), + // }, + // }, // }, - // } + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupDraftGet.json +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupDraftDelete.json +func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupDraftsClient().Delete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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 = armnetwork.FirewallPolicyRuleCollectionGroupDraftsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupDraftGet.json func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -125,33 +141,41 @@ func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_Get() { // 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.FirewallPolicyRuleCollectionGroupDraft = armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ - // Priority: to.Ptr[int32](110), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, + // res = armnetwork.FirewallPolicyRuleCollectionGroupDraftsClientGetResponse{ + // FirewallPolicyRuleCollectionGroupDraft: armnetwork.FirewallPolicyRuleCollectionGroupDraft{ + // Name: to.Ptr("ruleCollectionGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ + // Priority: to.Ptr[int32](110), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](200), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule1"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceAddresses: []*string{ + // to.Ptr("10.1.25.0/24"), + // }, + // }, // }, - // } + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go index b121f2846115..5cf30d9d6cf5 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FirewallPolicyRuleCollectionGroupsClient contains the methods for the FirewallPolicyRuleCollectionGroups group. // Don't use this type directly, use NewFirewallPolicyRuleCollectionGroupsClient() instead. +// +// Generated from API version 2025-07-01 type FirewallPolicyRuleCollectionGroupsClient struct { internal *arm.Client subscriptionID string } // NewFirewallPolicyRuleCollectionGroupsClient creates a new instance of FirewallPolicyRuleCollectionGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyRuleCollectionGroupsClient, error) { @@ -43,11 +43,10 @@ func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - parameters - Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. // - options - FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate // method. @@ -58,8 +57,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginCreateOrUpdate(ctx return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +69,6 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdate(ctx conte // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, _ *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +126,10 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ // BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete // method. func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*runtime.Poller[FirewallPolicyRuleCollectionGroupsClientDeleteResponse], error) { @@ -143,8 +139,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +151,6 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context. // Delete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyRuleCollectionGroupsClient.BeginDelete" @@ -182,6 +175,10 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx cont // deleteCreateRequest creates the Delete request. func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, _ *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +191,22 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. -// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - ruleCollectionGroupName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - FirewallPolicyRuleCollectionGroupsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.Get // method. func (client *FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (FirewallPolicyRuleCollectionGroupsClientGetResponse, error) { @@ -243,6 +234,10 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, // getCreateRequest creates the Get request. func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, _ *FirewallPolicyRuleCollectionGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +250,13 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx con return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +271,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp * } // NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.NewListPager // method. @@ -312,6 +301,10 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) NewListPager(resourceGro // listCreateRequest creates the List request. func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, _ *FirewallPolicyRuleCollectionGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +313,13 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx co return nil, errors.New("parameter firewallPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go index d678a9e1a8af..bb9881ec50e8 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go @@ -1,262 +1,129 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupDelete.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginDelete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyNatRuleCollectionGroupGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyNatRuleCollectionGroup() { +// Generated from example definition: 2025-07-01/FirewallPolicyNatRuleCollectionGroupPut.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyNatRuleCollectionGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) + poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ + Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + Priority: to.Ptr[int32](100), + RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + &armnetwork.FirewallPolicyNatRuleCollection{ + Name: to.Ptr("Example-Nat-Rule-Collection"), + Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ + Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), + }, + Priority: to.Ptr[int32](100), + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), + Rules: []armnetwork.FirewallPolicyRuleClassification{ + &armnetwork.NatRule{ + Name: to.Ptr("nat-rule1"), + DestinationAddresses: []*string{ + to.Ptr("152.23.32.23"), + }, + DestinationPorts: []*string{ + to.Ptr("8080"), + }, + IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP), + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), + SourceAddresses: []*string{ + to.Ptr("2.2.2.2"), + }, + SourceIPGroups: []*string{}, + TranslatedFqdn: to.Ptr("internalhttp.server.net"), + TranslatedPort: to.Ptr("8080"), + }, + }, + }, + }, + }, + }, 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyNatRuleCollection{ - // Name: to.Ptr("NatRC"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.NatRule{ - // Name: to.Ptr("NatRule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), - // DestinationAddresses: []*string{ - // to.Ptr("152.23.32.23")}, - // DestinationPorts: []*string{ - // to.Ptr("8080")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, - // SourceAddresses: []*string{ - // to.Ptr("2.2.2.2")}, - // SourceIPGroups: []*string{ - // }, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("8080"), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // Size: to.Ptr("1.2MB"), + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](100), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyNatRuleCollection{ + // Name: to.Ptr("Example-Nat-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleGroup1", 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleGroups/ruleGroup1"), - // Name: to.Ptr("ruleGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, + // Priority: to.Ptr[int32](100), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.NatRule{ + // Name: to.Ptr("nat-rule1"), + // DestinationAddresses: []*string{ + // to.Ptr("152.23.32.23"), + // }, // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, + // to.Ptr("8080"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), + // SourceAddresses: []*string{ + // to.Ptr("2.2.2.2"), + // }, + // SourceIPGroups: []*string{ + // }, + // TranslatedFqdn: to.Ptr("internalhttp.server.net"), + // TranslatedPort: to.Ptr("8080"), + // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithWebCategories() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyNatRuleCollectionGroup() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupPut.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -264,31 +131,33 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ Priority: to.Ptr[int32](100), RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyNatRuleCollection{ - Name: to.Ptr("Example-Nat-Rule-Collection"), - Priority: to.Ptr[int32](100), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), + &armnetwork.FirewallPolicyFilterRuleCollection{ + Name: to.Ptr("Example-Filter-Rule-Collection"), + Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), }, + Priority: to.Ptr[int32](100), + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.NatRule{ - Name: to.Ptr("nat-rule1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), + &armnetwork.Rule{ + Name: to.Ptr("network-rule1"), DestinationAddresses: []*string{ - to.Ptr("152.23.32.23")}, + to.Ptr("*"), + }, DestinationPorts: []*string{ - to.Ptr("8080")}, + to.Ptr("*"), + }, IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), SourceAddresses: []*string{ - to.Ptr("2.2.2.2")}, - SourceIPGroups: []*string{}, - TranslatedFqdn: to.Ptr("internalhttp.server.net"), - TranslatedPort: to.Ptr("8080"), - }}, - }}, + to.Ptr("10.1.25.0/24"), + }, + }, + }, + }, + }, }, }, nil) if err != nil { @@ -296,85 +165,102 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyNatRuleCollection{ - // Name: to.Ptr("Example-Nat-Rule-Collection"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.NatRule{ - // Name: to.Ptr("nat-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), - // DestinationAddresses: []*string{ - // to.Ptr("152.23.32.23")}, + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](100), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](100), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule1"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, // DestinationPorts: []*string{ - // to.Ptr("8080")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, - // SourceAddresses: []*string{ - // to.Ptr("2.2.2.2")}, - // SourceIPGroups: []*string{ - // }, - // TranslatedFqdn: to.Ptr("internalhttp.server.net"), - // TranslatedPort: to.Ptr("8080"), - // }}, - // }}, + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceAddresses: []*string{ + // to.Ptr("10.1.25.0/24"), + // }, + // }, // }, - // } + // }, + // }, + // Size: to.Ptr("1.2MB"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroup() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](100), + Priority: to.Ptr[int32](110), RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - Priority: to.Ptr[int32](100), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + Name: to.Ptr("Example-Filter-Rule-Collection"), Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow), }, + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.Rule{ - Name: to.Ptr("network-rule1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, + &armnetwork.ApplicationRule{ + Name: to.Ptr("rule1"), + Description: to.Ptr("Insert trusted tenants header"), + FqdnTags: []*string{ + to.Ptr("WindowsVirtualDesktop"), + }, + HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{ + { + HeaderName: to.Ptr("Restrict-Access-To-Tenants"), + HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"), + }, + }, + Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ + { + Port: to.Ptr[int32](80), + ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP), + }, + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), SourceAddresses: []*string{ - to.Ptr("10.1.25.0/24")}, - }}, - }}, + to.Ptr("216.58.216.164"), + to.Ptr("10.0.0.0/24"), + }, + }, + }, + }, + }, }, }, nil) if err != nil { @@ -382,53 +268,67 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // Size: to.Ptr("1.2MB"), + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow), + // }, + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.ApplicationRule{ + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Insert trusted tenants header"), + // FqdnTags: []*string{ + // to.Ptr("WindowsVirtualDesktop"), + // }, + // HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{ + // { + // HeaderName: to.Ptr("Restrict-Access-To-Tenants"), + // HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"), + // }, + // }, + // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ + // { + // Port: to.Ptr[int32](80), + // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP), + // }, + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // }, // }, - // } + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithIpGroups() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithIPGroups() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -437,25 +337,31 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF Priority: to.Ptr[int32](110), RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + Name: to.Ptr("Example-Filter-Rule-Collection"), Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), }, + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), Rules: []armnetwork.FirewallPolicyRuleClassification{ &armnetwork.Rule{ - Name: to.Ptr("network-1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + Name: to.Ptr("network-1"), DestinationIPGroups: []*string{ - to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"), + }, DestinationPorts: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, + to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), SourceIPGroups: []*string{ - to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - }}, - }}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"), + }, + }, + }, + }, + }, }, }, nil) if err != nil { @@ -463,51 +369,59 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-1"), + // DestinationIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"), + // }, // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"), + // }, + // }, // }, - // } + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithWebCategories() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -516,28 +430,33 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF Priority: to.Ptr[int32](110), RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + Name: to.Ptr("Example-Filter-Rule-Collection"), Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), }, + RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), Rules: []armnetwork.FirewallPolicyRuleClassification{ &armnetwork.ApplicationRule{ Name: to.Ptr("rule1"), Description: to.Ptr("Deny inbound rule"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ { Port: to.Ptr[int32](443), ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - }}, + }, + }, + RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), SourceAddresses: []*string{ to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, WebCategories: []*string{ - to.Ptr("Hacking")}, - }}, - }}, + to.Ptr("Hacking"), + }, + }, + }, + }, + }, }, }, nil) if err != nil { @@ -545,149 +464,331 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createF } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.ApplicationRule{ + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), + // }, + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, + // to.Ptr("Hacking"), + // }, + // }, + // }, + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupDelete.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](110), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.ApplicationRule{ - Name: to.Ptr("rule1"), - Description: to.Ptr("Insert trusted tenants header"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - FqdnTags: []*string{ - to.Ptr("WindowsVirtualDesktop")}, - HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{ - { - HeaderName: to.Ptr("Restrict-Access-To-Tenants"), - HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"), - }}, - Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - { - Port: to.Ptr[int32](80), - ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - }}, - }}, - }, - }, nil) + poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginDelete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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) + log.Fatalf("failed to poll 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 = armnetwork.FirewallPolicyRuleCollectionGroupsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyNatRuleCollectionGroupGet.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyNatRuleCollectionGroup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow), + // res = armnetwork.FirewallPolicyRuleCollectionGroupsClientGetResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](100), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyNatRuleCollection{ + // Name: to.Ptr("NatRC"), + // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), + // }, + // Priority: to.Ptr[int32](100), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.NatRule{ + // Name: to.Ptr("NatRule1"), + // DestinationAddresses: []*string{ + // to.Ptr("152.23.32.23"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("8080"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), + // SourceAddresses: []*string{ + // to.Ptr("2.2.2.2"), + // }, + // SourceIPGroups: []*string{ + // }, + // TranslatedFqdn: to.Ptr("internalhttpserver"), + // TranslatedPort: to.Ptr("8080"), + // }, + // }, // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Insert trusted tenants header"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // FqdnTags: []*string{ - // to.Ptr("WindowsVirtualDesktop")}, - // HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{ - // { - // HeaderName: to.Ptr("Restrict-Access-To-Tenants"), - // HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"), - // }}, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupGet.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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 = armnetwork.FirewallPolicyRuleCollectionGroupsClientGetResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](200), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule1"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceAddresses: []*string{ + // to.Ptr("10.1.25.0/24"), + // }, + // }, + // }, + // }, + // }, + // Size: to.Ptr("1.2MB"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithIPGroups() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleGroup1", 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 = armnetwork.FirewallPolicyRuleCollectionGroupsClientGetResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleGroups/ruleGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](200), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule1"), + // DestinationIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithWebCategories() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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 = armnetwork.FirewallPolicyRuleCollectionGroupsClientGetResponse{ + // FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{ + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](200), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.ApplicationRule{ + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ // { - // Port: to.Ptr[int32](80), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP), - // }}, + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), + // }, + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), // SourceAddresses: []*string{ // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // }}, - // }}, + // to.Ptr("10.0.0.0/24"), + // }, + // WebCategories: []*string{ + // to.Ptr("Hacking"), + // }, + // }, + // }, + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupWithWebCategories() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupList.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -702,54 +803,61 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewal _ = 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.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // page = armnetwork.FirewallPolicyRuleCollectionGroupsClientListResponse{ + // FirewallPolicyRuleCollectionGroupListResult: armnetwork.FirewallPolicyRuleCollectionGroupListResult{ + // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ + // { + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](120), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule-1"), + // Description: to.Ptr("Network rule"), + // DestinationAddresses: []*string{ + // to.Ptr("*"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceAddresses: []*string{ + // to.Ptr("10.1.25.0/24"), + // }, + // }, + // }, // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithIpGroupsList.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsWithIPGroupsForAGivenFirewallPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -764,52 +872,61 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewal _ = 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.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule-1"), - // Description: to.Ptr("Network rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, + // page = armnetwork.FirewallPolicyRuleCollectionGroupsClientListResponse{ + // FirewallPolicyRuleCollectionGroupListResult: armnetwork.FirewallPolicyRuleCollectionGroupListResult{ + // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ + // { + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](120), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.Rule{ + // Name: to.Ptr("network-rule-1"), + // Description: to.Ptr("Network rule"), + // DestinationIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"), + // }, // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, + // to.Ptr("*"), + // }, + // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ + // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), + // SourceIPGroups: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"), + // }, + // }, // }, - // }}, - // } + // }, + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy() { +// Generated from example definition: 2025-07-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json +func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupWithWebCategories() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -824,40 +941,50 @@ func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewal _ = 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.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule-1"), - // Description: to.Ptr("Network rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, + // page = armnetwork.FirewallPolicyRuleCollectionGroupsClientListResponse{ + // FirewallPolicyRuleCollectionGroupListResult: armnetwork.FirewallPolicyRuleCollectionGroupListResult{ + // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ + // { + // Name: to.Ptr("ruleCollectionGroup1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), + // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ + // Priority: to.Ptr[int32](110), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ + // &armnetwork.FirewallPolicyFilterRuleCollection{ + // Name: to.Ptr("Example-Filter-Rule-Collection"), + // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ + // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), + // }, + // Priority: to.Ptr[int32](120), + // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), + // Rules: []armnetwork.FirewallPolicyRuleClassification{ + // &armnetwork.ApplicationRule{ + // Name: to.Ptr("rule1"), + // Description: to.Ptr("Deny inbound rule"), + // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ + // { + // Port: to.Ptr[int32](443), + // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), + // }, + // }, + // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), + // SourceAddresses: []*string{ + // to.Ptr("216.58.216.164"), + // to.Ptr("10.0.0.0/24"), + // }, + // WebCategories: []*string{ + // to.Ptr("Hacking"), + // }, + // }, // }, - // }}, - // } + // }, + // }, + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go index 202ed60406dc..6180950ee474 100644 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go +++ b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // FlowLogsClient contains the methods for the FlowLogs group. // Don't use this type directly, use NewFlowLogsClient() instead. +// +// Generated from API version 2025-07-01 type FlowLogsClient struct { internal *arm.Client subscriptionID string } // NewFlowLogsClient creates a new instance of FlowLogsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewFlowLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlowLogsClient, error) { @@ -43,11 +43,9 @@ func NewFlowLogsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a flow log for the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. -// - flowLogName - The name of the flow log. +// - flowLogName - The name of the flow log resource. // - parameters - Parameters that define the create or update flow log resource. // - options - FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *FlowLogsClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlowLogsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *FlowLogsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a flow log for the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FlowLogsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FlowLogsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *FlowLogsClient) createOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, _ *FlowLogsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter flowLogName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified flow log resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. // - options - FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. @@ -142,8 +136,7 @@ func (client *FlowLogsClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlowLogsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,8 +148,6 @@ func (client *FlowLogsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified flow log resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *FlowLogsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FlowLogsClient.BeginDelete" @@ -181,6 +172,10 @@ func (client *FlowLogsClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, _ *FlowLogsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -193,26 +188,19 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter flowLogName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a flow log resource by name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. // - options - FlowLogsClientGetOptions contains the optional parameters for the FlowLogsClient.Get method. @@ -241,6 +229,10 @@ func (client *FlowLogsClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, _ *FlowLogsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -253,17 +245,13 @@ func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter flowLogName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -278,10 +266,8 @@ func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsCl } // NewListPager - Lists all flow log resources for the specified Network Watcher. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - options - FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.NewListPager method. func (client *FlowLogsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) *runtime.Pager[FlowLogsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[FlowLogsClientListResponse]{ @@ -309,6 +295,10 @@ func (client *FlowLogsClient) NewListPager(resourceGroupName string, networkWatc // listCreateRequest creates the List request. func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, _ *FlowLogsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -317,17 +307,13 @@ func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -343,11 +329,9 @@ func (client *FlowLogsClient) listHandleResponse(resp *http.Response) (FlowLogsC // UpdateTags - Update tags of the specified flow log. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. -// - flowLogName - The name of the flow log. +// - flowLogName - The name of the flow log resource. // - parameters - Parameters supplied to update flow log tags. // - options - FlowLogsClientUpdateTagsOptions contains the optional parameters for the FlowLogsClient.UpdateTags method. func (client *FlowLogsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, options *FlowLogsClientUpdateTagsOptions) (FlowLogsClientUpdateTagsResponse, error) { @@ -375,6 +359,10 @@ func (client *FlowLogsClient) UpdateTags(ctx context.Context, resourceGroupName // updateTagsCreateRequest creates the UpdateTags request. func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, _ *FlowLogsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -387,18 +375,15 @@ func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resou return nil, errors.New("parameter flowLogName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go index 8a91f9b6c5a1..d1f1cbbd0846 100644 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go @@ -1,39 +1,36 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogCreate.json +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogCreate.json func ExampleFlowLogsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewFlowLogsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "fl", armnetwork.FlowLog{ - Location: to.Ptr("centraluseuap"), Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, }, }, + Location: to.Ptr("centraluseuap"), Properties: &armnetwork.FlowLogPropertiesFormat{ Format: &armnetwork.FlowLogFormatParameters{ Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), @@ -42,8 +39,8 @@ func ExampleFlowLogsClient_BeginCreateOrUpdate() { Enabled: to.Ptr(true), EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), RecordTypes: to.Ptr("B,E"), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), + StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), }, }, nil) if err != nil { @@ -51,120 +48,79 @@ func ExampleFlowLogsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // res = armnetwork.FlowLogsClientCreateOrUpdateResponse{ + // FlowLog: armnetwork.FlowLog{ + // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // }, // }, // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RecordTypes: to.Ptr("B,E"), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.FlowLogPropertiesFormat{ + // Format: &armnetwork.FlowLogFormatParameters{ + // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), + // Version: to.Ptr[int32](1), + // }, + // Enabled: to.Ptr(true), + // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), + // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // RecordTypes: to.Ptr("B,E"), + // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ + // Days: to.Ptr[int32](0), + // Enabled: to.Ptr(false), + // }, + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), + // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogUpdateTags.json -func ExampleFlowLogsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogDelete.json +func ExampleFlowLogsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewFlowLogsClient().UpdateTags(ctx, "rg1", "nw", "fl", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewFlowLogsClient().BeginDelete(ctx, "rg1", "nw1", "fl", 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.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RecordTypes: to.Ptr("B,E"), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogGet.json +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogGet.json func ExampleFlowLogsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -175,78 +131,59 @@ func ExampleFlowLogsClient_Get() { // 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.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("flowLog1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // res = armnetwork.FlowLogsClientGetResponse{ + // FlowLog: armnetwork.FlowLog{ + // Name: to.Ptr("flowLog1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // }, // }, // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.FlowLogPropertiesFormat{ + // Format: &armnetwork.FlowLogFormatParameters{ + // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), + // Version: to.Ptr[int32](2), + // }, + // Enabled: to.Ptr(true), + // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), + // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ + // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ + // Enabled: to.Ptr(false), + // TrafficAnalyticsInterval: to.Ptr[int32](60), + // WorkspaceID: to.Ptr("-"), + // WorkspaceRegion: to.Ptr("-"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RecordTypes: to.Ptr("B,E"), + // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ + // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), - // TrafficAnalyticsInterval: to.Ptr[int32](60), - // WorkspaceID: to.Ptr("-"), - // WorkspaceRegion: to.Ptr("-"), // }, + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), + // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RecordTypes: to.Ptr("B,E"), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogDelete.json -func ExampleFlowLogsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFlowLogsClient().BeginDelete(ctx, "rg1", "nw1", "fl", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogList.json +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogList.json func ExampleFlowLogsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -261,84 +198,153 @@ func ExampleFlowLogsClient_NewListPager() { _ = 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.FlowLogListResult = armnetwork.FlowLogListResult{ - // Value: []*armnetwork.FlowLog{ - // { - // Name: to.Ptr("flowLog1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // page = armnetwork.FlowLogsClientListResponse{ + // FlowLogListResult: armnetwork.FlowLogListResult{ + // Value: []*armnetwork.FlowLog{ + // { + // Name: to.Ptr("flowLog1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // }, // }, // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.FlowLogPropertiesFormat{ + // Format: &armnetwork.FlowLogFormatParameters{ + // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), + // Version: to.Ptr[int32](2), + // }, + // Enabled: to.Ptr(true), + // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), + // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ + // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ + // Enabled: to.Ptr(false), + // TrafficAnalyticsInterval: to.Ptr[int32](60), + // WorkspaceID: to.Ptr("-"), + // WorkspaceRegion: to.Ptr("-"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RecordTypes: to.Ptr("B,E"), + // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ + // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), - // TrafficAnalyticsInterval: to.Ptr[int32](60), - // WorkspaceID: to.Ptr("-"), - // WorkspaceRegion: to.Ptr("-"), // }, + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), + // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RecordTypes: to.Ptr("B,E"), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), // }, - // }, - // { - // Name: to.Ptr("flowLog2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_centraluseuap/FlowLogs/flowLog2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // { + // Name: to.Ptr("flowLog2"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_centraluseuap/FlowLogs/flowLog2"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // }, // }, // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RecordTypes: to.Ptr("B,E"), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.FlowLogPropertiesFormat{ + // Format: &armnetwork.FlowLogFormatParameters{ + // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), + // Version: to.Ptr[int32](2), + // }, + // Enabled: to.Ptr(true), + // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), + // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RecordTypes: to.Ptr("B,E"), + // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ + // Days: to.Ptr[int32](0), + // Enabled: to.Ptr(false), + // }, + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/iraflowlogtest2diag"), + // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/DSCP-test-vm1-nsg"), // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/iraflowlogtest2diag"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/DSCP-test-vm1-nsg"), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogUpdateTags.json +func ExampleFlowLogsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFlowLogsClient().UpdateTags(ctx, "rg1", "nw", "fl", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.FlowLogsClientUpdateTagsResponse{ + // FlowLog: armnetwork.FlowLog{ + // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), + // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // }, + // }, + // }, + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.FlowLogPropertiesFormat{ + // Format: &armnetwork.FlowLogFormatParameters{ + // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), + // Version: to.Ptr[int32](1), + // }, + // Enabled: to.Ptr(true), + // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), + // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RecordTypes: to.Ptr("B,E"), + // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ + // Days: to.Ptr[int32](0), + // Enabled: to.Ptr(false), + // }, + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), + // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/go.mod b/sdk/resourcemanager/network/armnetwork/go.mod index 6ed32e923470..e0f0b08211b2 100644 --- a/sdk/resourcemanager/network/armnetwork/go.mod +++ b/sdk/resourcemanager/network/armnetwork/go.mod @@ -1,9 +1,9 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10 go 1.25.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.2.0 @@ -20,9 +20,9 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.49.0 // indirect - golang.org/x/net v0.52.0 // indirect - golang.org/x/sys v0.42.0 // indirect - golang.org/x/text v0.35.0 // indirect + golang.org/x/crypto v0.50.0 // indirect + golang.org/x/net v0.53.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/text v0.36.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/network/armnetwork/go.sum b/sdk/resourcemanager/network/armnetwork/go.sum index 441132f4be57..5bc0609e8582 100644 --- a/sdk/resourcemanager/network/armnetwork/go.sum +++ b/sdk/resourcemanager/network/armnetwork/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 h1:jHb/wfvRikGdxMXYV3QG/SzUOPYN9KEUUuC0Yd0/vC0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1/go.mod h1:pzBXCYn05zvYIrwLgtK8Ap8QcjRg+0i76tMQdWN6wOk= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= @@ -38,15 +38,15 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/network/armnetwork/groups_client.go b/sdk/resourcemanager/network/armnetwork/groups_client.go index 61a57783ba68..8d51201f45d8 100644 --- a/sdk/resourcemanager/network/armnetwork/groups_client.go +++ b/sdk/resourcemanager/network/armnetwork/groups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// GroupsClient contains the methods for the NetworkGroups group. +// GroupsClient contains the methods for the Groups group. // Don't use this type directly, use NewGroupsClient() instead. +// +// Generated from API version 2025-07-01 type GroupsClient struct { internal *arm.Client subscriptionID string } // NewGroupsClient creates a new instance of GroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupsClient, error) { @@ -44,9 +44,7 @@ func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates a network group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - parameters - Parameters supplied to the specify which network group need to create @@ -97,12 +95,13 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -123,9 +122,7 @@ func (client *GroupsClient) createOrUpdateHandleResponse(resp *http.Response) (G // BeginDelete - Deletes a network group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - options - GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method. @@ -136,8 +133,7 @@ func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +145,6 @@ func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a network group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GroupsClient.BeginDelete" @@ -196,20 +190,17 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified network group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - options - GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method. @@ -259,8 +250,8 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -275,9 +266,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient } // NewListPager - Lists the specified network group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. func (client *GroupsClient) NewListPager(resourceGroupName string, networkManagerName string, options *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse] { @@ -329,8 +318,8 @@ func (client *GroupsClient) listCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go index 73a0f95b9239..b7dd331ad5ae 100644 --- a/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go @@ -1,138 +1,144 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerGroupGet.json -func ExampleGroupsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerGroupPut.json +func ExampleGroupsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewGroupsClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", nil) + res, err := clientFactory.NewGroupsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", armnetwork.Group{ + Properties: &armnetwork.GroupProperties{ + Description: to.Ptr("A sample group"), + MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), + }, + }, 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.Group = armnetwork.Group{ - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.GroupsClientCreateOrUpdateResponse{ + // ETag: to.Ptr("be3cfaa2-3d02-4624-92d7-a26766306c8b"), + // Group: armnetwork.Group{ + // Name: to.Ptr("testNetworkGroup"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A sample group"), + // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerGroupPut.json -func ExampleGroupsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerGroupDelete.json +func ExampleGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewGroupsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", armnetwork.Group{ - Properties: &armnetwork.GroupProperties{ - Description: to.Ptr("A sample group"), - MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - }, - }, &armnetwork.GroupsClientCreateOrUpdateOptions{IfMatch: nil}) + poller, err := clientFactory.NewGroupsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.GroupsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.Group = armnetwork.Group{ - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.GroupsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerGroupDelete.json -func ExampleGroupsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerGroupGet.json +func ExampleGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewGroupsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.GroupsClientBeginDeleteOptions{Force: to.Ptr(false)}) + res, err := clientFactory.NewGroupsClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", 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) - } + // 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 = armnetwork.GroupsClientGetResponse{ + // Group: armnetwork.Group{ + // Name: to.Ptr("testNetworkGroup"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A sample group"), + // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerGroupList.json +// Generated from example definition: 2025-07-01/NetworkManagerGroupList.json func ExampleGroupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewGroupsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.GroupsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewGroupsClient().NewListPager("rg1", "testNetworkManager", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -143,27 +149,31 @@ func ExampleGroupsClient_NewListPager() { _ = 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.GroupListResult = armnetwork.GroupListResult{ - // Value: []*armnetwork.Group{ - // { - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.GroupsClientListResponse{ + // GroupListResult: armnetwork.GroupListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.Group{ + // { + // Name: to.Ptr("testNetworkGroup"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A sample group"), + // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go index a85a5e9d8a7b..9707fcce6d10 100644 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // HubRouteTablesClient contains the methods for the HubRouteTables group. // Don't use this type directly, use NewHubRouteTablesClient() instead. +// +// Generated from API version 2025-07-01 type HubRouteTablesClient struct { internal *arm.Client subscriptionID string } // NewHubRouteTablesClient creates a new instance of HubRouteTablesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewHubRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubRouteTablesClient, error) { @@ -43,11 +43,9 @@ func NewHubRouteTablesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routeTableName - The name of the RouteTable. +// - routeTableName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - routeTableParameters - Parameters supplied to create or update RouteTable. // - options - HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *HubRouteTablesClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubRouteTablesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *HubRouteTablesClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *HubRouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "HubRouteTablesClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeTableParameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RouteTable. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routeTableName - The name of the RouteTable. +// - routeTableName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete // method. func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*runtime.Poller[HubRouteTablesClientDeleteResponse], error) { @@ -143,8 +137,7 @@ func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubRouteTablesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *HubRouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "HubRouteTablesClient.BeginDelete" @@ -203,19 +194,16 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routeTableName - The name of the RouteTable. +// - routeTableName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - HubRouteTablesClientGetOptions contains the optional parameters for the HubRouteTablesClient.Get method. func (client *HubRouteTablesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (HubRouteTablesClientGetResponse, error) { var err error @@ -263,8 +251,8 @@ func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -279,9 +267,7 @@ func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubR } // NewListPager - Retrieves the details of all RouteTables. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.NewListPager method. func (client *HubRouteTablesClient) NewListPager(resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) *runtime.Pager[HubRouteTablesClientListResponse] { @@ -327,8 +313,8 @@ func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go b/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go index fae37f32ef4c..3727b621c3ac 100644 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubRouteTablePut.json +// Generated from example definition: 2025-07-01/HubRouteTablePut.json func ExampleHubRouteTablesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,7 +27,8 @@ func ExampleHubRouteTablesClient_BeginCreateOrUpdate() { Properties: &armnetwork.HubRouteTableProperties{ Labels: []*string{ to.Ptr("label1"), - to.Ptr("label2")}, + to.Ptr("label2"), + }, Routes: []*armnetwork.HubRoute{ { Name: to.Ptr("route1"), @@ -38,10 +36,12 @@ func ExampleHubRouteTablesClient_BeginCreateOrUpdate() { Destinations: []*string{ to.Ptr("10.0.0.0/8"), to.Ptr("20.0.0.0/8"), - to.Ptr("30.0.0.0/8")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), + to.Ptr("30.0.0.0/8"), + }, + NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), NextHopType: to.Ptr("ResourceId"), - }}, + }, + }, }, }, nil) if err != nil { @@ -49,120 +49,139 @@ func ExampleHubRouteTablesClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.HubRouteTable = armnetwork.HubRouteTable{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // Name: to.Ptr("hubRouteTable1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubRouteTableProperties{ - // AssociatedConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2")}, + // res = armnetwork.HubRouteTablesClientCreateOrUpdateResponse{ + // HubRouteTable: armnetwork.HubRouteTable{ + // Name: to.Ptr("hubRouteTable1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // Properties: &armnetwork.HubRouteTableProperties{ + // AssociatedConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2"), + // }, // Labels: []*string{ // to.Ptr("label1"), - // to.Ptr("label2")}, - // PropagatingConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.HubRoute{ - // { - // Name: to.Ptr("route1"), - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("20.0.0.0/8"), - // to.Ptr("30.0.0.0/8")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), - // NextHopType: to.Ptr("ResourceId"), - // }}, + // to.Ptr("label2"), + // }, + // PropagatingConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.HubRoute{ + // { + // Name: to.Ptr("route1"), + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("10.0.0.0/8"), + // to.Ptr("20.0.0.0/8"), + // to.Ptr("30.0.0.0/8"), // }, - // } + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), + // NextHopType: to.Ptr("ResourceId"), + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubRouteTableGet.json -func ExampleHubRouteTablesClient_Get() { +// Generated from example definition: 2025-07-01/HubRouteTableDelete.json +func ExampleHubRouteTablesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewHubRouteTablesClient().Get(ctx, "rg1", "virtualHub1", "hubRouteTable1", nil) + poller, err := clientFactory.NewHubRouteTablesClient().BeginDelete(ctx, "rg1", "virtualHub1", "hubRouteTable1", 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 poll 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.HubRouteTable = armnetwork.HubRouteTable{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // Name: to.Ptr("hubRouteTable1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubRouteTableProperties{ - // AssociatedConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2")}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // PropagatingConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.HubRoute{ - // { - // Name: to.Ptr("route1"), - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("20.0.0.0/8"), - // to.Ptr("30.0.0.0/8")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), - // NextHopType: to.Ptr("ResourceId"), - // }}, - // }, - // } + // res = armnetwork.HubRouteTablesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubRouteTableDelete.json -func ExampleHubRouteTablesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/HubRouteTableGet.json +func ExampleHubRouteTablesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewHubRouteTablesClient().BeginDelete(ctx, "rg1", "virtualHub1", "hubRouteTable1", nil) + res, err := clientFactory.NewHubRouteTablesClient().Get(ctx, "rg1", "virtualHub1", "hubRouteTable1", 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) - } + // 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 = armnetwork.HubRouteTablesClientGetResponse{ + // HubRouteTable: armnetwork.HubRouteTable{ + // Name: to.Ptr("hubRouteTable1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // Properties: &armnetwork.HubRouteTableProperties{ + // AssociatedConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2"), + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // PropagatingConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.HubRoute{ + // { + // Name: to.Ptr("route1"), + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("10.0.0.0/8"), + // to.Ptr("20.0.0.0/8"), + // to.Ptr("30.0.0.0/8"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), + // NextHopType: to.Ptr("ResourceId"), + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubRouteTableList.json +// Generated from example definition: 2025-07-01/HubRouteTableList.json func ExampleHubRouteTablesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -177,7 +196,78 @@ func ExampleHubRouteTablesClient_NewListPager() { _ = 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.ListHubRouteTablesResult = armnetwork.ListHubRouteTablesResult{ + // page = armnetwork.HubRouteTablesClientListResponse{ + // ListHubRouteTablesResult: armnetwork.ListHubRouteTablesResult{ + // Value: []*armnetwork.HubRouteTable{ + // { + // Name: to.Ptr("hubRouteTable1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // Properties: &armnetwork.HubRouteTableProperties{ + // AssociatedConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2"), + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // PropagatingConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.HubRoute{ + // { + // Name: to.Ptr("route1a"), + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("10.0.0.0/8"), + // to.Ptr("20.0.0.0/8"), + // to.Ptr("30.0.0.0/8"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), + // NextHopType: to.Ptr("ResourceId"), + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("hubRouteTable2"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // Properties: &armnetwork.HubRouteTableProperties{ + // AssociatedConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn3"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn4"), + // }, + // Labels: []*string{ + // to.Ptr("label3"), + // }, + // PropagatingConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn2"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.HubRoute{ + // { + // Name: to.Ptr("route2a"), + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("40.0.0.0/8"), + // to.Ptr("50.0.0.0/8"), + // to.Ptr("60.0.0.0/8"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/vn1"), + // NextHopType: to.Ptr("ResourceId"), + // }, + // }, + // }, + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go index c649fcb1f11a..94bf6d8b7dab 100644 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // HubVirtualNetworkConnectionsClient contains the methods for the HubVirtualNetworkConnections group. // Don't use this type directly, use NewHubVirtualNetworkConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type HubVirtualNetworkConnectionsClient struct { internal *arm.Client subscriptionID string } // NewHubVirtualNetworkConnectionsClient creates a new instance of HubVirtualNetworkConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewHubVirtualNetworkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubVirtualNetworkConnectionsClient, error) { @@ -43,11 +43,8 @@ func NewHubVirtualNetworkConnectionsClient(subscriptionID string, credential azc // BeginCreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the HubVirtualNetworkConnection. -// - virtualHubName - The name of the VirtualHub. -// - connectionName - The name of the HubVirtualNetworkConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - hubVirtualNetworkConnectionParameters - Parameters supplied to create or update a hub virtual network connection. // - options - HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate // method. @@ -71,8 +68,6 @@ func (client *HubVirtualNetworkConnectionsClient) BeginCreateOrUpdate(ctx contex // CreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *HubVirtualNetworkConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters); err != nil { return nil, err } @@ -129,11 +125,8 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct // BeginDelete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. -// - virtualHubName - The name of the VirtualHub. -// - connectionName - The name of the HubVirtualNetworkConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - options - HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete // method. func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*runtime.Poller[HubVirtualNetworkConnectionsClientDeleteResponse], error) { @@ -143,8 +136,7 @@ func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubVirtualNetworkConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +148,6 @@ func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Contex // Delete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *HubVirtualNetworkConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "HubVirtualNetworkConnectionsClient.BeginDelete" @@ -203,19 +193,15 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. -// - virtualHubName - The name of the VirtualHub. -// - connectionName - The name of the vpn connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - options - HubVirtualNetworkConnectionsClientGetOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.Get // method. func (client *HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (HubVirtualNetworkConnectionsClientGetResponse, error) { @@ -264,8 +250,8 @@ func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +266,7 @@ func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.R } // NewListPager - Retrieves the details of all HubVirtualNetworkConnections. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.NewListPager // method. @@ -329,8 +313,8 @@ func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go index 918980d2dc52..d132a0432eb4 100644 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubVirtualNetworkConnectionPut.json +// Generated from example definition: 2025-07-01/HubVirtualNetworkConnectionPut.json func ExampleHubVirtualNetworkConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,26 +27,28 @@ func ExampleHubVirtualNetworkConnectionsClient_BeginCreateOrUpdate() { Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ EnableInternetSecurity: to.Ptr(false), RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), }, RoutingConfiguration: &armnetwork.RoutingConfiguration{ AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), }, InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), }, OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), }, PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ IDs: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + }, + }, Labels: []*string{ to.Ptr("label1"), - to.Ptr("label2")}, + to.Ptr("label2"), + }, }, VnetRoutes: &armnetwork.VnetRoute{ StaticRoutes: []*armnetwork.StaticRoute{ @@ -57,16 +56,19 @@ func ExampleHubVirtualNetworkConnectionsClient_BeginCreateOrUpdate() { Name: to.Ptr("route1"), AddressPrefixes: []*string{ to.Ptr("10.1.0.0/16"), - to.Ptr("10.2.0.0/16")}, + to.Ptr("10.2.0.0/16"), + }, NextHopIPAddress: to.Ptr("10.0.0.68"), }, { Name: to.Ptr("route2"), AddressPrefixes: []*string{ to.Ptr("10.3.0.0/16"), - to.Ptr("10.4.0.0/16")}, + to.Ptr("10.4.0.0/16"), + }, NextHopIPAddress: to.Ptr("10.0.0.65"), - }}, + }, + }, StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), }, @@ -79,78 +81,86 @@ func ExampleHubVirtualNetworkConnectionsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.HubVirtualNetworkConnection = armnetwork.HubVirtualNetworkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/connection1"), - // Name: to.Ptr("connection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - // EnableInternetSecurity: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // res = armnetwork.HubVirtualNetworkConnectionsClientCreateOrUpdateResponse{ + // HubVirtualNetworkConnection: armnetwork.HubVirtualNetworkConnection{ + // Name: to.Ptr("connection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/connection1"), + // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ + // EnableInternetSecurity: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, // }, // VnetRoutes: &armnetwork.VnetRoute{ // BgpConnections: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), + // }, + // }, // StaticRoutes: []*armnetwork.StaticRoute{ // { // Name: to.Ptr("route1"), // AddressPrefixes: []*string{ // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.68"), + // to.Ptr("10.2.0.0/16"), // }, - // { - // Name: to.Ptr("route2"), - // AddressPrefixes: []*string{ - // to.Ptr("10.3.0.0/16"), - // to.Ptr("10.4.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.65"), - // }}, - // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ - // PropagateStaticRoutes: to.Ptr(true), - // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), + // NextHopIPAddress: to.Ptr("10.0.0.68"), + // }, + // { + // Name: to.Ptr("route2"), + // AddressPrefixes: []*string{ + // to.Ptr("10.3.0.0/16"), + // to.Ptr("10.4.0.0/16"), // }, + // NextHopIPAddress: to.Ptr("10.0.0.65"), // }, // }, + // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ + // PropagateStaticRoutes: to.Ptr(true), + // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), + // }, // }, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubVirtualNetworkConnectionDelete.json +// Generated from example definition: 2025-07-01/HubVirtualNetworkConnectionDelete.json func ExampleHubVirtualNetworkConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -158,20 +168,25 @@ func ExampleHubVirtualNetworkConnectionsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.HubVirtualNetworkConnectionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubVirtualNetworkConnectionGet.json +// Generated from example definition: 2025-07-01/HubVirtualNetworkConnectionGet.json func ExampleHubVirtualNetworkConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -182,79 +197,87 @@ func ExampleHubVirtualNetworkConnectionsClient_Get() { // 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.HubVirtualNetworkConnection = armnetwork.HubVirtualNetworkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/virtualHubVnetConnections/connection1"), - // Name: to.Ptr("connection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - // EnableInternetSecurity: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // res = armnetwork.HubVirtualNetworkConnectionsClientGetResponse{ + // HubVirtualNetworkConnection: armnetwork.HubVirtualNetworkConnection{ + // Name: to.Ptr("connection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/virtualHubVnetConnections/connection1"), + // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ + // EnableInternetSecurity: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, // }, // VnetRoutes: &armnetwork.VnetRoute{ // BgpConnections: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), + // }, + // }, // StaticRoutes: []*armnetwork.StaticRoute{ // { // Name: to.Ptr("route1"), // AddressPrefixes: []*string{ // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.68"), + // to.Ptr("10.2.0.0/16"), // }, - // { - // Name: to.Ptr("route2"), - // AddressPrefixes: []*string{ - // to.Ptr("10.3.0.0/16"), - // to.Ptr("10.4.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.65"), - // }}, - // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ - // PropagateStaticRoutes: to.Ptr(true), - // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), + // NextHopIPAddress: to.Ptr("10.0.0.68"), + // }, + // { + // Name: to.Ptr("route2"), + // AddressPrefixes: []*string{ + // to.Ptr("10.3.0.0/16"), + // to.Ptr("10.4.0.0/16"), // }, + // NextHopIPAddress: to.Ptr("10.0.0.65"), // }, // }, + // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ + // PropagateStaticRoutes: to.Ptr(true), + // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), + // }, // }, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/HubVirtualNetworkConnectionList.json +// Generated from example definition: 2025-07-01/HubVirtualNetworkConnectionList.json func ExampleHubVirtualNetworkConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -269,7 +292,133 @@ func ExampleHubVirtualNetworkConnectionsClient_NewListPager() { _ = 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.ListHubVirtualNetworkConnectionsResult = armnetwork.ListHubVirtualNetworkConnectionsResult{ + // page = armnetwork.HubVirtualNetworkConnectionsClientListResponse{ + // ListHubVirtualNetworkConnectionsResult: armnetwork.ListHubVirtualNetworkConnectionsResult{ + // Value: []*armnetwork.HubVirtualNetworkConnection{ + // { + // Name: to.Ptr("connection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/virtualHubVnetConnections/connection1"), + // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ + // EnableInternetSecurity: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // BgpConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), + // }, + // }, + // StaticRoutes: []*armnetwork.StaticRoute{ + // { + // Name: to.Ptr("route1"), + // AddressPrefixes: []*string{ + // to.Ptr("10.1.0.0/16"), + // to.Ptr("10.2.0.0/16"), + // }, + // NextHopIPAddress: to.Ptr("10.0.0.68"), + // }, + // { + // Name: to.Ptr("route2"), + // AddressPrefixes: []*string{ + // to.Ptr("10.3.0.0/16"), + // to.Ptr("10.4.0.0/16"), + // }, + // NextHopIPAddress: to.Ptr("10.0.0.65"), + // }, + // }, + // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ + // PropagateStaticRoutes: to.Ptr(true), + // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("connection2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/virtualHubVnetConnections/connection2"), + // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ + // EnableInternetSecurity: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // BgpConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn2"), + // }, + // }, + // StaticRoutes: []*armnetwork.StaticRoute{ + // { + // Name: to.Ptr("route1"), + // AddressPrefixes: []*string{ + // to.Ptr("10.1.0.0/16"), + // to.Ptr("10.2.0.0/16"), + // }, + // NextHopIPAddress: to.Ptr("10.0.0.68"), + // }, + // { + // Name: to.Ptr("route2"), + // AddressPrefixes: []*string{ + // to.Ptr("10.3.0.0/16"), + // to.Ptr("10.4.0.0/16"), + // }, + // NextHopIPAddress: to.Ptr("10.0.0.65"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go index dd810ea11916..84a35058d04f 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // InboundNatRulesClient contains the methods for the InboundNatRules group. // Don't use this type directly, use NewInboundNatRulesClient() instead. +// +// Generated from API version 2025-07-01 type InboundNatRulesClient struct { internal *arm.Client subscriptionID string } // NewInboundNatRulesClient creates a new instance of InboundNatRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInboundNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundNatRulesClient, error) { @@ -43,9 +43,7 @@ func NewInboundNatRulesClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates a load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. // - inboundNatRuleParameters - Parameters supplied to the create or update inbound NAT rule operation. @@ -58,8 +56,7 @@ func (client *InboundNatRulesClient) BeginCreateOrUpdate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundNatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *InboundNatRulesClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InboundNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InboundNatRulesClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *InboundNatRulesClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, _ *InboundNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter inboundNatRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, inboundNatRuleParameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. // - options - InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete @@ -143,8 +137,7 @@ func (client *InboundNatRulesClient) BeginDelete(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundNatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *InboundNatRulesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InboundNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InboundNatRulesClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *InboundNatRulesClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, _ *InboundNatRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,26 +189,19 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re return nil, errors.New("parameter inboundNatRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. // - options - InboundNatRulesClientGetOptions contains the optional parameters for the InboundNatRulesClient.Get method. @@ -242,6 +230,10 @@ func (client *InboundNatRulesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -254,10 +246,6 @@ func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resou return nil, errors.New("parameter inboundNatRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -266,8 +254,8 @@ func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -282,9 +270,7 @@ func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (Inb } // NewListPager - Gets all the inbound NAT rules in a load balancer. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.NewListPager // method. @@ -314,6 +300,10 @@ func (client *InboundNatRulesClient) NewListPager(resourceGroupName string, load // listCreateRequest creates the List request. func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *InboundNatRulesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -322,17 +312,13 @@ func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, reso return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go index c54b76e008e7..48ca122e5735 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go @@ -1,94 +1,82 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundNatRuleList.json -func ExampleInboundNatRulesClient_NewListPager() { +// Generated from example definition: 2025-07-01/InboundNatRuleCreate.json +func ExampleInboundNatRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInboundNatRulesClient().NewListPager("testrg", "lb1", 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.InboundNatRuleListResult = armnetwork.InboundNatRuleListResult{ - // Value: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.3"), - // Name: to.Ptr("natRule1.3"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3392), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // } + poller, err := clientFactory.NewInboundNatRulesClient().BeginCreateOrUpdate(ctx, "testrg", "lb1", "natRule1.1", armnetwork.InboundNatRule{ + Properties: &armnetwork.InboundNatRulePropertiesFormat{ + BackendPort: to.Ptr[int32](3389), + EnableFloatingIP: to.Ptr(false), + EnableTCPReset: to.Ptr(false), + FrontendIPConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + }, + FrontendPort: to.Ptr[int32](3390), + IdleTimeoutInMinutes: to.Ptr[int32](4), + Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + }, + }, 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 poll 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 = armnetwork.InboundNatRulesClientCreateOrUpdateResponse{ + // InboundNatRule: armnetwork.InboundNatRule{ + // Name: to.Ptr("natRule1.1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + // }, + // FrontendPort: to.Ptr[int32](3390), + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundNatRuleDelete.json +// Generated from example definition: 2025-07-01/InboundNatRuleDelete.json func ExampleInboundNatRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -96,102 +84,123 @@ func ExampleInboundNatRulesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.InboundNatRulesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundNatRuleGet.json +// Generated from example definition: 2025-07-01/InboundNatRuleGet.json func ExampleInboundNatRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInboundNatRulesClient().Get(ctx, "testrg", "lb1", "natRule1.1", &armnetwork.InboundNatRulesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewInboundNatRulesClient().Get(ctx, "testrg", "lb1", "natRule1.1", 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.InboundNatRule = armnetwork.InboundNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + // res = armnetwork.InboundNatRulesClientGetResponse{ + // InboundNatRule: armnetwork.InboundNatRule{ + // Name: to.Ptr("natRule1.1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + // }, + // FrontendPort: to.Ptr[int32](3390), + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundNatRuleCreate.json -func ExampleInboundNatRulesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/InboundNatRuleList.json +func ExampleInboundNatRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInboundNatRulesClient().BeginCreateOrUpdate(ctx, "testrg", "lb1", "natRule1.1", armnetwork.InboundNatRule{ - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(false), - EnableTCPReset: to.Ptr(false), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - }, - FrontendPort: to.Ptr[int32](3390), - IdleTimeoutInMinutes: to.Ptr[int32](4), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }, 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) + pager := clientFactory.NewInboundNatRulesClient().NewListPager("testrg", "lb1", 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 = armnetwork.InboundNatRulesClientListResponse{ + // InboundNatRuleListResult: armnetwork.InboundNatRuleListResult{ + // Value: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("natRule1.1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + // }, + // FrontendPort: to.Ptr[int32](3390), + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // { + // Name: to.Ptr("natRule1.3"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.3"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), + // }, + // FrontendPort: to.Ptr[int32](3392), + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // }, + // } } - // 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.InboundNatRule = armnetwork.InboundNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // } } diff --git a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go index eea8efc2e226..ddcad64fc6f1 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // InboundSecurityRuleClient contains the methods for the InboundSecurityRule group. // Don't use this type directly, use NewInboundSecurityRuleClient() instead. +// +// Generated from API version 2025-07-01 type InboundSecurityRuleClient struct { internal *arm.Client subscriptionID string } // NewInboundSecurityRuleClient creates a new instance of InboundSecurityRuleClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInboundSecurityRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundSecurityRuleClient, error) { @@ -43,11 +43,10 @@ func NewInboundSecurityRuleClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - ruleCollectionName - The name of security rule collection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - ruleCollectionName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - parameters - Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules operation. // - options - InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate // method. @@ -58,8 +57,7 @@ func (client *InboundSecurityRuleClient) BeginCreateOrUpdate(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundSecurityRuleClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +69,6 @@ func (client *InboundSecurityRuleClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InboundSecurityRuleClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InboundSecurityRuleClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *InboundSecurityRuleClient) createOrUpdate(ctx context.Context, res // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, _ *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter ruleCollectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +126,10 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context // Get - Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - ruleCollectionName - The name of security rule collection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - ruleCollectionName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - InboundSecurityRuleClientGetOptions contains the optional parameters for the InboundSecurityRuleClient.Get method. func (client *InboundSecurityRuleClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, options *InboundSecurityRuleClientGetOptions) (InboundSecurityRuleClientGetResponse, error) { var err error @@ -160,6 +156,10 @@ func (client *InboundSecurityRuleClient) Get(ctx context.Context, resourceGroupN // getCreateRequest creates the Get request. func (client *InboundSecurityRuleClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, _ *InboundSecurityRuleClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -172,17 +172,13 @@ func (client *InboundSecurityRuleClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter ruleCollectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go index 7391fd5788bd..b635e5a42466 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundSecurityRulePut.json +// Generated from example definition: 2025-07-01/InboundSecurityRulePut.json func ExampleInboundSecurityRuleClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -33,13 +30,16 @@ func ExampleInboundSecurityRuleClient_BeginCreateOrUpdate() { { Name: to.Ptr("inboundRule1"), AppliesOn: []*string{ - to.Ptr("slbip1")}, + to.Ptr("slbip1"), + }, DestinationPortRange: to.Ptr[int32](22), DestinationPortRanges: []*string{ - to.Ptr("80-100")}, + to.Ptr("80-100"), + }, SourceAddressPrefix: to.Ptr("50.20.121.5/32"), Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - }}, + }, + }, }, }, nil) if err != nil { @@ -47,41 +47,46 @@ func ExampleInboundSecurityRuleClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.InboundSecurityRule = armnetwork.InboundSecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // Name: to.Ptr("rule1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.InboundSecurityRuleProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), - // Rules: []*armnetwork.InboundSecurityRules{ - // { - // Name: to.Ptr("inboundRule1"), - // AppliesOn: []*string{ - // to.Ptr("slbip1")}, + // res = armnetwork.InboundSecurityRuleClientCreateOrUpdateResponse{ + // InboundSecurityRule: armnetwork.InboundSecurityRule{ + // Name: to.Ptr("rule1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // Properties: &armnetwork.InboundSecurityRuleProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), + // Rules: []*armnetwork.InboundSecurityRules{ + // { + // Name: to.Ptr("inboundRule1"), + // AppliesOn: []*string{ + // to.Ptr("slbip1"), + // }, // DestinationPortRange: to.Ptr[int32](22), // DestinationPortRanges: []*string{ - // to.Ptr("80-100")}, - // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - // }}, + // to.Ptr("80-100"), + // }, + // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), + // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/InboundSecurityRuleGet.json +// Generated from example definition: 2025-07-01/InboundSecurityRuleGet.json func ExampleInboundSecurityRuleClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -92,24 +97,29 @@ func ExampleInboundSecurityRuleClient_Get() { // 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.InboundSecurityRule = armnetwork.InboundSecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // Name: to.Ptr("rule1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.InboundSecurityRuleProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), - // Rules: []*armnetwork.InboundSecurityRules{ - // { - // Name: to.Ptr("inboundRule1"), - // AppliesOn: []*string{ - // to.Ptr("slbip1")}, + // res = armnetwork.InboundSecurityRuleClientGetResponse{ + // InboundSecurityRule: armnetwork.InboundSecurityRule{ + // Name: to.Ptr("rule1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // Properties: &armnetwork.InboundSecurityRuleProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), + // Rules: []*armnetwork.InboundSecurityRules{ + // { + // Name: to.Ptr("inboundRule1"), + // AppliesOn: []*string{ + // to.Ptr("slbip1"), + // }, // DestinationPortRange: to.Ptr[int32](22), // DestinationPortRanges: []*string{ - // to.Ptr("80-100")}, - // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - // }}, + // to.Ptr("80-100"), + // }, + // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), + // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), + // }, // }, - // } + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/interconnectgroups_client.go b/sdk/resourcemanager/network/armnetwork/interconnectgroups_client.go new file mode 100644 index 000000000000..0e87d91034c7 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/interconnectgroups_client.go @@ -0,0 +1,475 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// InterconnectGroupsClient contains the methods for the InterconnectGroups group. +// Don't use this type directly, use NewInterconnectGroupsClient() instead. +// +// Generated from API version 2025-07-01 +type InterconnectGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInterconnectGroupsClient creates a new instance of InterconnectGroupsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewInterconnectGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterconnectGroupsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InterconnectGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates an interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - parameters - Parameters supplied to the create or update interconnect group operation. +// - options - InterconnectGroupsClientCreateOrUpdateOptions contains the optional parameters for the InterconnectGroupsClient.CreateOrUpdate +// method. +func (client *InterconnectGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters InterconnectGroup, options *InterconnectGroupsClientCreateOrUpdateOptions) (InterconnectGroupsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "InterconnectGroupsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, interconnectGroupName, parameters, options) + if err != nil { + return InterconnectGroupsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterconnectGroupsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return InterconnectGroupsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InterconnectGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters InterconnectGroup, _ *InterconnectGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *InterconnectGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (InterconnectGroupsClientCreateOrUpdateResponse, error) { + result := InterconnectGroupsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterconnectGroup); err != nil { + return InterconnectGroupsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - options - InterconnectGroupsClientDeleteOptions contains the optional parameters for the InterconnectGroupsClient.Delete +// method. +func (client *InterconnectGroupsClient) Delete(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientDeleteOptions) (InterconnectGroupsClientDeleteResponse, error) { + var err error + const operationName = "InterconnectGroupsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, interconnectGroupName, options) + if err != nil { + return InterconnectGroupsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterconnectGroupsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return InterconnectGroupsClientDeleteResponse{}, err + } + return InterconnectGroupsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InterconnectGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, _ *InterconnectGroupsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + return req, nil +} + +// Get - Gets information about the specified interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - options - InterconnectGroupsClientGetOptions contains the optional parameters for the InterconnectGroupsClient.Get method. +func (client *InterconnectGroupsClient) Get(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientGetOptions) (InterconnectGroupsClientGetResponse, error) { + var err error + const operationName = "InterconnectGroupsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, interconnectGroupName, options) + if err != nil { + return InterconnectGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterconnectGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InterconnectGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *InterconnectGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, _ *InterconnectGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InterconnectGroupsClient) getHandleResponse(resp *http.Response) (InterconnectGroupsClientGetResponse, error) { + result := InterconnectGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterconnectGroup); err != nil { + return InterconnectGroupsClientGetResponse{}, err + } + return result, nil +} + +// BeginGetNodeAvailability - Gets node availability for all subgroups in the specified interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - options - InterconnectGroupsClientBeginGetNodeAvailabilityOptions contains the optional parameters for the InterconnectGroupsClient.BeginGetNodeAvailability +// method. +func (client *InterconnectGroupsClient) BeginGetNodeAvailability(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientBeginGetNodeAvailabilityOptions) (*runtime.Poller[InterconnectGroupsClientGetNodeAvailabilityResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getNodeAvailability(ctx, resourceGroupName, interconnectGroupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterconnectGroupsClientGetNodeAvailabilityResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InterconnectGroupsClientGetNodeAvailabilityResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetNodeAvailability - Gets node availability for all subgroups in the specified interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *InterconnectGroupsClient) getNodeAvailability(ctx context.Context, resourceGroupName string, interconnectGroupName string, options *InterconnectGroupsClientBeginGetNodeAvailabilityOptions) (*http.Response, error) { + var err error + const operationName = "InterconnectGroupsClient.BeginGetNodeAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getNodeAvailabilityCreateRequest(ctx, resourceGroupName, interconnectGroupName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getNodeAvailabilityCreateRequest creates the GetNodeAvailability request. +func (client *InterconnectGroupsClient) getNodeAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, _ *InterconnectGroupsClientBeginGetNodeAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}/nodeAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListPager - Gets all interconnect groups in a resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - InterconnectGroupsClientListOptions contains the optional parameters for the InterconnectGroupsClient.NewListPager +// method. +func (client *InterconnectGroupsClient) NewListPager(resourceGroupName string, options *InterconnectGroupsClientListOptions) *runtime.Pager[InterconnectGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InterconnectGroupsClientListResponse]{ + More: func(page InterconnectGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterconnectGroupsClientListResponse) (InterconnectGroupsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InterconnectGroupsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return InterconnectGroupsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *InterconnectGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *InterconnectGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InterconnectGroupsClient) listHandleResponse(resp *http.Response) (InterconnectGroupsClientListResponse, error) { + result := InterconnectGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterconnectGroupListResult); err != nil { + return InterconnectGroupsClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all interconnect groups in a subscription. +// - options - InterconnectGroupsClientListAllOptions contains the optional parameters for the InterconnectGroupsClient.NewListAllPager +// method. +func (client *InterconnectGroupsClient) NewListAllPager(options *InterconnectGroupsClientListAllOptions) *runtime.Pager[InterconnectGroupsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[InterconnectGroupsClientListAllResponse]{ + More: func(page InterconnectGroupsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterconnectGroupsClientListAllResponse) (InterconnectGroupsClientListAllResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InterconnectGroupsClient.NewListAllPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listAllCreateRequest(ctx, options) + }, nil) + if err != nil { + return InterconnectGroupsClientListAllResponse{}, err + } + return client.listAllHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *InterconnectGroupsClient) listAllCreateRequest(ctx context.Context, _ *InterconnectGroupsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/interconnectGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *InterconnectGroupsClient) listAllHandleResponse(resp *http.Response) (InterconnectGroupsClientListAllResponse, error) { + result := InterconnectGroupsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterconnectGroupListResult); err != nil { + return InterconnectGroupsClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates interconnect group tags. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - parameters - Parameters supplied to update interconnect group tags. +// - options - InterconnectGroupsClientUpdateTagsOptions contains the optional parameters for the InterconnectGroupsClient.UpdateTags +// method. +func (client *InterconnectGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters TagsObject, options *InterconnectGroupsClientUpdateTagsOptions) (InterconnectGroupsClientUpdateTagsResponse, error) { + var err error + const operationName = "InterconnectGroupsClient.UpdateTags" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, interconnectGroupName, parameters, options) + if err != nil { + return InterconnectGroupsClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterconnectGroupsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InterconnectGroupsClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *InterconnectGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, parameters TagsObject, _ *InterconnectGroupsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *InterconnectGroupsClient) updateTagsHandleResponse(resp *http.Response) (InterconnectGroupsClientUpdateTagsResponse, error) { + result := InterconnectGroupsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterconnectGroup); err != nil { + return InterconnectGroupsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/interconnectgroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interconnectgroups_client_example_test.go new file mode 100644 index 000000000000..878493676132 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/interconnectgroups_client_example_test.go @@ -0,0 +1,320 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork_test + +import ( + "context" + "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/network/armnetwork/v10" + "log" +) + +// Generated from example definition: 2025-07-01/InterconnectGroupCreate.json +func ExampleInterconnectGroupsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInterconnectGroupsClient().CreateOrUpdate(ctx, "rg1", "test-ig", armnetwork.InterconnectGroup{ + Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + SubgroupProfile: &armnetwork.SubgroupProfile{ + VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + Size: to.Ptr[int32](18), + }, + }, + Location: to.Ptr("eastus"), + }, 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 = armnetwork.InterconnectGroupsClientCreateOrUpdateResponse{ + // InterconnectGroup: armnetwork.InterconnectGroup{ + // Name: to.Ptr("test-ig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig"), + // Type: to.Ptr("Microsoft.Network/interconnectGroups"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + // SubgroupProfile: &armnetwork.SubgroupProfile{ + // VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + // Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + // Size: to.Ptr[int32](18), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupDelete.json +func ExampleInterconnectGroupsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInterconnectGroupsClient().Delete(ctx, "rg1", "test-ig", 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 = armnetwork.InterconnectGroupsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupGet.json +func ExampleInterconnectGroupsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInterconnectGroupsClient().Get(ctx, "rg1", "test-ig", 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 = armnetwork.InterconnectGroupsClientGetResponse{ + // InterconnectGroup: armnetwork.InterconnectGroup{ + // Name: to.Ptr("test-ig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig"), + // Type: to.Ptr("Microsoft.Network/interconnectGroups"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SubgroupProfile: &armnetwork.SubgroupProfile{ + // VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + // Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + // Size: to.Ptr[int32](18), + // }, + // Subgroups: []*armnetwork.Subgroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig/subgroups/subgroup0"), + // Name: to.Ptr("subgroup0"), + // Properties: &armnetwork.SubgroupProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // InternalSubgroupID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // InterconnectBlock: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/interconnectBlocks/test-block"), + // }, + // VirtualMachines: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupGetNodeAvailability.json +func ExampleInterconnectGroupsClient_BeginGetNodeAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInterconnectGroupsClient().BeginGetNodeAvailability(ctx, "rg1", "test-ig", 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 poll 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 = armnetwork.InterconnectGroupsClientGetNodeAvailabilityResponse{ + // InterconnectGroupNodeAvailability: armnetwork.InterconnectGroupNodeAvailability{ + // SubgroupsNodeAvailability: []*armnetwork.SubgroupNodeAvailabilityEntry{ + // { + // Name: to.Ptr("subgroup0"), + // InternalSubgroupID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // InServiceNodeCount: to.Ptr[int32](16), + // InUseNodeCount: to.Ptr[int32](12), + // Count: to.Ptr[int32](18), + // }, + // { + // Name: to.Ptr("subgroup1"), + // InternalSubgroupID: to.Ptr("00000000-0000-0000-0000-000000000002"), + // InServiceNodeCount: to.Ptr[int32](18), + // InUseNodeCount: to.Ptr[int32](5), + // Count: to.Ptr[int32](18), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupList.json +func ExampleInterconnectGroupsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInterconnectGroupsClient().NewListPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.InterconnectGroupsClientListResponse{ + // InterconnectGroupListResult: armnetwork.InterconnectGroupListResult{ + // Value: []*armnetwork.InterconnectGroup{ + // { + // Name: to.Ptr("test-ig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig"), + // Type: to.Ptr("Microsoft.Network/interconnectGroups"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + // SubgroupProfile: &armnetwork.SubgroupProfile{ + // VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + // Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + // Size: to.Ptr[int32](18), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupListAll.json +func ExampleInterconnectGroupsClient_NewListAllPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInterconnectGroupsClient().NewListAllPager(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 = armnetwork.InterconnectGroupsClientListAllResponse{ + // InterconnectGroupListResult: armnetwork.InterconnectGroupListResult{ + // Value: []*armnetwork.InterconnectGroup{ + // { + // Name: to.Ptr("test-ig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig"), + // Type: to.Ptr("Microsoft.Network/interconnectGroups"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + // SubgroupProfile: &armnetwork.SubgroupProfile{ + // VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + // Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + // Size: to.Ptr[int32](18), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/InterconnectGroupUpdateTags.json +func ExampleInterconnectGroupsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInterconnectGroupsClient().UpdateTags(ctx, "rg1", "test-ig", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.InterconnectGroupsClientUpdateTagsResponse{ + // InterconnectGroup: armnetwork.InterconnectGroup{ + // Name: to.Ptr("test-ig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig"), + // Type: to.Ptr("Microsoft.Network/interconnectGroups"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // Properties: &armnetwork.InterconnectGroupPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Scope: to.Ptr(armnetwork.InterconnectGroupScopeInfiniBand), + // SubgroupProfile: &armnetwork.SubgroupProfile{ + // VMSize: to.Ptr("Standard_ND128isr_NDR_GB200_v6"), + // Scope: to.Ptr(armnetwork.SubgroupProfileScopeVerticalConnect), + // Size: to.Ptr[int32](18), + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go index 6435978ae03f..7e179a547ef6 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// InterfaceIPConfigurationsClient contains the methods for the NetworkInterfaceIPConfigurations group. +// InterfaceIPConfigurationsClient contains the methods for the InterfaceIPConfigurations group. // Don't use this type directly, use NewInterfaceIPConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type InterfaceIPConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewInterfaceIPConfigurationsClient creates a new instance of InterfaceIPConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInterfaceIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceIPConfigurationsClient, error) { @@ -43,11 +43,9 @@ func NewInterfaceIPConfigurationsClient(subscriptionID string, credential azcore // Get - Gets the specified network interface ip configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. -// - ipConfigurationName - The name of the ip configuration name. +// - ipConfigurationName - The name of the ip configuration. // - options - InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get // method. func (client *InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, options *InterfaceIPConfigurationsClientGetOptions) (InterfaceIPConfigurationsClientGetResponse, error) { @@ -75,6 +73,10 @@ func (client *InterfaceIPConfigurationsClient) Get(ctx context.Context, resource // getCreateRequest creates the Get request. func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, _ *InterfaceIPConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Cont return nil, errors.New("parameter ipConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -112,9 +110,7 @@ func (client *InterfaceIPConfigurationsClient) getHandleResponse(resp *http.Resp } // NewListPager - Get all ip configurations in a network interface. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.NewListPager // method. @@ -144,6 +140,10 @@ func (client *InterfaceIPConfigurationsClient) NewListPager(resourceGroupName st // listCreateRequest creates the List request. func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfaceIPConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -152,17 +152,13 @@ func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Con return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go index 9dfa5bc86bff..c0ea4fd57890 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go @@ -1,27 +1,78 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceIPConfigurationList.json +// Generated from example definition: 2025-07-01/NetworkInterfaceIPConfigurationGet.json +func ExampleInterfaceIPConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInterfaceIPConfigurationsClient().Get(ctx, "testrg", "mynic", "ipconfig1", 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 = armnetwork.InterfaceIPConfigurationsClientGetResponse{ + // InterfaceIPConfiguration: armnetwork.InterfaceIPConfiguration{ + // Name: to.Ptr("ipconfig1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), + // }, + // VirtualNetworkTaps: []*armnetwork.VirtualNetworkTap{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP2"), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkInterfaceIPConfigurationList.json func ExampleInterfaceIPConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,72 +87,26 @@ func ExampleInterfaceIPConfigurationsClient_NewListPager() { _ = 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.InterfaceIPConfigurationListResult = armnetwork.InterfaceIPConfigurationListResult{ - // Value: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet12/subnets/subnet12"), + // page = armnetwork.InterfaceIPConfigurationsClientListResponse{ + // InterfaceIPConfigurationListResult: armnetwork.InterfaceIPConfigurationListResult{ + // Value: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet12/subnets/subnet12"), + // }, // }, // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceIPConfigurationGet.json -func ExampleInterfaceIPConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfaceIPConfigurationsClient().Get(ctx, "testrg", "mynic", "ipconfig1", 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.InterfaceIPConfiguration = armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), - // }, - // VirtualNetworkTaps: []*armnetwork.VirtualNetworkTap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP2"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go index 59fdd8bfc0d6..3b0c82b65f9e 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// InterfaceLoadBalancersClient contains the methods for the NetworkInterfaceLoadBalancers group. +// InterfaceLoadBalancersClient contains the methods for the InterfaceLoadBalancers group. // Don't use this type directly, use NewInterfaceLoadBalancersClient() instead. +// +// Generated from API version 2025-07-01 type InterfaceLoadBalancersClient struct { internal *arm.Client subscriptionID string } // NewInterfaceLoadBalancersClient creates a new instance of InterfaceLoadBalancersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceLoadBalancersClient, error) { @@ -42,9 +42,7 @@ func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.To } // NewListPager - List all load balancers in a network interface. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.NewListPager // method. @@ -74,6 +72,10 @@ func (client *InterfaceLoadBalancersClient) NewListPager(resourceGroupName strin // listCreateRequest creates the List request. func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfaceLoadBalancersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,17 +84,13 @@ func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Contex return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go index 513d201f0ecf..d620aa504c0e 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceLoadBalancerList.json +// Generated from example definition: 2025-07-01/NetworkInterfaceLoadBalancerList.json func ExampleInterfaceLoadBalancersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,124 +33,137 @@ func ExampleInterfaceLoadBalancersClient_NewListPager() { _ = 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.InterfaceLoadBalancerListResult = armnetwork.InterfaceLoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lbname1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), - // Name: to.Ptr("bepool1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), - // Name: to.Ptr("lbfrontend"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/publicIPAddresses/myDynamicPublicIP"), + // page = armnetwork.InterfaceLoadBalancersClientListResponse{ + // InterfaceLoadBalancerListResult: armnetwork.InterfaceLoadBalancerListResult{ + // Value: []*armnetwork.LoadBalancer{ + // { + // Name: to.Ptr("lbname1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("bepool1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // Name: to.Ptr("inbound1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("lbfrontend"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), + // }, + // }, + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/publicIPAddresses/myDynamicPublicIP"), + // }, // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("inbound1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rule1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), + // }, + // BackendPort: to.Ptr[int32](80), + // EnableFloatingIP: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), - // Name: to.Ptr("probe1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/interfaces.go b/sdk/resourcemanager/network/armnetwork/interfaces.go index 8a3acf9a2b29..118f605ca499 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client.go b/sdk/resourcemanager/network/armnetwork/interfaces_client.go index a546c1933af3..fc7c4b14f09a 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// InterfacesClient contains the methods for the NetworkInterfaces group. +// InterfacesClient contains the methods for the Interfaces group. // Don't use this type directly, use NewInterfacesClient() instead. +// +// Generated from API versions 2018-10-01, 2025-07-01 type InterfacesClient struct { internal *arm.Client subscriptionID string } // NewInterfacesClient creates a new instance of InterfacesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfacesClient, error) { @@ -43,9 +43,7 @@ func NewInterfacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to the create or update network interface operation. // - options - InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *InterfacesClient) BeginCreateOrUpdate(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *InterfacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *InterfacesClient) createOrUpdate(ctx context.Context, resourceGrou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, _ *InterfacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*runtime.Poller[InterfacesClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginDelete" @@ -175,6 +166,10 @@ func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGro // deleteCreateRequest creates the Delete request. func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfacesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -183,26 +178,19 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. func (client *InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (InterfacesClientGetResponse, error) { @@ -230,6 +218,10 @@ func (client *InterfacesClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,10 +230,6 @@ func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -250,8 +238,8 @@ func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGr if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *InterfacesClient) getHandleResponse(resp *http.Response) (Interfac // GetCloudServiceNetworkInterface - Get the specified network interface in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. // - networkInterfaceName - The name of the network interface. @@ -299,7 +285,11 @@ func (client *InterfacesClient) GetCloudServiceNetworkInterface(ctx context.Cont // getCloudServiceNetworkInterfaceCreateRequest creates the GetCloudServiceNetworkInterface request. func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, options *InterfacesClientGetCloudServiceNetworkInterfaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -316,10 +306,6 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -328,8 +314,8 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -345,9 +331,7 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceHandleResponse(re // BeginGetEffectiveRouteTable - Gets all route tables applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable // method. @@ -358,8 +342,7 @@ func (client *InterfacesClient) BeginGetEffectiveRouteTable(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientGetEffectiveRouteTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -371,8 +354,6 @@ func (client *InterfacesClient) BeginGetEffectiveRouteTable(ctx context.Context, // GetEffectiveRouteTable - Gets all route tables applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginGetEffectiveRouteTable" @@ -397,6 +378,10 @@ func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, reso // getEffectiveRouteTableCreateRequest creates the GetEffectiveRouteTable request. func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfacesClientBeginGetEffectiveRouteTableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -405,17 +390,13 @@ func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context. return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -423,13 +404,7 @@ func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context. // GetVirtualMachineScaleSetIPConfiguration - Get the specified network interface ip configuration in a virtual machine scale // set. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. -// - networkInterfaceName - The name of the network interface. -// - ipConfigurationName - The name of the ip configuration. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetIPConfiguration // method. func (client *InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse, error) { @@ -456,7 +431,11 @@ func (client *InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx con // getVirtualMachineScaleSetIPConfigurationCreateRequest creates the GetVirtualMachineScaleSetIPConfiguration request. func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -477,10 +456,6 @@ func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationCreateRe return nil, errors.New("parameter ipConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -489,8 +464,8 @@ func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationCreateRe if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -506,12 +481,7 @@ func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationHandleRe // GetVirtualMachineScaleSetNetworkInterface - Get the specified network interface in a virtual machine scale set. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. -// - networkInterfaceName - The name of the network interface. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetNetworkInterface // method. func (client *InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error) { @@ -538,7 +508,11 @@ func (client *InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx co // getVirtualMachineScaleSetNetworkInterfaceCreateRequest creates the GetVirtualMachineScaleSetNetworkInterface request. func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -555,10 +529,6 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceCreateR return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -567,8 +537,8 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceCreateR if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -583,9 +553,7 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleR } // NewListPager - Gets all network interfaces in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - InterfacesClientListOptions contains the optional parameters for the InterfacesClient.NewListPager method. func (client *InterfacesClient) NewListPager(resourceGroupName string, options *InterfacesClientListOptions) *runtime.Pager[InterfacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[InterfacesClientListResponse]{ @@ -613,21 +581,21 @@ func (client *InterfacesClient) NewListPager(resourceGroupName string, options * // listCreateRequest creates the List request. func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *InterfacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -642,8 +610,6 @@ func (client *InterfacesClient) listHandleResponse(resp *http.Response) (Interfa } // NewListAllPager - Gets all network interfaces in a subscription. -// -// Generated from API version 2025-05-01 // - options - InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.NewListAllPager method. func (client *InterfacesClient) NewListAllPager(options *InterfacesClientListAllOptions) *runtime.Pager[InterfacesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[InterfacesClientListAllResponse]{ @@ -680,8 +646,8 @@ func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, _ *Int return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -696,9 +662,7 @@ func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (Inte } // NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. // - options - InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceNetworkInterfacesPager // method. @@ -727,7 +691,11 @@ func (client *InterfacesClient) NewListCloudServiceNetworkInterfacesPager(resour // listCloudServiceNetworkInterfacesCreateRequest creates the ListCloudServiceNetworkInterfaces request. func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, _ *InterfacesClientListCloudServiceNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -736,17 +704,13 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(c return nil, errors.New("parameter cloudServiceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -762,9 +726,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse( // NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance // in a cloud service. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. // - options - InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions contains the optional parameters for the @@ -794,7 +756,11 @@ func (client *InterfacesClient) NewListCloudServiceRoleInstanceNetworkInterfaces // listCloudServiceRoleInstanceNetworkInterfacesCreateRequest creates the ListCloudServiceRoleInstanceNetworkInterfaces request. func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, _ *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -807,17 +773,13 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCre return nil, errors.New("parameter roleInstanceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -833,9 +795,7 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesHan // BeginListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups // method. @@ -846,8 +806,7 @@ func (client *InterfacesClient) BeginListEffectiveNetworkSecurityGroups(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientListEffectiveNetworkSecurityGroupsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -859,8 +818,6 @@ func (client *InterfacesClient) BeginListEffectiveNetworkSecurityGroups(ctx cont // ListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginListEffectiveNetworkSecurityGroups" @@ -885,6 +842,10 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.C // listEffectiveNetworkSecurityGroupsCreateRequest creates the ListEffectiveNetworkSecurityGroups request. func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -893,29 +854,20 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest( return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListVirtualMachineScaleSetIPConfigurationsPager - Get the specified network interface ip configuration in a virtual // machine scale set. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. -// - networkInterfaceName - The name of the network interface. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager // method. func (client *InterfacesClient) NewListVirtualMachineScaleSetIPConfigurationsPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse] { @@ -944,6 +896,10 @@ func (client *InterfacesClient) NewListVirtualMachineScaleSetIPConfigurationsPag // listVirtualMachineScaleSetIPConfigurationsCreateRequest creates the ListVirtualMachineScaleSetIPConfigurations request. func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -960,10 +916,6 @@ func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsCreate return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -972,8 +924,8 @@ func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsCreate if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -988,9 +940,7 @@ func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsHandle } // NewListVirtualMachineScaleSetNetworkInterfacesPager - Gets all network interfaces in a virtual machine scale set. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineScaleSetName - The name of the virtual machine scale set. // - options - InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager // method. @@ -1019,7 +969,11 @@ func (client *InterfacesClient) NewListVirtualMachineScaleSetNetworkInterfacesPa // listVirtualMachineScaleSetNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetNetworkInterfaces request. func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, _ *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1028,17 +982,13 @@ func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesCreat return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1054,11 +1004,7 @@ func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesHandl // NewListVirtualMachineScaleSetVMNetworkInterfacesPager - Gets information about all network interfaces in a virtual machine // in a virtual machine scale set. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions contains the optional parameters for the // InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager method. func (client *InterfacesClient) NewListVirtualMachineScaleSetVMNetworkInterfacesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse] { @@ -1086,7 +1032,11 @@ func (client *InterfacesClient) NewListVirtualMachineScaleSetVMNetworkInterfaces // listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetVMNetworkInterfaces request. func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, _ *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1099,17 +1049,13 @@ func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesCre return nil, errors.New("parameter virtualmachineIndex cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1125,9 +1071,7 @@ func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesHan // UpdateTags - Updates a network interface tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to update network interface tags. // - options - InterfacesClientUpdateTagsOptions contains the optional parameters for the InterfacesClient.UpdateTags method. @@ -1156,6 +1100,10 @@ func (client *InterfacesClient) UpdateTags(ctx context.Context, resourceGroupNam // updateTagsCreateRequest creates the UpdateTags request. func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject, _ *InterfacesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1164,18 +1112,15 @@ func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, res return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go index a9ca4a6cce9c..e474b9741ef1 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go @@ -1,292 +1,215 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceRoleInstanceNetworkInterfaceList.json -func ExampleInterfacesClient_NewListCloudServiceRoleInstanceNetworkInterfacesPager() { +// Generated from example definition: 2025-07-01/NetworkInterfaceCreate.json +func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterface() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInterfacesClient().NewListCloudServiceRoleInstanceNetworkInterfacesPager("rg1", "cs1", "TestVMRole_IN_0", 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceNetworkInterfaceList.json -func ExampleInterfacesClient_NewListCloudServiceNetworkInterfacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.InterfacePropertiesFormat{ + DisableTCPStateTracking: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(true), + IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + { + Name: to.Ptr("ipconfig1"), + Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + PublicIPAddress: &armnetwork.PublicIPAddress{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + }, + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + }, + }, + }, + { + Name: to.Ptr("ipconfig2"), + Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + PrivateIPAddressPrefixLength: to.Ptr[int32](28), + }, + }, + }, + }, + }, nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListCloudServiceNetworkInterfacesPager("rg1", "cs1", 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.InterfacesClientCreateOrUpdateResponse{ + // Interface: armnetwork.Interface{ + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // }, + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // }, + // }, + // { + // Name: to.Ptr("ipconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(false), + // PrivateIPAddress: to.Ptr("172.20.2.16/28"), + // PrivateIPAddressPrefixLength: to.Ptr[int32](28), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VnetEncryptionSupported: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceNetworkInterfaceGet.json -func ExampleInterfacesClient_GetCloudServiceNetworkInterface() { +// Generated from example definition: 2025-07-01/NetworkInterfaceCreateGatewayLoadBalancerConsumer.json +func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInterfacesClient().GetCloudServiceNetworkInterface(ctx, "rg1", "cs1", "TestVMRole_IN_0", "nic1", &armnetwork.InterfacesClientGetCloudServiceNetworkInterfaceOptions{Expand: nil}) + poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.InterfacePropertiesFormat{ + EnableAcceleratedNetworking: to.Ptr(true), + IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + { + Name: to.Ptr("ipconfig1"), + Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + GatewayLoadBalancer: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), + }, + PublicIPAddress: &armnetwork.PublicIPAddress{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + }, + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + }, + }, + }, + }, + }, + }, 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 poll 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.Interface = armnetwork.Interface{ - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // res = armnetwork.InterfacesClientCreateOrUpdateResponse{ + // Interface: armnetwork.Interface{ + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, // }, - // InternalDomainNameSuffix: to.Ptr("dns.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // GatewayLoadBalancer: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceDelete.json +// Generated from example definition: 2025-07-01/NetworkInterfaceDelete.json func ExampleInterfacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -294,356 +217,278 @@ func ExampleInterfacesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.InterfacesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceGet.json +// Generated from example definition: 2025-07-01/NetworkInterfaceGet.json func ExampleInterfacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInterfacesClient().Get(ctx, "rg1", "test-nic", &armnetwork.InterfacesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewInterfacesClient().Get(ctx, "rg1", "test-nic", 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.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ + // res = armnetwork.InterfacesClientGetResponse{ + // Interface: armnetwork.Interface{ + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), // }, - // DNSServers: []*string{ + // DscpConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/dscpConfiguration/mydscpconfiguration"), // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // DscpConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/dscpConfiguration/mydscpconfiguration"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // { + // Name: to.Ptr("ipconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(false), + // PrivateIPAddress: to.Ptr("172.20.2.16/28"), + // PrivateIPAddressPrefixLength: to.Ptr[int32](28), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), + // }, + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualMachine: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // VnetEncryptionSupported: to.Ptr(false), // }, - // VnetEncryptionSupported: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceCreate.json -func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterface() { +// Generated from example definition: 2025-07-01/CloudServiceNetworkInterfaceGet.json +func ExampleInterfacesClient_GetCloudServiceNetworkInterface() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.InterfacePropertiesFormat{ - DisableTCPStateTracking: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - }, - }, - }, - { - Name: to.Ptr("ipconfig2"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - PrivateIPAddressPrefixLength: to.Ptr[int32](28), - }, - }}, - }, - }, nil) + res, err := clientFactory.NewInterfacesClient().GetCloudServiceNetworkInterface(ctx, "rg1", "cs1", "TestVMRole_IN_0", "nic1", 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.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, + // res = armnetwork.InterfacesClientGetCloudServiceNetworkInterfaceResponse{ + // Interface: armnetwork.Interface{ + // Name: to.Ptr("nic1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("dns.cdmx.internal.cloudapp.net"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), + // }, + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // }, + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceCreateGatewayLoadBalancerConsumer.json -func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured() { +// Generated from example definition: 2025-07-01/NetworkInterfaceEffectiveRouteTableList.json +func ExampleInterfacesClient_BeginGetEffectiveRouteTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.InterfacePropertiesFormat{ - EnableAcceleratedNetworking: to.Ptr(true), - IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - GatewayLoadBalancer: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - }, - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - }, - }, - }}, - }, - }, nil) + poller, err := clientFactory.NewInterfacesClient().BeginGetEffectiveRouteTable(ctx, "rg1", "nic1", 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) + log.Fatalf("failed to poll 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.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // res = armnetwork.InterfacesClientGetEffectiveRouteTableResponse{ + // EffectiveRouteListResult: armnetwork.EffectiveRouteListResult{ + // Value: []*armnetwork.EffectiveRoute{ + // { + // AddressPrefix: []*string{ + // to.Ptr("172.20.2.0/24"), + // }, + // NextHopIPAddress: []*string{ + // }, + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVnetLocal), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // GatewayLoadBalancer: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - // }, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, + // AddressPrefix: []*string{ + // to.Ptr("0.0.0.0/0"), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceUpdateTags.json -func ExampleInterfacesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().UpdateTags(ctx, "rg1", "test-nic", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ + // NextHopIPAddress: []*string{ + // }, + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), // }, - // DNSServers: []*string{ + // { + // AddressPrefix: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, + // NextHopIPAddress: []*string{ + // }, + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, + // AddressPrefix: []*string{ + // to.Ptr("100.64.0.0/10"), + // }, + // NextHopIPAddress: []*string{ + // }, + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), + // }, + // { + // AddressPrefix: []*string{ + // to.Ptr("172.16.0.0/12"), + // }, + // NextHopIPAddress: []*string{ + // }, + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), + // }, + // { + // AddressPrefix: []*string{ + // to.Ptr("192.168.0.0/16"), + // }, + // NextHopIPAddress: []*string{ // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), + // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), + // State: to.Ptr(armnetwork.EffectiveRouteStateActive), + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceListAll.json -func ExampleInterfacesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/NetworkInterfaceList.json +func ExampleInterfacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInterfacesClient().NewListAllPager(nil) + pager := clientFactory.NewInterfacesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -654,107 +499,126 @@ func ExampleInterfacesClient_NewListAllPager() { _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // page = armnetwork.InterfacesClientListResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("test-nic2"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ // }, - // DNSServers: []*string{ + // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), + // }, + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualMachine: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), // }, + // VnetEncryptionSupported: to.Ptr(false), // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/publicIPAddresses/test-ip2"), + // }, + // { + // Name: to.Ptr("test-nic2"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // }, + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip2"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet2/subnets/default"), + // }, // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/virtualNetworks/rgnew-vnet2/subnets/default"), + // }, + // { + // Name: to.Ptr("ipconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(false), + // PrivateIPAddress: to.Ptr("172.20.2.16/28"), + // PrivateIPAddressPrefixLength: to.Ptr[int32](28), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VnetEncryptionSupported: to.Ptr(false), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceList.json -func ExampleInterfacesClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkInterfaceListAll.json +func ExampleInterfacesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInterfacesClient().NewListPager("rg1", nil) + pager := clientFactory.NewInterfacesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -765,284 +629,112 @@ func ExampleInterfacesClient_NewListPager() { _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // page = armnetwork.InterfacesClientListAllResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("test-nic2"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ // }, - // DNSServers: []*string{ + // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), + // }, + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualMachine: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), // }, + // VnetEncryptionSupported: to.Ptr(false), // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip2"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet2/subnets/default"), - // }, + // }, + // { + // Name: to.Ptr("test-nic2"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgnew/providers/Microsoft.Network/publicIPAddresses/test-ip2"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgnew/providers/Microsoft.Network/virtualNetworks/rgnew-vnet2/subnets/default"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VnetEncryptionSupported: to.Ptr(false), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceEffectiveRouteTableList.json -func ExampleInterfacesClient_BeginGetEffectiveRouteTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginGetEffectiveRouteTable(ctx, "rg1", "nic1", 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.EffectiveRouteListResult = armnetwork.EffectiveRouteListResult{ - // Value: []*armnetwork.EffectiveRoute{ - // { - // AddressPrefix: []*string{ - // to.Ptr("172.20.2.0/24")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVnetLocal), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("100.64.0.0/10")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("172.16.0.0/12")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("192.168.0.0/16")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceEffectiveNSGList.json -func ExampleInterfacesClient_BeginListEffectiveNetworkSecurityGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginListEffectiveNetworkSecurityGroups(ctx, "rg1", "nic1", 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.EffectiveNetworkSecurityGroupListResult = armnetwork.EffectiveNetworkSecurityGroupListResult{ - // Value: []*armnetwork.EffectiveNetworkSecurityGroup{ - // { - // Association: &armnetwork.EffectiveNetworkSecurityGroupAssociation{ - // NetworkInterface: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // }, - // NetworkManager: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ - // { - // Name: to.Ptr("securityRules/rule1"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("0.0.0.0/32"), - // DestinationPortRange: to.Ptr("6579-6579"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](234), - // SourceAddressPrefix: to.Ptr("0.0.0.0/32"), - // SourcePortRange: to.Ptr("456-456"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), - // }, - // { - // Name: to.Ptr("securityRules/default-allow-rdp"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("0.0.0.0/0"), - // DestinationPortRange: to.Ptr("3389-3389"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](1000), - // SourceAddressPrefix: to.Ptr("1.1.1.1/32"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), - // }, - // { - // Name: to.Ptr("defaultSecurityRules/AllowInternetOutBound"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("0-65535"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // ExpandedDestinationAddressPrefix: []*string{ - // to.Ptr("32.0.0.0/3"), - // to.Ptr("4.0.0.0/6"), - // to.Ptr("2.0.0.0/7"), - // to.Ptr("1.0.0.0/8")}, - // Priority: to.Ptr[int32](65001), - // SourceAddressPrefix: to.Ptr("0.0.0.0/0"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), - // }}, - // NetworkSecurityGroup: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/test-nsg"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssVmNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetVMNetworkInterfacesPager() { +// Generated from example definition: 2025-07-01/CloudServiceNetworkInterfaceList.json +func ExampleInterfacesClient_NewListCloudServiceNetworkInterfacesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetVMNetworkInterfacesPager("rg1", "vmss1", "1", nil) + pager := clientFactory.NewInterfacesClient().NewListCloudServiceNetworkInterfacesPager("rg1", "cs1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1053,74 +745,127 @@ func ExampleInterfacesClient_NewListVirtualMachineScaleSetVMNetworkInterfacesPag _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ + // page = armnetwork.InterfacesClientListCloudServiceNetworkInterfacesResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("nic1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), + // }, + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.0"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // }, // }, - // DNSServers: []*string{ + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // { + // Name: to.Ptr("nic1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), + // }, + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), + // }, + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // }, + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetNetworkInterfacesPager() { +// Generated from example definition: 2025-07-01/CloudServiceRoleInstanceNetworkInterfaceList.json +func ExampleInterfacesClient_NewListCloudServiceRoleInstanceNetworkInterfacesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetNetworkInterfacesPager("rg1", "vmss1", nil) + pager := clientFactory.NewInterfacesClient().NewListCloudServiceRoleInstanceNetworkInterfacesPager("rg1", "cs1", "TestVMRole_IN_0", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1131,269 +876,216 @@ func ExampleInterfacesClient_NewListVirtualMachineScaleSetNetworkInterfacesPager _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // page = armnetwork.InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("nic1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0"), - // }, - // }, - // }, - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ // }, - // DNSServers: []*string{ + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // NetworkSecurityGroup: &armnetwork.SecurityGroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssNetworkInterfaceGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetNetworkInterface() { +// Generated from example definition: 2025-07-01/NetworkInterfaceEffectiveNSGList.json +func ExampleInterfacesClient_BeginListEffectiveNetworkSecurityGroups() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInterfacesClient().GetVirtualMachineScaleSetNetworkInterface(ctx, "rg1", "vmss1", "1", "nic1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions{Expand: nil}) + poller, err := clientFactory.NewInterfacesClient().BeginListEffectiveNetworkSecurityGroups(ctx, "rg1", "nic1", 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 poll 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.Interface = armnetwork.Interface{ - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("dns.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // res = armnetwork.InterfacesClientListEffectiveNetworkSecurityGroupsResponse{ + // EffectiveNetworkSecurityGroupListResult: armnetwork.EffectiveNetworkSecurityGroupListResult{ + // Value: []*armnetwork.EffectiveNetworkSecurityGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // Association: &armnetwork.EffectiveNetworkSecurityGroupAssociation{ + // NetworkInterface: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), + // }, + // NetworkManager: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1"), // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), + // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ + // { + // Name: to.Ptr("securityRules/rule1"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("0.0.0.0/32"), + // DestinationPortRange: to.Ptr("6579-6579"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](234), + // SourceAddressPrefix: to.Ptr("0.0.0.0/32"), + // SourcePortRange: to.Ptr("456-456"), + // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), + // }, + // { + // Name: to.Ptr("securityRules/default-allow-rdp"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("0.0.0.0/0"), + // DestinationPortRange: to.Ptr("3389-3389"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](1000), + // SourceAddressPrefix: to.Ptr("1.1.1.1/32"), + // SourcePortRange: to.Ptr("0-65535"), + // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), + // }, + // { + // Name: to.Ptr("defaultSecurityRules/AllowInternetOutBound"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("0-65535"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // ExpandedDestinationAddressPrefix: []*string{ + // to.Ptr("32.0.0.0/3"), + // to.Ptr("4.0.0.0/6"), + // to.Ptr("2.0.0.0/7"), + // to.Ptr("1.0.0.0/8"), + // }, + // Priority: to.Ptr[int32](65001), + // SourceAddressPrefix: to.Ptr("0.0.0.0/0"), + // SourcePortRange: to.Ptr("0-65535"), + // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), + // }, + // }, + // NetworkSecurityGroup: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/test-nsg"), + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssNetworkInterfaceIpConfigList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetIPConfigurationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetIPConfigurationsPager("rg1", "vmss1", "2", "nic1", &armnetwork.InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions{Expand: 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.InterfaceIPConfigurationListResult = armnetwork.InterfaceIPConfigurationListResult{ - // Value: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/2/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.2"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.6"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssNetworkInterfaceIpConfigGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetIPConfiguration() { +// Generated from example definition: 2025-07-01/NetworkInterfaceUpdateTags.json +func ExampleInterfacesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInterfacesClient().GetVirtualMachineScaleSetIPConfiguration(ctx, "rg1", "vmss1", "2", "nic1", "ip1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions{Expand: nil}) + res, err := clientFactory.NewInterfacesClient().UpdateTags(ctx, "rg1", "test-nic", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InterfaceIPConfiguration = armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/2/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.2"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.6"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // res = armnetwork.InterfacesClientUpdateTagsResponse{ + // Interface: armnetwork.Interface{ + // Name: to.Ptr("test-nic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DisableTCPStateTracking: to.Ptr(true), + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // }, + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("172.20.2.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // }, + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VnetEncryptionSupported: to.Ptr(false), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), // }, // }, // } diff --git a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go index b30614a0fa87..869e46f0cce0 100644 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// InterfaceTapConfigurationsClient contains the methods for the NetworkInterfaceTapConfigurations group. +// InterfaceTapConfigurationsClient contains the methods for the InterfaceTapConfigurations group. // Don't use this type directly, use NewInterfaceTapConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type InterfaceTapConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewInterfaceTapConfigurationsClient creates a new instance of InterfaceTapConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewInterfaceTapConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceTapConfigurationsClient, error) { @@ -43,11 +43,10 @@ func NewInterfaceTapConfigurationsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. -// - tapConfigurationName - The name of the tap configuration. +// - tapConfigurationName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - tapConfigurationParameters - Parameters supplied to the create or update tap configuration operation. // - options - InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate // method. @@ -58,8 +57,7 @@ func (client *InterfaceTapConfigurationsClient) BeginCreateOrUpdate(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfaceTapConfigurationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +69,6 @@ func (client *InterfaceTapConfigurationsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfaceTapConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InterfaceTapConfigurationsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdate(ctx context.Conte // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, _ *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, errors.New("parameter tapConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapConfigurationParameters); err != nil { return nil, err } @@ -129,11 +126,10 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specified tap configuration from the NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. -// - tapConfigurationName - The name of the tap configuration. +// - tapConfigurationName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete // method. func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*runtime.Poller[InterfaceTapConfigurationsClientDeleteResponse], error) { @@ -143,8 +139,7 @@ func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfaceTapConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +151,6 @@ func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified tap configuration from the NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *InterfaceTapConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfaceTapConfigurationsClient.BeginDelete" @@ -182,6 +175,10 @@ func (client *InterfaceTapConfigurationsClient) deleteOperation(ctx context.Cont // deleteCreateRequest creates the Delete request. func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, _ *InterfaceTapConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +191,22 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter tapConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get the specified tap configuration on a network interface. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. -// - tapConfigurationName - The name of the tap configuration. +// - tapConfigurationName - The name of the resource that is unique within a resource group. This name can be used to access +// the resource. // - options - InterfaceTapConfigurationsClientGetOptions contains the optional parameters for the InterfaceTapConfigurationsClient.Get // method. func (client *InterfaceTapConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientGetOptions) (InterfaceTapConfigurationsClientGetResponse, error) { @@ -243,6 +234,10 @@ func (client *InterfaceTapConfigurationsClient) Get(ctx context.Context, resourc // getCreateRequest creates the Get request. func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, _ *InterfaceTapConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +250,13 @@ func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter tapConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +271,7 @@ func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Res } // NewListPager - Get all Tap configurations in a network interface. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkInterfaceName - The name of the network interface. // - options - InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.NewListPager // method. @@ -312,6 +301,10 @@ func (client *InterfaceTapConfigurationsClient) NewListPager(resourceGroupName s // listCreateRequest creates the List request. func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, _ *InterfaceTapConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +313,13 @@ func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Co return nil, errors.New("parameter networkInterfaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go index a44af9b9381b..d596797e90bc 100644 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go @@ -1,123 +1,129 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceTapConfigurationDelete.json -func ExampleInterfaceTapConfigurationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkInterfaceTapConfigurationCreate.json +func ExampleInterfaceTapConfigurationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginDelete(ctx, "testrg", "mynic", "tapconfiguration1", nil) + poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginCreateOrUpdate(ctx, "testrg", "mynic", "tapconfiguration1", armnetwork.InterfaceTapConfiguration{ + Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ + VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.InterfaceTapConfigurationsClientCreateOrUpdateResponse{ + // InterfaceTapConfiguration: armnetwork.InterfaceTapConfiguration{ + // Name: to.Ptr("tapConfiguration1"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), + // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceTapConfigurationGet.json -func ExampleInterfaceTapConfigurationsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkInterfaceTapConfigurationDelete.json +func ExampleInterfaceTapConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInterfaceTapConfigurationsClient().Get(ctx, "testrg", "mynic", "tapconfiguration1", nil) + poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginDelete(ctx, "testrg", "mynic", "tapconfiguration1", 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 poll 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.InterfaceTapConfiguration = armnetwork.InterfaceTapConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // }, - // }, + // res = armnetwork.InterfaceTapConfigurationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceTapConfigurationCreate.json -func ExampleInterfaceTapConfigurationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkInterfaceTapConfigurationGet.json +func ExampleInterfaceTapConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginCreateOrUpdate(ctx, "testrg", "mynic", "tapconfiguration1", armnetwork.InterfaceTapConfiguration{ - Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - }, - }, - }, nil) + res, err := clientFactory.NewInterfaceTapConfigurationsClient().Get(ctx, "testrg", "mynic", "tapconfiguration1", 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.InterfaceTapConfiguration = armnetwork.InterfaceTapConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // res = armnetwork.InterfaceTapConfigurationsClientGetResponse{ + // InterfaceTapConfiguration: armnetwork.InterfaceTapConfiguration{ + // Name: to.Ptr("tapConfiguration1"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), + // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkInterfaceTapConfigurationList.json +// Generated from example definition: 2025-07-01/NetworkInterfaceTapConfigurationList.json func ExampleInterfaceTapConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -132,20 +138,23 @@ func ExampleInterfaceTapConfigurationsClient_NewListPager() { _ = 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.InterfaceTapConfigurationListResult = armnetwork.InterfaceTapConfigurationListResult{ - // Value: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // page = armnetwork.InterfaceTapConfigurationsClientListResponse{ + // InterfaceTapConfigurationListResult: armnetwork.InterfaceTapConfigurationListResult{ + // Value: []*armnetwork.InterfaceTapConfiguration{ + // { + // Name: to.Ptr("tapConfiguration1"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), + // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // }, // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go index 14c0c91800ce..ae4bef1ef7c8 100644 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // IPAllocationsClient contains the methods for the IPAllocations group. // Don't use this type directly, use NewIPAllocationsClient() instead. +// +// Generated from API version 2025-07-01 type IPAllocationsClient struct { internal *arm.Client subscriptionID string } // NewIPAllocationsClient creates a new instance of IPAllocationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewIPAllocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPAllocationsClient, error) { @@ -43,9 +43,7 @@ func NewIPAllocationsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to the create or update virtual network operation. // - options - IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *IPAllocationsClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPAllocationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *IPAllocationsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *IPAllocationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *IPAllocationsClient) createOrUpdate(ctx context.Context, resourceG // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, _ *IPAllocationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter ipAllocationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified IpAllocation. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *IPAllocationsClient) BeginDelete(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPAllocationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *IPAllocationsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified IpAllocation. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, _ *IPAllocationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso return nil, errors.New("parameter ipAllocationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified IpAllocation by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. func (client *IPAllocationsClient) Get(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (IPAllocationsClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *IPAllocationsClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter ipAllocationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,8 +255,6 @@ func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAll } // NewListPager - Gets all IpAllocations in a subscription. -// -// Generated from API version 2025-05-01 // - options - IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.NewListPager method. func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientListOptions) *runtime.Pager[IPAllocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListResponse]{ @@ -305,8 +291,8 @@ func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, _ *IPA return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -321,9 +307,7 @@ func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAl } // NewListByResourceGroupPager - Gets all IpAllocations in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager // method. func (client *IPAllocationsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) *runtime.Pager[IPAllocationsClientListByResourceGroupResponse] { @@ -352,21 +336,21 @@ func (client *IPAllocationsClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -382,9 +366,7 @@ func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http. // UpdateTags - Updates a IpAllocation tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to update IpAllocation tags. // - options - IPAllocationsClientUpdateTagsOptions contains the optional parameters for the IPAllocationsClient.UpdateTags @@ -414,6 +396,10 @@ func (client *IPAllocationsClient) UpdateTags(ctx context.Context, resourceGroup // updateTagsCreateRequest creates the UpdateTags request. func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters TagsObject, _ *IPAllocationsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -422,18 +408,15 @@ func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, return nil, errors.New("parameter ipAllocationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go index 557cafe073aa..000d749e123d 100644 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go @@ -1,173 +1,136 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationDelete.json -func ExampleIPAllocationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/IpAllocationCreate.json +func ExampleIPAllocationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPAllocationsClient().BeginDelete(ctx, "rg1", "test-ipallocation", nil) + poller, err := clientFactory.NewIPAllocationsClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipallocation", armnetwork.IPAllocation{ + Location: to.Ptr("centraluseuap"), + Properties: &armnetwork.IPAllocationPropertiesFormat{ + Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + AllocationTags: map[string]*string{ + "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + }, + Prefix: to.Ptr("3.2.5.0/24"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationGet.json -func ExampleIPAllocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPAllocationsClient().Get(ctx, "rg1", "test-ipallocation", &armnetwork.IPAllocationsClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // res = armnetwork.IPAllocationsClientCreateOrUpdateResponse{ + // IPAllocation: armnetwork.IPAllocation{ + // Name: to.Ptr("test-ipallocation"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // }, + // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), + // Prefix: to.Ptr("3.2.5.0/24"), // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationCreate.json -func ExampleIPAllocationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/IpAllocationDelete.json +func ExampleIPAllocationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPAllocationsClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipallocation", armnetwork.IPAllocation{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.IPAllocationPropertiesFormat{ - Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - AllocationTags: map[string]*string{ - "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - }, - Prefix: to.Ptr("3.2.5.0/24"), - }, - }, nil) + poller, err := clientFactory.NewIPAllocationsClient().BeginDelete(ctx, "rg1", "test-ipallocation", 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) + log.Fatalf("failed to poll 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.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, + // res = armnetwork.IPAllocationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationUpdateTags.json -func ExampleIPAllocationsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/IpAllocationGet.json +func ExampleIPAllocationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIPAllocationsClient().UpdateTags(ctx, "rg1", "test-ipallocation", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewIPAllocationsClient().Get(ctx, "rg1", "test-ipallocation", 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.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // res = armnetwork.IPAllocationsClientGetResponse{ + // IPAllocation: armnetwork.IPAllocation{ + // Name: to.Ptr("test-ipallocation"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // }, + // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), + // Prefix: to.Ptr("3.2.5.0/24"), // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationList.json +// Generated from example definition: 2025-07-01/IpAllocationList.json func ExampleIPAllocationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -182,48 +145,51 @@ func ExampleIPAllocationsClient_NewListPager() { _ = 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.IPAllocationListResult = armnetwork.IPAllocationListResult{ - // Value: []*armnetwork.IPAllocation{ - // { - // Name: to.Ptr("test-ipallocation1"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // page = armnetwork.IPAllocationsClientListResponse{ + // IPAllocationListResult: armnetwork.IPAllocationListResult{ + // Value: []*armnetwork.IPAllocation{ + // { + // Name: to.Ptr("test-ipallocation1"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // }, + // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), + // Prefix: to.Ptr("3.2.5.0/24"), // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), // }, - // }, - // { - // Name: to.Ptr("test-ipallocation2"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), + // { + // Name: to.Ptr("test-ipallocation2"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), + // }, + // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), + // Prefix: to.Ptr("3.2.6.0/24"), // }, - // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), - // Prefix: to.Ptr("3.2.6.0/24"), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpAllocationListByResourceGroup.json +// Generated from example definition: 2025-07-01/IpAllocationListByResourceGroup.json func ExampleIPAllocationsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -238,36 +204,84 @@ func ExampleIPAllocationsClient_NewListByResourceGroupPager() { _ = 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.IPAllocationListResult = armnetwork.IPAllocationListResult{ - // Value: []*armnetwork.IPAllocation{ - // { - // Name: to.Ptr("test-ipallocation1"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // page = armnetwork.IPAllocationsClientListByResourceGroupResponse{ + // IPAllocationListResult: armnetwork.IPAllocationListResult{ + // Value: []*armnetwork.IPAllocation{ + // { + // Name: to.Ptr("test-ipallocation1"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // }, + // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), + // Prefix: to.Ptr("3.2.5.0/24"), // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), // }, - // }, - // { - // Name: to.Ptr("test-ipallocation2"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), + // { + // Name: to.Ptr("test-ipallocation2"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), + // }, + // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), + // Prefix: to.Ptr("3.2.6.0/24"), // }, - // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), - // Prefix: to.Ptr("3.2.6.0/24"), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/IpAllocationUpdateTags.json +func ExampleIPAllocationsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewIPAllocationsClient().UpdateTags(ctx, "rg1", "test-ipallocation", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.IPAllocationsClientUpdateTagsResponse{ + // IPAllocation: armnetwork.IPAllocation{ + // Name: to.Ptr("test-ipallocation"), + // Type: to.Ptr("Microsoft.Network/IpAllocations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.IPAllocationPropertiesFormat{ + // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), + // AllocationTags: map[string]*string{ + // "VNetID": to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), + // }, + // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), + // Prefix: to.Ptr("3.2.5.0/24"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/ipampools_client.go b/sdk/resourcemanager/network/armnetwork/ipampools_client.go index 60380a636dbb..2b93732d46f8 100644 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipampools_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // IpamPoolsClient contains the methods for the IpamPools group. // Don't use this type directly, use NewIpamPoolsClient() instead. +// +// Generated from API version 2025-07-01 type IpamPoolsClient struct { internal *arm.Client subscriptionID string } // NewIpamPoolsClient creates a new instance of IpamPoolsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewIpamPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IpamPoolsClient, error) { @@ -43,12 +43,12 @@ func NewIpamPoolsClient(subscriptionID string, credential azcore.TokenCredential } // BeginCreate - Creates/Updates the Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Creates/Updates the Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - poolName - IP Address Manager Pool resource name. +// - poolName - Pool resource name. // - body - Pool resource object to create/update. // - options - IpamPoolsClientBeginCreateOptions contains the optional parameters for the IpamPoolsClient.BeginCreate method. func (client *IpamPoolsClient) BeginCreate(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPool, options *IpamPoolsClientBeginCreateOptions) (*runtime.Poller[IpamPoolsClientCreateResponse], error) { @@ -58,8 +58,7 @@ func (client *IpamPoolsClient) BeginCreate(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IpamPoolsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,9 +69,9 @@ func (client *IpamPoolsClient) BeginCreate(ctx context.Context, resourceGroupNam } // Create - Creates/Updates the Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 +// Creates/Updates the Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. func (client *IpamPoolsClient) create(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPool, options *IpamPoolsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "IpamPoolsClient.BeginCreate" @@ -118,12 +117,13 @@ func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { return nil, err } @@ -131,10 +131,10 @@ func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resource } // BeginDelete - Delete the Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Delete the Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - options - IpamPoolsClientBeginDeleteOptions contains the optional parameters for the IpamPoolsClient.BeginDelete method. @@ -145,8 +145,7 @@ func (client *IpamPoolsClient) BeginDelete(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IpamPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,9 +156,9 @@ func (client *IpamPoolsClient) BeginDelete(ctx context.Context, resourceGroupNam } // Delete - Delete the Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 +// Delete the Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. func (client *IpamPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IpamPoolsClient.BeginDelete" @@ -205,9 +204,8 @@ func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } @@ -215,10 +213,10 @@ func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resource } // Get - Gets the specific Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets the specific Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - options - IpamPoolsClientGetOptions contains the optional parameters for the IpamPoolsClient.Get method. @@ -268,8 +266,8 @@ func (client *IpamPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -284,10 +282,10 @@ func (client *IpamPoolsClient) getHandleResponse(resp *http.Response) (IpamPools } // GetPoolUsage - Get the Pool Usage. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Get the Pool Usage. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - options - IpamPoolsClientGetPoolUsageOptions contains the optional parameters for the IpamPoolsClient.GetPoolUsage method. @@ -337,8 +335,8 @@ func (client *IpamPoolsClient) getPoolUsageCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -354,8 +352,8 @@ func (client *IpamPoolsClient) getPoolUsageHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Pool resources at Network Manager level. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets list of Pool resources at Network Manager level. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - IpamPoolsClientListOptions contains the optional parameters for the IpamPoolsClient.NewListPager method. func (client *IpamPoolsClient) NewListPager(resourceGroupName string, networkManagerName string, options *IpamPoolsClientListOptions) *runtime.Pager[IpamPoolsClientListResponse] { @@ -401,7 +399,7 @@ func (client *IpamPoolsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -417,7 +415,7 @@ func (client *IpamPoolsClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -433,8 +431,8 @@ func (client *IpamPoolsClient) listHandleResponse(resp *http.Response) (IpamPool // NewListAssociatedResourcesPager - List Associated Resource in the Pool. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// List Associated Resource in the Pool. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - options - IpamPoolsClientListAssociatedResourcesOptions contains the optional parameters for the IpamPoolsClient.NewListAssociatedResourcesPager @@ -486,8 +484,8 @@ func (client *IpamPoolsClient) listAssociatedResourcesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -502,20 +500,21 @@ func (client *IpamPoolsClient) listAssociatedResourcesHandleResponse(resp *http. } // Update - Updates the specific Pool resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Updates the specific Pool resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - poolName - IP Address Manager Pool resource name. +// - poolName - Pool resource name. +// - body - Pool resource object to update partially. // - options - IpamPoolsClientUpdateOptions contains the optional parameters for the IpamPoolsClient.Update method. -func (client *IpamPoolsClient) Update(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientUpdateOptions) (IpamPoolsClientUpdateResponse, error) { +func (client *IpamPoolsClient) Update(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPoolUpdate, options *IpamPoolsClientUpdateOptions) (IpamPoolsClientUpdateResponse, error) { var err error const operationName = "IpamPoolsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, networkManagerName, poolName, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkManagerName, poolName, body, options) if err != nil { return IpamPoolsClientUpdateResponse{}, err } @@ -532,7 +531,7 @@ func (client *IpamPoolsClient) Update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *IpamPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientUpdateOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPoolUpdate, options *IpamPoolsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/ipamPools/{poolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -555,17 +554,15 @@ func (client *IpamPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - if options != nil && options.Body != nil { - if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { - return nil, err - } - return req, nil + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err } return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go index 2ba27d4b5bca..ae52410ae158 100644 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go @@ -1,87 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_List.json -func ExampleIpamPoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIpamPoolsClient().NewListPager("rg1", "TestNetworkManager", &armnetwork.IpamPoolsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.IpamPoolList = armnetwork.IpamPoolList{ - // Value: []*armnetwork.IpamPool{ - // { - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_Create.json +// Generated from example definition: 2025-07-01/IpamPools_Create.json func ExampleIpamPoolsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -90,104 +28,82 @@ func ExampleIpamPoolsClient_BeginCreate() { Properties: &armnetwork.IpamPoolProperties{ Description: to.Ptr("Test description."), AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, ParentPoolName: to.Ptr(""), }, - }, &armnetwork.IpamPoolsClientBeginCreateOptions{IfMatch: nil}) + }, 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) + log.Fatalf("failed to poll 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.IpamPoolsClientCreateResponse{ + // IpamPool: armnetwork.IpamPool{ + // Name: to.Ptr("TestPool"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.IpamPoolProperties{ + // Description: to.Ptr("Test description."), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr(armnetwork.IPTypeIPv4), // }, - // } + // ParentPoolName: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_Update.json -func ExampleIpamPoolsClient_Update() { +// Generated from example definition: 2025-07-01/IpamPools_Delete.json +func ExampleIpamPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIpamPoolsClient().Update(ctx, "rg1", "TestNetworkManager", "TestPool", &armnetwork.IpamPoolsClientUpdateOptions{IfMatch: nil, - Body: nil, - }) + poller, err := clientFactory.NewIpamPoolsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr("test-ipam-pool"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_Get.json +// Generated from example definition: 2025-07-01/IpamPools_Get.json func ExampleIpamPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -198,129 +114,181 @@ func ExampleIpamPoolsClient_Get() { // 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.IpamPoolsClientGetResponse{ + // IpamPool: armnetwork.IpamPool{ + // Name: to.Ptr("TestPool"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.IpamPoolProperties{ + // Description: to.Ptr("Test description."), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr(armnetwork.IPTypeIPv4), // }, - // } + // ParentPoolName: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_Delete.json -func ExampleIpamPoolsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/IpamPools_GetPoolUsage.json +func ExampleIpamPoolsClient_GetPoolUsage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIpamPoolsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", &armnetwork.IpamPoolsClientBeginDeleteOptions{IfMatch: nil}) + res, err := clientFactory.NewIpamPoolsClient().GetPoolUsage(ctx, "rg1", "TestNetworkManager", "TestPool", 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) - } + // 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 = armnetwork.IpamPoolsClientGetPoolUsageResponse{ + // PoolUsage: armnetwork.PoolUsage{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/8"), + // to.Ptr("192.0.0.0/8"), + // }, + // AllocatedAddressPrefixes: []*string{ + // to.Ptr("10.0.2.0/26"), + // to.Ptr("10.0.3.0/26"), + // }, + // AvailableAddressPrefixes: []*string{ + // to.Ptr("10.0.1.0/24"), + // to.Ptr("10.0.2.64/26"), + // to.Ptr("10.0.2.128/25"), + // to.Ptr("10.0.3.64/26"), + // to.Ptr("10.0.3.128/25"), + // to.Ptr("10.0.4.0/22"), + // to.Ptr("10.0.8.0/21"), + // to.Ptr("10.0.16.0/20"), + // to.Ptr("10.0.32.0/19"), + // to.Ptr("10.0.64.0/18"), + // to.Ptr("10.0.128.0/17"), + // to.Ptr("10.1.0.0/16"), + // to.Ptr("10.2.0.0/15"), + // to.Ptr("10.4.0.0/14"), + // to.Ptr("10.8.0.0/13"), + // to.Ptr("10.16.0.0/12"), + // to.Ptr("10.32.0.0/11"), + // to.Ptr("10.64.0.0/10"), + // to.Ptr("10.128.0.0/9"), + // to.Ptr("192.0.0.0/8"), + // }, + // ChildPools: []*armnetwork.ResourceBasics{ + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.0.2.0/26"), + // }, + // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool1"), + // }, + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.0.3.0/26"), + // }, + // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool2"), + // }, + // }, + // NumberOfAllocatedIPAddresses: to.Ptr("128"), + // NumberOfAvailableIPAddresses: to.Ptr("33554048"), + // NumberOfReservedIPAddresses: to.Ptr("256"), + // ReservedAddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // TotalNumberOfIPAddresses: to.Ptr("33554432"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_GetPoolUsage.json -func ExampleIpamPoolsClient_GetPoolUsage() { +// Generated from example definition: 2025-07-01/IpamPools_List.json +func ExampleIpamPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIpamPoolsClient().GetPoolUsage(ctx, "rg1", "TestNetworkManager", "TestPool", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewIpamPoolsClient().NewListPager("rg1", "TestNetworkManager", 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 = armnetwork.IpamPoolsClientListResponse{ + // IpamPoolList: armnetwork.IpamPoolList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.IpamPool{ + // { + // Name: to.Ptr("TestPool"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.IpamPoolProperties{ + // Description: to.Ptr("Test description."), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // IPAddressType: []*armnetwork.IPType{ + // to.Ptr(armnetwork.IPTypeIPv4), + // }, + // ParentPoolName: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } } - // 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.PoolUsage = armnetwork.PoolUsage{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("192.0.0.0/8")}, - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.2.0/26"), - // to.Ptr("10.0.3.0/26")}, - // AvailableAddressPrefixes: []*string{ - // to.Ptr("10.0.1.0/24"), - // to.Ptr("10.0.2.64/26"), - // to.Ptr("10.0.2.128/25"), - // to.Ptr("10.0.3.64/26"), - // to.Ptr("10.0.3.128/25"), - // to.Ptr("10.0.4.0/22"), - // to.Ptr("10.0.8.0/21"), - // to.Ptr("10.0.16.0/20"), - // to.Ptr("10.0.32.0/19"), - // to.Ptr("10.0.64.0/18"), - // to.Ptr("10.0.128.0/17"), - // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/15"), - // to.Ptr("10.4.0.0/14"), - // to.Ptr("10.8.0.0/13"), - // to.Ptr("10.16.0.0/12"), - // to.Ptr("10.32.0.0/11"), - // to.Ptr("10.64.0.0/10"), - // to.Ptr("10.128.0.0/9"), - // to.Ptr("192.0.0.0/8")}, - // ChildPools: []*armnetwork.ResourceBasics{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.2.0/26")}, - // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool1"), - // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.3.0/26")}, - // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool2"), - // }}, - // NumberOfAllocatedIPAddresses: to.Ptr("128"), - // NumberOfAvailableIPAddresses: to.Ptr("33554048"), - // NumberOfReservedIPAddresses: to.Ptr("256"), - // ReservedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // TotalNumberOfIPAddresses: to.Ptr("33554432"), - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpamPools_ListAssociatedResources.json +// Generated from example definition: 2025-07-01/IpamPools_ListAssociatedResources.json func ExampleIpamPoolsClient_NewListAssociatedResourcesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -335,20 +303,75 @@ func ExampleIpamPoolsClient_NewListAssociatedResourcesPager() { _ = 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.PoolAssociationList = armnetwork.PoolAssociationList{ - // Value: []*armnetwork.PoolAssociation{ - // { - // Description: to.Ptr(""), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-09T20:00:00.000Z"); return t}()), + // page = armnetwork.IpamPoolsClientListAssociatedResourcesResponse{ + // PoolAssociationList: armnetwork.PoolAssociationList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/listAssociatedResources?api-version=2025-07-01"), + // Value: []*armnetwork.PoolAssociation{ + // { + // Description: to.Ptr(""), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-09T20:00:00.0000000Z"); return t}()), // NumberOfReservedIPAddresses: to.Ptr("0"), // PoolID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), // ReservedPrefixes: []*string{ // }, // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testVnet"), // TotalNumberOfIPAddresses: to.Ptr("256"), - // }}, - // } + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/IpamPools_Update.json +func ExampleIpamPoolsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewIpamPoolsClient().Update(ctx, "rg1", "TestNetworkManager", "TestPool", armnetwork.IpamPoolUpdate{}, 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 = armnetwork.IpamPoolsClientUpdateResponse{ + // IpamPool: armnetwork.IpamPool{ + // Name: to.Ptr("TestPool"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.IpamPoolProperties{ + // Description: to.Ptr("Test description."), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // IPAddressType: []*armnetwork.IPType{ + // to.Ptr(armnetwork.IPTypeIPv4), + // }, + // ParentPoolName: to.Ptr("test-ipam-pool"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go index 6bd64b5afdaf..d2a65149a6bb 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // IPGroupsClient contains the methods for the IPGroups group. // Don't use this type directly, use NewIPGroupsClient() instead. +// +// Generated from API version 2025-07-01 type IPGroupsClient struct { internal *arm.Client subscriptionID string } // NewIPGroupsClient creates a new instance of IPGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewIPGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPGroupsClient, error) { @@ -43,9 +43,7 @@ func NewIPGroupsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates an ipGroups in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the create or update IpGroups operation. // - options - IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *IPGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *IPGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates or updates an ipGroups in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *IPGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *IPGroupsClient) createOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, _ *IPGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter ipGroupsName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*runtime.Poller[IPGroupsClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginDelete" @@ -175,6 +166,10 @@ func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, _ *IPGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -183,26 +178,19 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter ipGroupsName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. func (client *IPGroupsClient) Get(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (IPGroupsClientGetResponse, error) { @@ -230,6 +218,10 @@ func (client *IPGroupsClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,10 +230,6 @@ func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter ipGroupsName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -250,8 +238,8 @@ func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -266,8 +254,6 @@ func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsCl } // NewListPager - Gets all IpGroups in a subscription. -// -// Generated from API version 2025-05-01 // - options - IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.NewListPager method. func (client *IPGroupsClient) NewListPager(options *IPGroupsClientListOptions) *runtime.Pager[IPGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListResponse]{ @@ -304,8 +290,8 @@ func (client *IPGroupsClient) listCreateRequest(ctx context.Context, _ *IPGroups return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -320,9 +306,7 @@ func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsC } // NewListByResourceGroupPager - Gets all IpGroups in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager // method. func (client *IPGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) *runtime.Pager[IPGroupsClientListByResourceGroupResponse] { @@ -351,21 +335,21 @@ func (client *IPGroupsClient) NewListByResourceGroupPager(resourceGroupName stri // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *IPGroupsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,9 +365,7 @@ func (client *IPGroupsClient) listByResourceGroupHandleResponse(resp *http.Respo // UpdateGroups - Updates tags of an IpGroups resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the update ipGroups operation. // - options - IPGroupsClientUpdateGroupsOptions contains the optional parameters for the IPGroupsClient.UpdateGroups method. @@ -412,6 +394,10 @@ func (client *IPGroupsClient) UpdateGroups(ctx context.Context, resourceGroupNam // updateGroupsCreateRequest creates the UpdateGroups request. func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters TagsObject, _ *IPGroupsClientUpdateGroupsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -420,18 +406,15 @@ func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, res return nil, errors.New("parameter ipGroupsName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go index 8e6f123b144d..f4b796c3c422 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go @@ -1,81 +1,39 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsGet.json -func ExampleIPGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPGroupsClient().Get(ctx, "myResourceGroup", "ipGroups1", &armnetwork.IPGroupsClientGetOptions{Expand: 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.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsCreate.json +// Generated from example definition: 2025-07-01/IpGroupsCreate.json func ExampleIPGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewIPGroupsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "ipGroups1", armnetwork.IPGroup{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.IPGroupPropertiesFormat{ IPAddresses: []*string{ to.Ptr("13.64.39.16/32"), to.Ptr("40.74.146.80/31"), - to.Ptr("40.74.147.32/28")}, + to.Ptr("40.74.147.32/28"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), }, }, nil) if err != nil { @@ -83,115 +41,119 @@ func ExampleIPGroupsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // res = armnetwork.IPGroupsClientCreateOrUpdateResponse{ + // IPGroup: armnetwork.IPGroup{ + // Name: to.Ptr("ipGroups1"), + // Type: to.Ptr("Microsoft.Network/ipGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.IPGroupPropertiesFormat{ + // FirewallPolicies: []*armnetwork.SubResource{ + // }, + // Firewalls: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, + // IPAddresses: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsUpdateTags.json -func ExampleIPGroupsClient_UpdateGroups() { +// Generated from example definition: 2025-07-01/IpGroupsDelete.json +func ExampleIPGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIPGroupsClient().UpdateGroups(ctx, "myResourceGroup", "ipGroups1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewIPGroupsClient().BeginDelete(ctx, "myResourceGroup", "ipGroups1", 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 poll 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.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + // res = armnetwork.IPGroupsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsDelete.json -func ExampleIPGroupsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/IpGroupsGet.json +func ExampleIPGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPGroupsClient().BeginDelete(ctx, "myResourceGroup", "ipGroups1", nil) + res, err := clientFactory.NewIPGroupsClient().Get(ctx, "myResourceGroup", "ipGroups1", 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) - } + // 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 = armnetwork.IPGroupsClientGetResponse{ + // IPGroup: armnetwork.IPGroup{ + // Name: to.Ptr("ipGroups1"), + // Type: to.Ptr("Microsoft.Network/ipGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.IPGroupPropertiesFormat{ + // FirewallPolicies: []*armnetwork.SubResource{ + // }, + // Firewalls: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, + // IPAddresses: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsListByResourceGroup.json -func ExampleIPGroupsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/IpGroupsListBySubscription.json +func ExampleIPGroupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewIPGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewIPGroupsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -202,64 +164,71 @@ func ExampleIPGroupsClient_NewListByResourceGroupPager() { _ = 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.IPGroupListResult = armnetwork.IPGroupListResult{ - // Value: []*armnetwork.IPGroup{ - // { - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // page = armnetwork.IPGroupsClientListResponse{ + // IPGroupListResult: armnetwork.IPGroupListResult{ + // Value: []*armnetwork.IPGroup{ + // { + // Name: to.Ptr("iptag1"), + // Type: to.Ptr("Microsoft.Network/ipGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup1/ipGroups"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.IPGroupPropertiesFormat{ + // FirewallPolicies: []*armnetwork.SubResource{ + // }, + // Firewalls: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, + // IPAddresses: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, // { - // Name: to.Ptr("ipGroups2"), + // Name: to.Ptr("iptag2"), // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups"), - // Location: to.Ptr("centralus"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup2/ipGroups"), + // Location: to.Ptr("centralus"), // Properties: &armnetwork.IPGroupPropertiesFormat{ // FirewallPolicies: []*armnetwork.SubResource{ // }, // Firewalls: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, // IPAddresses: []*string{ // to.Ptr("14.64.39.16/32"), // to.Ptr("41.74.146.80/31"), - // to.Ptr("42.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr("42.74.147.32/28"), // }, - // }}, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/IpGroupsListBySubscription.json -func ExampleIPGroupsClient_NewListPager() { +// Generated from example definition: 2025-07-01/IpGroupsListByResourceGroup.json +func ExampleIPGroupsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewIPGroupsClient().NewListPager(nil) + pager := clientFactory.NewIPGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -270,48 +239,108 @@ func ExampleIPGroupsClient_NewListPager() { _ = 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.IPGroupListResult = armnetwork.IPGroupListResult{ - // Value: []*armnetwork.IPGroup{ - // { - // Name: to.Ptr("iptag1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup1/ipGroups"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // page = armnetwork.IPGroupsClientListByResourceGroupResponse{ + // IPGroupListResult: armnetwork.IPGroupListResult{ + // Value: []*armnetwork.IPGroup{ + // { + // Name: to.Ptr("ipGroups1"), + // Type: to.Ptr("Microsoft.Network/ipGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.IPGroupPropertiesFormat{ + // FirewallPolicies: []*armnetwork.SubResource{ + // }, + // Firewalls: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, + // IPAddresses: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, // { - // Name: to.Ptr("iptag2"), + // Name: to.Ptr("ipGroups2"), // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup2/ipGroups"), - // Location: to.Ptr("centralus"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups"), + // Location: to.Ptr("centralus"), // Properties: &armnetwork.IPGroupPropertiesFormat{ // FirewallPolicies: []*armnetwork.SubResource{ // }, // Firewalls: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, // IPAddresses: []*string{ // to.Ptr("14.64.39.16/32"), // to.Ptr("41.74.146.80/31"), - // to.Ptr("42.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // to.Ptr("42.74.147.32/28"), // }, - // }}, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/IpGroupsUpdateTags.json +func ExampleIPGroupsClient_UpdateGroups() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + res, err := clientFactory.NewIPGroupsClient().UpdateGroups(ctx, "myResourceGroup", "ipGroups1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.IPGroupsClientUpdateGroupsResponse{ + // IPGroup: armnetwork.IPGroup{ + // Name: to.Ptr("ipGroups1"), + // Type: to.Ptr("Microsoft.Network/ipGroups"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/myResourceGroup/ipGroups/ipGroups1"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.IPGroupPropertiesFormat{ + // FirewallPolicies: []*armnetwork.SubResource{ + // }, + // Firewalls: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), + // }, + // }, + // IPAddresses: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go index 58fd2352c37f..2f0aad711eda 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go index 9879725127da..d699c0cf16ad 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go index 73a11d82e09f..e96f0e5ab653 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerBackendAddressPoolsClient contains the methods for the LoadBalancerBackendAddressPools group. // Don't use this type directly, use NewLoadBalancerBackendAddressPoolsClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerBackendAddressPoolsClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerBackendAddressPoolsClient creates a new instance of LoadBalancerBackendAddressPoolsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerBackendAddressPoolsClient, error) { @@ -43,9 +43,7 @@ func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. // - parameters - Parameters supplied to the create or update load balancer backend address pool operation. @@ -58,8 +56,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginCreateOrUpdate(ctx con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginCreateOrUpdate(ctx con // CreateOrUpdate - Creates or updates a load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdate(ctx context. // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, _ *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest return nil, errors.New("parameter backendAddressPoolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest // BeginDelete - Deletes the specified load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. // - options - LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete @@ -143,8 +137,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginDelete(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginDelete(ctx context.Con // Delete - Deletes the specified load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerBackendAddressPoolsClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context // deleteCreateRequest creates the Delete request. func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, _ *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,26 +189,19 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con return nil, errors.New("parameter backendAddressPoolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. // - options - LoadBalancerBackendAddressPoolsClientGetOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.Get @@ -243,6 +231,10 @@ func (client *LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, re // getCreateRequest creates the Get request. func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, _ *LoadBalancerBackendAddressPoolsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx contex return nil, errors.New("parameter backendAddressPoolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +268,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *htt } // NewListPager - Gets all the load balancer backed address pools. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.NewListPager // method. @@ -312,6 +298,10 @@ func (client *LoadBalancerBackendAddressPoolsClient) NewListPager(resourceGroupN // listCreateRequest creates the List request. func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerBackendAddressPoolsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx conte return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go index f187c6fa76da..f46271b0431c 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go @@ -1,133 +1,134 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LBBackendAddressPoolListWithBackendAddressesPoolType.json -func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerWithBackendAddressPoolContainingBackendAddresses() { +// Generated from example definition: 2025-07-01/LBBackendAddressPoolWithBackendAddressesPut.json +func ExampleLoadBalancerBackendAddressPoolsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", 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.LoadBalancerBackendAddressPoolListResult = armnetwork.LoadBalancerBackendAddressPoolListResult{ - // Value: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginCreateOrUpdate(ctx, "testrg", "lb", "backend", armnetwork.BackendAddressPool{ + Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + { + Name: to.Ptr("address1"), + Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + IPAddress: to.Ptr("10.0.0.4"), + VirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + }, + }, + }, + { + Name: to.Ptr("address2"), + Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + IPAddress: to.Ptr("10.0.0.5"), + VirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + }, + }, + }, + }, + }, + }, 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 poll 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 = armnetwork.LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse{ + // BackendAddressPool: armnetwork.BackendAddressPool{ + // Name: to.Ptr("backend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + // { + // Name: to.Ptr("address1"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.4"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, + // }, + // }, + // { + // Name: to.Ptr("address2"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.5"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerBackendAddressPoolList.json -func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerBackendAddressPoolList() { +// Generated from example definition: 2025-07-01/LoadBalancerBackendAddressPoolDelete.json +func ExampleLoadBalancerBackendAddressPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", 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.LoadBalancerBackendAddressPoolListResult = armnetwork.LoadBalancerBackendAddressPoolListResult{ - // Value: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginDelete(ctx, "testrg", "lb", "backend", 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 poll 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 = armnetwork.LoadBalancerBackendAddressPoolsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LBBackendAddressPoolWithBackendAddressesGet.json +// Generated from example definition: 2025-07-01/LBBackendAddressPoolWithBackendAddressesGet.json func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerWithBackendAddressPoolWithBackendAddresses() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -138,48 +139,52 @@ func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerWithBackendAdd // 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.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // res = armnetwork.LoadBalancerBackendAddressPoolsClientGetResponse{ + // BackendAddressPool: armnetwork.BackendAddressPool{ + // Name: to.Ptr("backend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + // { + // Name: to.Ptr("address1"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.4"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, // }, // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // { + // Name: to.Ptr("address2"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.5"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, // }, // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerBackendAddressPoolGet.json +// Generated from example definition: 2025-07-01/LoadBalancerBackendAddressPoolGet.json func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerBackendAddressPoolGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -190,120 +195,140 @@ func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerBackendAddress // 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.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.LoadBalancerBackendAddressPoolsClientGetResponse{ + // BackendAddressPool: armnetwork.BackendAddressPool{ + // Name: to.Ptr("backend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LBBackendAddressPoolWithBackendAddressesPut.json -func ExampleLoadBalancerBackendAddressPoolsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/LBBackendAddressPoolListWithBackendAddressesPoolType.json +func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerWithBackendAddressPoolContainingBackendAddresses() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginCreateOrUpdate(ctx, "testrg", "lb", "backend", armnetwork.BackendAddressPool{ - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - { - Name: to.Ptr("address1"), - Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - IPAddress: to.Ptr("10.0.0.4"), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }, - { - Name: to.Ptr("address2"), - Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - IPAddress: to.Ptr("10.0.0.5"), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }}, - }, - }, 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) + pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", 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 = armnetwork.LoadBalancerBackendAddressPoolsClientListResponse{ + // LoadBalancerBackendAddressPoolListResult: armnetwork.LoadBalancerBackendAddressPoolListResult{ + // Value: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("backend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + // { + // Name: to.Ptr("address1"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.4"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, + // }, + // }, + // { + // Name: to.Ptr("address2"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // IPAddress: to.Ptr("10.0.0.5"), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } - // 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.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerBackendAddressPoolDelete.json -func ExampleLoadBalancerBackendAddressPoolsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/LoadBalancerBackendAddressPoolList.json +func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerBackendAddressPoolList() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginDelete(ctx, "testrg", "lb", "backend", 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) + pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", 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 = armnetwork.LoadBalancerBackendAddressPoolsClientListResponse{ + // LoadBalancerBackendAddressPoolListResult: armnetwork.LoadBalancerBackendAddressPoolListResult{ + // Value: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("backend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go index 3f66d091cfcf..8aaed007b3ca 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerFrontendIPConfigurationsClient contains the methods for the LoadBalancerFrontendIPConfigurations group. // Don't use this type directly, use NewLoadBalancerFrontendIPConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerFrontendIPConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerFrontendIPConfigurationsClient creates a new instance of LoadBalancerFrontendIPConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerFrontendIPConfigurationsClient, error) { @@ -43,11 +43,10 @@ func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string, creden // Get - Gets load balancer frontend IP configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. -// - frontendIPConfigurationName - The name of the frontend IP configuration. +// - frontendIPConfigurationName - The name of the resource that is unique within the set of frontend IP configurations used +// by the load balancer. This name can be used to access the resource. // - options - LoadBalancerFrontendIPConfigurationsClientGetOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.Get // method. func (client *LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (LoadBalancerFrontendIPConfigurationsClientGetResponse, error) { @@ -75,6 +74,10 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Contex // getCreateRequest creates the Get request. func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, _ *LoadBalancerFrontendIPConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +90,13 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx c return nil, errors.New("parameter frontendIPConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{frontendIPConfigurationName}", url.PathEscape(frontendIPConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -112,9 +111,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getHandleResponse(resp } // NewListPager - Gets all the load balancer frontend IP configurations. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.NewListPager // method. @@ -144,6 +141,10 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) NewListPager(resourceG // listCreateRequest creates the List request. func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerFrontendIPConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -152,17 +153,13 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go index 5a95b82f8c06..ce37a79b2ec7 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go @@ -1,27 +1,71 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerFrontendIPConfigurationList.json +// Generated from example definition: 2025-07-01/LoadBalancerFrontendIPConfigurationGet.json +func ExampleLoadBalancerFrontendIPConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancerFrontendIPConfigurationsClient().Get(ctx, "testrg", "lb", "frontend", 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 = armnetwork.LoadBalancerFrontendIPConfigurationsClientGetResponse{ + // FrontendIPConfiguration: armnetwork.FrontendIPConfiguration{ + // Name: to.Ptr("frontend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerFrontendIPConfigurationList.json func ExampleLoadBalancerFrontendIPConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,74 +80,36 @@ func ExampleLoadBalancerFrontendIPConfigurationsClient_NewListPager() { _ = 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.LoadBalancerFrontendIPConfigurationListResult = armnetwork.LoadBalancerFrontendIPConfigurationListResult{ - // Value: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), - // Name: to.Ptr("frontend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // page = armnetwork.LoadBalancerFrontendIPConfigurationsClientListResponse{ + // LoadBalancerFrontendIPConfigurationListResult: armnetwork.LoadBalancerFrontendIPConfigurationListResult{ + // Value: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("frontend"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerFrontendIPConfigurationGet.json -func ExampleLoadBalancerFrontendIPConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerFrontendIPConfigurationsClient().Get(ctx, "testrg", "lb", "frontend", 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.FrontendIPConfiguration = armnetwork.FrontendIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), - // Name: to.Ptr("frontend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go index 70fbf5e1f45d..608ef17b7fbb 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerLoadBalancingRulesClient contains the methods for the LoadBalancerLoadBalancingRules group. // Don't use this type directly, use NewLoadBalancerLoadBalancingRulesClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerLoadBalancingRulesClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerLoadBalancingRulesClient creates a new instance of LoadBalancerLoadBalancingRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerLoadBalancingRulesClient, error) { @@ -43,9 +43,7 @@ func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string, credential a // Get - Gets the specified load balancer load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. // - options - LoadBalancerLoadBalancingRulesClientGetOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.Get @@ -75,6 +73,10 @@ func (client *LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, res // getCreateRequest creates the Get request. func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string, _ *LoadBalancerLoadBalancingRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context return nil, errors.New("parameter loadBalancingRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancingRuleName}", url.PathEscape(loadBalancingRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -113,9 +111,6 @@ func (client *LoadBalancerLoadBalancingRulesClient) getHandleResponse(resp *http // BeginHealth - Get health details of a load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. // - options - LoadBalancerLoadBalancingRulesClientBeginHealthOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.BeginHealth @@ -127,8 +122,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) BeginHealth(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancerLoadBalancingRulesClientHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -140,8 +134,6 @@ func (client *LoadBalancerLoadBalancingRulesClient) BeginHealth(ctx context.Cont // Health - Get health details of a load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancerLoadBalancingRulesClient) health(ctx context.Context, groupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientBeginHealthOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerLoadBalancingRulesClient.BeginHealth" @@ -166,6 +158,10 @@ func (client *LoadBalancerLoadBalancingRulesClient) health(ctx context.Context, // healthCreateRequest creates the Health request. func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx context.Context, groupName string, loadBalancerName string, loadBalancingRuleName string, _ *LoadBalancerLoadBalancingRulesClientBeginHealthOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}/health" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -178,25 +174,19 @@ func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx cont return nil, errors.New("parameter loadBalancingRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancingRuleName}", url.PathEscape(loadBalancingRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListPager - Gets all the load balancing rules in a load balancer. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.NewListPager // method. @@ -226,6 +216,10 @@ func (client *LoadBalancerLoadBalancingRulesClient) NewListPager(resourceGroupNa // listCreateRequest creates the List request. func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerLoadBalancingRulesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -234,17 +228,13 @@ func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx contex return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go index fbaf25f23da5..46c6b490e552 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go @@ -1,80 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerLoadBalancingRuleList.json -func ExampleLoadBalancerLoadBalancingRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerLoadBalancingRulesClient().NewListPager("testrg", "lb1", 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.LoadBalancerLoadBalancingRuleListResult = armnetwork.LoadBalancerLoadBalancingRuleListResult{ - // Value: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerLoadBalancingRuleGet.json +// Generated from example definition: 2025-07-01/LoadBalancerLoadBalancingRuleGet.json func ExampleLoadBalancerLoadBalancingRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -85,41 +29,43 @@ func ExampleLoadBalancerLoadBalancingRulesClient_Get() { // 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.LoadBalancingRule = armnetwork.LoadBalancingRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // res = armnetwork.LoadBalancerLoadBalancingRulesClientGetResponse{ + // LoadBalancingRule: armnetwork.LoadBalancingRule{ + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // }, + // BackendPort: to.Ptr[int32](80), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerHealth.json +// Generated from example definition: 2025-07-01/LoadBalancerHealth.json func ExampleLoadBalancerLoadBalancingRulesClient_BeginHealth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -129,20 +75,79 @@ func ExampleLoadBalancerLoadBalancingRulesClient_BeginHealth() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancerHealthPerRule = armnetwork.LoadBalancerHealthPerRule{ - // Down: to.Ptr[int32](0), - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerHealthPerRulePerBackendAddress{ - // { - // IPAddress: to.Ptr("10.1.0.4"), - // NetworkInterfaceIPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/NIC1/IpConfigurations/ipConfig"), - // Reason: to.Ptr("Up_Probe_Success"), - // State: to.Ptr("Up"), - // }}, - // Up: to.Ptr[int32](1), + // res = armnetwork.LoadBalancerLoadBalancingRulesClientHealthResponse{ + // LoadBalancerHealthPerRule: armnetwork.LoadBalancerHealthPerRule{ + // Down: to.Ptr[int32](0), + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerHealthPerRulePerBackendAddress{ + // { + // IPAddress: to.Ptr("10.1.0.4"), + // NetworkInterfaceIPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/NIC1/IpConfigurations/ipConfig"), + // Reason: to.Ptr("Up_Probe_Success"), + // State: to.Ptr("Up"), + // }, + // }, + // Up: to.Ptr[int32](1), + // }, // } } + +// Generated from example definition: 2025-07-01/LoadBalancerLoadBalancingRuleList.json +func ExampleLoadBalancerLoadBalancingRulesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewLoadBalancerLoadBalancingRulesClient().NewListPager("testrg", "lb1", 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 = armnetwork.LoadBalancerLoadBalancingRulesClientListResponse{ + // LoadBalancerLoadBalancingRuleListResult: armnetwork.LoadBalancerLoadBalancingRuleListResult{ + // Value: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // }, + // BackendPort: to.Ptr[int32](80), + // EnableFloatingIP: to.Ptr(false), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go index 8a8265b004a9..3e0c739c3b2a 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerNetworkInterfacesClient contains the methods for the LoadBalancerNetworkInterfaces group. // Don't use this type directly, use NewLoadBalancerNetworkInterfacesClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerNetworkInterfacesClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerNetworkInterfacesClient creates a new instance of LoadBalancerNetworkInterfacesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerNetworkInterfacesClient, error) { @@ -42,9 +42,7 @@ func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential az } // NewListPager - Gets associated load balancer network interfaces. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.NewListPager // method. @@ -74,6 +72,10 @@ func (client *LoadBalancerNetworkInterfacesClient) NewListPager(resourceGroupNam // listCreateRequest creates the List request. func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerNetworkInterfacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,17 +84,13 @@ func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go index 0c3ef407a749..40ca86c146fb 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerNetworkInterfaceListSimple.json +// Generated from example definition: 2025-07-01/LoadBalancerNetworkInterfaceListSimple.json func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetworkInterfaceListSimple() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,62 +33,68 @@ func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetwork _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("mynic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // page = armnetwork.LoadBalancerNetworkInterfacesClientListResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("mynic"), + // Type: to.Ptr("Microsoft.Network/networkInterfaces"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inbound1"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool1"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inbound1"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerNetworkInterfaceListVmss.json +// Generated from example definition: 2025-07-01/LoadBalancerNetworkInterfaceListVmss.json func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetworkInterfaceListVmss() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -106,102 +109,111 @@ func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetwork _ = 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.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("vmss1Nic"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ + // page = armnetwork.LoadBalancerNetworkInterfacesClientListResponse{ + // InterfaceListResult: armnetwork.InterfaceListResult{ + // Value: []*armnetwork.Interface{ + // { + // Name: to.Ptr("vmss1Nic"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), // }, - // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), - // Name: to.Ptr("vmss1IpConfig"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("vmss1IpConfig"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.0"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0"), - // }, - // }, - // }, - // { - // Name: to.Ptr("vmss1Nic"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ // }, - // DNSServers: []*string{ + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualMachine: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0"), // }, - // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), - // Name: to.Ptr("vmss1IpConfig"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), + // }, + // { + // Name: to.Ptr("vmss1Nic"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic"), + // Properties: &armnetwork.InterfacePropertiesFormat{ + // DNSSettings: &armnetwork.InterfaceDNSSettings{ + // AppliedDNSServers: []*string{ + // }, + // DNSServers: []*string{ + // }, + // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), + // }, + // EnableAcceleratedNetworking: to.Ptr(false), + // EnableIPForwarding: to.Ptr(false), + // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ + // { + // Name: to.Ptr("vmss1IpConfig"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), + // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ + // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), + // }, + // }, + // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.1"), + // }, + // }, + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.0.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), + // }, // }, // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), + // }, + // MacAddress: to.Ptr("00-00-00-00-00-00"), + // Primary: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // VirtualMachine: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), + // }, // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go index 1c3e7e16db5c..4f0d974a6402 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerOutboundRulesClient contains the methods for the LoadBalancerOutboundRules group. // Don't use this type directly, use NewLoadBalancerOutboundRulesClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerOutboundRulesClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerOutboundRulesClient creates a new instance of LoadBalancerOutboundRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerOutboundRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerOutboundRulesClient, error) { @@ -43,9 +43,7 @@ func NewLoadBalancerOutboundRulesClient(subscriptionID string, credential azcore // Get - Gets the specified load balancer outbound rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - outboundRuleName - The name of the outbound rule. // - options - LoadBalancerOutboundRulesClientGetOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.Get @@ -75,6 +73,10 @@ func (client *LoadBalancerOutboundRulesClient) Get(ctx context.Context, resource // getCreateRequest creates the Get request. func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string, _ *LoadBalancerOutboundRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Cont return nil, errors.New("parameter outboundRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{outboundRuleName}", url.PathEscape(outboundRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -112,9 +110,7 @@ func (client *LoadBalancerOutboundRulesClient) getHandleResponse(resp *http.Resp } // NewListPager - Gets all the outbound rules in a load balancer. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.NewListPager // method. @@ -144,6 +140,10 @@ func (client *LoadBalancerOutboundRulesClient) NewListPager(resourceGroupName st // listCreateRequest creates the List request. func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerOutboundRulesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -152,17 +152,13 @@ func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Con return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go index fe5d3ab52243..76bf5ff75d84 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go @@ -1,27 +1,67 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerOutboundRuleList.json +// Generated from example definition: 2025-07-01/LoadBalancerOutboundRuleGet.json +func ExampleLoadBalancerOutboundRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancerOutboundRulesClient().Get(ctx, "testrg", "lb1", "rule1", 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 = armnetwork.LoadBalancerOutboundRulesClientGetResponse{ + // OutboundRule: armnetwork.OutboundRule{ + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), + // Properties: &armnetwork.OutboundRulePropertiesFormat{ + // AllocatedOutboundPorts: to.Ptr[int32](64), + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // }, + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), + // }, + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerOutboundRuleList.json func ExampleLoadBalancerOutboundRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,68 +76,32 @@ func ExampleLoadBalancerOutboundRulesClient_NewListPager() { _ = 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.LoadBalancerOutboundRuleListResult = armnetwork.LoadBalancerOutboundRuleListResult{ - // Value: []*armnetwork.OutboundRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](64), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // page = armnetwork.LoadBalancerOutboundRulesClientListResponse{ + // LoadBalancerOutboundRuleListResult: armnetwork.LoadBalancerOutboundRuleListResult{ + // Value: []*armnetwork.OutboundRule{ + // { + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), + // Properties: &armnetwork.OutboundRulePropertiesFormat{ + // AllocatedOutboundPorts: to.Ptr[int32](64), + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), + // }, + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), + // }, + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), // }, - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerOutboundRuleGet.json -func ExampleLoadBalancerOutboundRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerOutboundRulesClient().Get(ctx, "testrg", "lb1", "rule1", 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.OutboundRule = armnetwork.OutboundRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](64), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go index 60c9b5445f3c..a5cd3e299e0c 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancerProbesClient contains the methods for the LoadBalancerProbes group. // Don't use this type directly, use NewLoadBalancerProbesClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancerProbesClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancerProbesClient creates a new instance of LoadBalancerProbesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancerProbesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerProbesClient, error) { @@ -43,9 +43,7 @@ func NewLoadBalancerProbesClient(subscriptionID string, credential azcore.TokenC // Get - Gets load balancer probe. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - probeName - The name of the probe. // - options - LoadBalancerProbesClientGetOptions contains the optional parameters for the LoadBalancerProbesClient.Get method. @@ -74,6 +72,10 @@ func (client *LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string, _ *LoadBalancerProbesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -86,17 +88,13 @@ func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, re return nil, errors.New("parameter probeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{probeName}", url.PathEscape(probeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -111,9 +109,7 @@ func (client *LoadBalancerProbesClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Gets all the load balancer probes. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.NewListPager // method. @@ -143,6 +139,10 @@ func (client *LoadBalancerProbesClient) NewListPager(resourceGroupName string, l // listCreateRequest creates the List request. func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancerProbesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -151,17 +151,13 @@ func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, r return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go index 8a72b2f4c968..4e21bc21452f 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go @@ -1,27 +1,66 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerProbeList.json +// Generated from example definition: 2025-07-01/LoadBalancerProbeGet.json +func ExampleLoadBalancerProbesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancerProbesClient().Get(ctx, "testrg", "lb", "probe1", 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 = armnetwork.LoadBalancerProbesClientGetResponse{ + // Probe: armnetwork.Probe{ + // Name: to.Ptr("probe1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/probe1"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerProbeList.json func ExampleLoadBalancerProbesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,66 +75,31 @@ func ExampleLoadBalancerProbesClient_NewListPager() { _ = 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.LoadBalancerProbeListResult = armnetwork.LoadBalancerProbeListResult{ - // Value: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // page = armnetwork.LoadBalancerProbesClientListResponse{ + // LoadBalancerProbeListResult: armnetwork.LoadBalancerProbeListResult{ + // Value: []*armnetwork.Probe{ + // { + // Name: to.Ptr("prlb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, // }, - // }}, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerProbeGet.json -func ExampleLoadBalancerProbesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerProbesClient().Get(ctx, "testrg", "lb", "probe1", 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.Probe = armnetwork.Probe{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/probe1"), - // Name: to.Ptr("probe1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go index 7d3d4c963802..82005cbe22fd 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LoadBalancersClient contains the methods for the LoadBalancers group. // Don't use this type directly, use NewLoadBalancersClient() instead. +// +// Generated from API version 2025-07-01 type LoadBalancersClient struct { internal *arm.Client subscriptionID string } // NewLoadBalancersClient creates a new instance of LoadBalancersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancersClient, error) { @@ -43,9 +43,7 @@ func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a load balancer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to the create or update load balancer operation. // - options - LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *LoadBalancersClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *LoadBalancersClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a load balancer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancersClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *LoadBalancersClient) createOrUpdate(ctx context.Context, resourceG // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, _ *LoadBalancersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, _ *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,11 @@ func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + if options != nil && options.DetailLevel != nil { + reqQP.Set("detailLevel", string(*options.DetailLevel)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +258,7 @@ func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadB } // NewListPager - Gets all the load balancers in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.NewListPager method. func (client *LoadBalancersClient) NewListPager(resourceGroupName string, options *LoadBalancersClientListOptions) *runtime.Pager[LoadBalancersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListResponse]{ @@ -297,21 +286,21 @@ func (client *LoadBalancersClient) NewListPager(resourceGroupName string, option // listCreateRequest creates the List request. func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *LoadBalancersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -326,8 +315,6 @@ func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (Load } // NewListAllPager - Gets all the load balancers in a subscription. -// -// Generated from API version 2025-05-01 // - options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager // method. func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { @@ -365,8 +352,8 @@ func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, _ * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -382,11 +369,8 @@ func (client *LoadBalancersClient) listAllHandleResponse(resp *http.Response) (L // BeginListInboundNatRulePortMappings - List of inbound NAT rule port mappings. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. -// - backendPoolName - The name of the load balancer backend address pool. +// - backendPoolName - The name of the backend address pool. // - parameters - Query inbound NAT rule port mapping request. // - options - LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings // method. @@ -397,8 +381,7 @@ func (client *LoadBalancersClient) BeginListInboundNatRulePortMappings(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientListInboundNatRulePortMappingsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -410,8 +393,6 @@ func (client *LoadBalancersClient) BeginListInboundNatRulePortMappings(ctx conte // ListInboundNatRulePortMappings - List of inbound NAT rule port mappings. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancersClient) listInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginListInboundNatRulePortMappings" @@ -436,6 +417,10 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappings(ctx context.Co // listInboundNatRulePortMappingsCreateRequest creates the ListInboundNatRulePortMappings request. func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, _ *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -448,18 +433,15 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c return nil, errors.New("parameter backendPoolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backendPoolName}", url.PathEscape(backendPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -468,9 +450,6 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c // MigrateToIPBased - Migrate load balancer to IP Based // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientMigrateToIPBasedOptions contains the optional parameters for the LoadBalancersClient.MigrateToIPBased // method. @@ -499,6 +478,10 @@ func (client *LoadBalancersClient) MigrateToIPBased(ctx context.Context, groupNa // migrateToIPBasedCreateRequest creates the MigrateToIPBased request. func (client *LoadBalancersClient) migrateToIPBasedCreateRequest(ctx context.Context, groupName string, loadBalancerName string, options *LoadBalancersClientMigrateToIPBasedOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/migrateToIpBased" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -507,19 +490,16 @@ func (client *LoadBalancersClient) migrateToIPBasedCreateRequest(ctx context.Con return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -539,10 +519,7 @@ func (client *LoadBalancersClient) migrateToIPBasedHandleResponse(resp *http.Res // BeginSwapPublicIPAddresses - Swaps VIPs between two load balancers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The region where load balancers are located at. -// - parameters - Parameters that define which VIPs should be swapped. +// - location - The name of the Azure region. // - options - LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses // method. func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*runtime.Poller[LoadBalancersClientSwapPublicIPAddressesResponse], error) { @@ -552,8 +529,7 @@ func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientSwapPublicIPAddressesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -565,8 +541,6 @@ func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Contex // SwapPublicIPAddresses - Swaps VIPs between two load balancers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginSwapPublicIPAddresses" @@ -591,22 +565,22 @@ func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, lo // swapPublicIPAddressesCreateRequest creates the SwapPublicIPAddresses request. func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, _ *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -615,9 +589,7 @@ func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx contex // UpdateTags - Updates a load balancer tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to update load balancer tags. // - options - LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags @@ -647,6 +619,10 @@ func (client *LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroup // updateTagsCreateRequest creates the UpdateTags request. func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject, _ *LoadBalancersClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -655,18 +631,15 @@ func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, return nil, errors.New("parameter loadBalancerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go index 629c648990a7..c85cde3ca178 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go @@ -1,351 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerDelete.json -func ExampleLoadBalancersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginDelete(ctx, "rg1", "lb", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerGet.json -func ExampleLoadBalancersClient_Get_getLoadBalancer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", &armnetwork.LoadBalancersClientGetOptions{Expand: 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // Scope: to.Ptr(armnetwork.LoadBalancerScopePublic), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerGetInboundNatRulePortMapping.json -func ExampleLoadBalancersClient_Get_getLoadBalancerWithInboundNatRulePortMapping() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", &armnetwork.LoadBalancersClientGetOptions{Expand: 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("8bec96ef-0a6a-45b8-9860-4ffde7bf3572"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // InboundNatRulesPortMapping: []*armnetwork.NatRulePortMapping{ - // { - // BackendPort: to.Ptr[int32](3389), - // FrontendPort: to.Ptr[int32](3389), - // InboundNatRuleName: to.Ptr("natRule"), - // }}, - // IPAddress: to.Ptr("10.0.0.4"), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](0), - // FrontendPortRangeEnd: to.Ptr[int32](4000), - // FrontendPortRangeStart: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreate.json +// Generated from example definition: 2025-07-01/LoadBalancerCreate.json func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -356,16 +30,18 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { { Name: to.Ptr("be-lb"), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, InboundNatRules: []*armnetwork.InboundNatRule{ { @@ -375,35 +51,37 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { EnableFloatingIP: to.Ptr(true), EnableTCPReset: to.Ptr(false), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](3389), IdleTimeoutInMinutes: to.Ptr[int32](15), Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { Name: to.Ptr("rulelb"), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, BackendPort: to.Ptr[int32](80), EnableFloatingIP: to.Ptr(true), EnableTCPReset: to.Ptr(false), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](80), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, Probes: []*armnetwork.Probe{ { Name: to.Ptr("probe-lb"), @@ -415,7 +93,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, Scope: to.Ptr(armnetwork.LoadBalancerScopePublic), }, }, nil) @@ -424,142 +103,153 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableConnectionTracking: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableConnectionTracking: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // Scope: to.Ptr(armnetwork.LoadBalancerScopePublic), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // Scope: to.Ptr(armnetwork.LoadBalancerScopePublic), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateWithZones.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFrontendIpInZone1() { +// Generated from example definition: 2025-07-01/LoadBalancerCreateGatewayLoadBalancerConsumer.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerConsumerConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -570,18 +260,21 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFronte { Name: to.Ptr("be-lb"), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + GatewayLoadBalancer: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), + }, Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - Zones: []*string{ - to.Ptr("1")}, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, InboundNatRules: []*armnetwork.InboundNatRule{ { @@ -590,34 +283,36 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFronte BackendPort: to.Ptr[int32](3389), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](3389), IdleTimeoutInMinutes: to.Ptr[int32](15), Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { Name: to.Ptr("rulelb"), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, BackendPort: to.Ptr[int32](80), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](80), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, OutboundRules: []*armnetwork.OutboundRule{}, Probes: []*armnetwork.Probe{ { @@ -630,7 +325,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFronte RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), @@ -641,117 +337,127 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFronte } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // GatewayLoadBalancer: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), + // }, + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, + // }, // InboundNatPools: []*armnetwork.InboundNatPool{ // }, // InboundNatRules: []*armnetwork.InboundNatRule{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), // Name: to.Ptr("in-nat-rule"), // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), // Properties: &armnetwork.InboundNatRulePropertiesFormat{ // BackendPort: to.Ptr[int32](3389), // EnableFloatingIP: to.Ptr(true), // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), // }, // FrontendPort: to.Ptr[int32](3389), // IdleTimeoutInMinutes: to.Ptr[int32](15), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, + // }, + // }, // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), // Name: to.Ptr("rulelb"), // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), // }, // BackendPort: to.Ptr[int32](80), // DisableOutboundSnat: to.Ptr(false), // EnableFloatingIP: to.Ptr(true), // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), // }, // FrontendPort: to.Ptr[int32](80), // IdleTimeoutInMinutes: to.Ptr[int32](15), // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, + // }, + // }, // OutboundRules: []*armnetwork.OutboundRule{ // }, // Probes: []*armnetwork.Probe{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), // Name: to.Ptr("probe-lb"), // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), // Properties: &armnetwork.ProbePropertiesFormat{ // IntervalInSeconds: to.Ptr[int32](15), // LoadBalancingRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, // NumberOfProbes: to.Ptr[int32](2), // Port: to.Ptr[int32](80), // ProbeThreshold: to.Ptr[int32](1), @@ -759,243 +465,26 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFronte // RequestPath: to.Ptr("healthcheck.aspx"), // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, // SKU: &armnetwork.LoadBalancerSKU{ // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerConsumerConfigured() { +// Generated from example definition: 2025-07-01/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - GatewayLoadBalancer: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // GatewayLoadBalancer: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - // }, - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1018,18 +507,21 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa Identifier: to.Ptr[int32](901), Port: to.Ptr[int32](15001), Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - }}, + }, + }, }, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { @@ -1037,22 +529,24 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPools: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + }, + }, BackendPort: to.Ptr[int32](0), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](0), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolAll), }, - }}, + }, + }, OutboundRules: []*armnetwork.OutboundRule{}, Probes: []*armnetwork.Probe{ { @@ -1065,7 +559,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), @@ -1076,136 +571,148 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](900), - // Port: to.Ptr[int32](15000), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }, - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](901), - // Port: to.Ptr[int32](15001), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ + // { + // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), + // Identifier: to.Ptr[int32](900), + // Port: to.Ptr[int32](15000), + // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), + // }, + // { + // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), + // Identifier: to.Ptr[int32](901), + // Port: to.Ptr[int32](15001), + // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), + // }, + // }, + // }, // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }}, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPools: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json +// Generated from example definition: 2025-07-01/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1220,16 +727,18 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa { Name: to.Ptr("be-lb2"), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { @@ -1238,25 +747,27 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa BackendAddressPool: &armnetwork.SubResource{}, BackendAddressPools: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), + }, + }, BackendPort: to.Ptr[int32](0), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](0), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolAll), }, - }}, + }, + }, OutboundRules: []*armnetwork.OutboundRule{}, Probes: []*armnetwork.Probe{ { @@ -1269,7 +780,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), @@ -1280,154 +792,168 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewa } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), - // Name: to.Ptr("be-lb1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](900), - // Port: to.Ptr[int32](15000), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - // Name: to.Ptr("be-lb2"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](901), - // Port: to.Ptr[int32](15001), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ + // { + // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), + // Identifier: to.Ptr[int32](900), + // Port: to.Ptr[int32](15000), + // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), + // }, + // }, // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - // }}, - // BackendPort: to.Ptr[int32](0), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](0), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // { + // Name: to.Ptr("be-lb2"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ + // { + // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), + // Identifier: to.Ptr[int32](901), + // Port: to.Ptr[int32](15001), + // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), + // }, + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateGlobalTier.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPools: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), + // }, + // }, + // BackendPort: to.Ptr[int32](0), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](0), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerCreateGlobalTier.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ @@ -1442,42 +968,46 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobal Name: to.Ptr("regional-lb1-address"), Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), }, }, - }}, + }, + }, }, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { Name: to.Ptr("rulelb"), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, BackendPort: to.Ptr[int32](80), EnableFloatingIP: to.Ptr(false), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](80), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, Probes: []*armnetwork.Probe{ { Name: to.Ptr("probe-lb"), @@ -1489,7 +1019,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobal RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), @@ -1501,128 +1032,139 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobal } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("regional-lb1-address"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + // { + // Name: to.Ptr("regional-lb1-address"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), + // }, // }, // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateStandardSku.json +// Generated from example definition: 2025-07-01/LoadBalancerCreateStandardSku.json func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStandardSku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1633,16 +1175,18 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStanda { Name: to.Ptr("be-lb"), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, InboundNatRules: []*armnetwork.InboundNatRule{ { @@ -1651,34 +1195,36 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStanda BackendPort: to.Ptr[int32](3389), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](3389), IdleTimeoutInMinutes: to.Ptr[int32](15), Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { Name: to.Ptr("rulelb"), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, BackendPort: to.Ptr[int32](80), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](80), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, OutboundRules: []*armnetwork.OutboundRule{}, Probes: []*armnetwork.Probe{ { @@ -1691,7 +1237,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStanda RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), @@ -1702,363 +1249,152 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStanda } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableConnectionTracking: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableConnectionTracking: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithSyncModePropertyOnPool() { +// Generated from example definition: 2025-07-01/LoadBalancerCreateWithInboundNatPool.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboundNatPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateWithInboundNatPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboundNatPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2068,33 +1404,35 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboun BackendAddressPools: []*armnetwork.BackendAddressPool{}, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), Name: to.Ptr("test"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), }, }, Zones: []*string{}, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), Name: to.Ptr("test"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), Properties: &armnetwork.InboundNatPoolPropertiesFormat{ BackendPort: to.Ptr[int32](8888), EnableFloatingIP: to.Ptr(true), EnableTCPReset: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), }, FrontendPortRangeEnd: to.Ptr[int32](8085), FrontendPortRangeStart: to.Ptr[int32](8080), IdleTimeoutInMinutes: to.Ptr[int32](10), Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, InboundNatRules: []*armnetwork.InboundNatRule{}, LoadBalancingRules: []*armnetwork.LoadBalancingRule{}, OutboundRules: []*armnetwork.OutboundRule{}, @@ -2109,84 +1447,89 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboun } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("test"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatPools: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), + // }, // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatPoolPropertiesFormat{ - // BackendPort: to.Ptr[int32](8888), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // { + // Name: to.Ptr("test"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), + // Properties: &armnetwork.InboundNatPoolPropertiesFormat{ + // BackendPort: to.Ptr[int32](8888), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), + // }, + // FrontendPortRangeEnd: to.Ptr[int32](8085), + // FrontendPortRangeStart: to.Ptr[int32](8080), + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPortRangeEnd: to.Ptr[int32](8085), - // FrontendPortRangeStart: to.Ptr[int32](8080), - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // }, - // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // Probes: []*armnetwork.Probe{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerCreateWithOutboundRules.json +// Generated from example definition: 2025-07-01/LoadBalancerCreateWithOutboundRules.json func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutboundRules() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -2197,16 +1540,18 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutbou { Name: to.Ptr("be-lb"), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, + }, + }, FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { Name: to.Ptr("fe-lb"), Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), }, }, - }}, + }, + }, InboundNatPools: []*armnetwork.InboundNatPool{}, InboundNatRules: []*armnetwork.InboundNatRule{ { @@ -2215,49 +1560,53 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutbou BackendPort: to.Ptr[int32](3389), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](3389), IdleTimeoutInMinutes: to.Ptr[int32](15), Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, LoadBalancingRules: []*armnetwork.LoadBalancingRule{ { Name: to.Ptr("rulelb"), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, BackendPort: to.Ptr[int32](80), DisableOutboundSnat: to.Ptr(true), EnableFloatingIP: to.Ptr(true), FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), }, FrontendPort: to.Ptr[int32](80), IdleTimeoutInMinutes: to.Ptr[int32](15), LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), }, Protocol: to.Ptr(armnetwork.TransportProtocolTCP), }, - }}, + }, + }, OutboundRules: []*armnetwork.OutboundRule{ { Name: to.Ptr("rule1"), Properties: &armnetwork.OutboundRulePropertiesFormat{ BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }, FrontendIPConfigurations: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + }, Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), }, - }}, + }, + }, Probes: []*armnetwork.Probe{ { Name: to.Ptr("probe-lb"), @@ -2269,7 +1618,8 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutbou RequestPath: to.Ptr("healthcheck.aspx"), Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), }, - }}, + }, + }, }, SKU: &armnetwork.LoadBalancerSKU{ Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), @@ -2280,306 +1630,1060 @@ func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutbou } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // OutboundRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // OutboundRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // OutboundRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // }}, - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // OutboundRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.PublicIPAddress{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), + // }, // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(true), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(true), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // { + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), + // Properties: &armnetwork.OutboundRulePropertiesFormat{ + // AllocatedOutboundPorts: to.Ptr[int32](1024), + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // EnableTCPReset: to.Ptr(false), + // FrontendIPConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerCreateWithSyncModePropertyOnPool.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithSyncModePropertyOnPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.LoadBalancerPropertiesFormat{ + BackendAddressPools: []*armnetwork.BackendAddressPool{ + { + Name: to.Ptr("be-lb"), + Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), + VirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + }, + }, + }, + }, + FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + { + Name: to.Ptr("fe-lb"), + Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + }, + }, + }, + }, + InboundNatPools: []*armnetwork.InboundNatPool{}, + InboundNatRules: []*armnetwork.InboundNatRule{ + { + Name: to.Ptr("in-nat-rule"), + Properties: &armnetwork.InboundNatRulePropertiesFormat{ + BackendPort: to.Ptr[int32](3389), + EnableFloatingIP: to.Ptr(true), + FrontendIPConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + FrontendPort: to.Ptr[int32](3389), + IdleTimeoutInMinutes: to.Ptr[int32](15), + Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + }, + }, + }, + LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + { + Name: to.Ptr("rulelb"), + Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + BackendAddressPool: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + }, + BackendPort: to.Ptr[int32](80), + EnableFloatingIP: to.Ptr(true), + FrontendIPConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + FrontendPort: to.Ptr[int32](80), + IdleTimeoutInMinutes: to.Ptr[int32](15), + LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + Probe: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + }, + Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + }, + }, + }, + OutboundRules: []*armnetwork.OutboundRule{}, + Probes: []*armnetwork.Probe{ + { + Name: to.Ptr("probe-lb"), + Properties: &armnetwork.ProbePropertiesFormat{ + IntervalInSeconds: to.Ptr[int32](15), + NumberOfProbes: to.Ptr[int32](2), + Port: to.Ptr[int32](80), + ProbeThreshold: to.Ptr[int32](1), + RequestPath: to.Ptr("healthcheck.aspx"), + Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + }, + }, + }, + }, + SKU: &armnetwork.LoadBalancerSKU{ + Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + }, + }, 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 poll 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 = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), + // VirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), + // }, + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerCreateWithZones.json +func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFrontendIPInZone1() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.LoadBalancerPropertiesFormat{ + BackendAddressPools: []*armnetwork.BackendAddressPool{ + { + Name: to.Ptr("be-lb"), + Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, + }, + }, + FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + { + Name: to.Ptr("fe-lb"), + Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + }, + }, + Zones: []*string{ + to.Ptr("1"), + }, + }, + }, + InboundNatPools: []*armnetwork.InboundNatPool{}, + InboundNatRules: []*armnetwork.InboundNatRule{ + { + Name: to.Ptr("in-nat-rule"), + Properties: &armnetwork.InboundNatRulePropertiesFormat{ + BackendPort: to.Ptr[int32](3389), + EnableFloatingIP: to.Ptr(true), + FrontendIPConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + FrontendPort: to.Ptr[int32](3389), + IdleTimeoutInMinutes: to.Ptr[int32](15), + Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + }, + }, + }, + LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + { + Name: to.Ptr("rulelb"), + Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + BackendAddressPool: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + }, + BackendPort: to.Ptr[int32](80), + EnableFloatingIP: to.Ptr(true), + FrontendIPConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + FrontendPort: to.Ptr[int32](80), + IdleTimeoutInMinutes: to.Ptr[int32](15), + LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + Probe: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + }, + Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + }, + }, + }, + OutboundRules: []*armnetwork.OutboundRule{}, + Probes: []*armnetwork.Probe{ + { + Name: to.Ptr("probe-lb"), + Properties: &armnetwork.ProbePropertiesFormat{ + IntervalInSeconds: to.Ptr[int32](15), + NumberOfProbes: to.Ptr[int32](2), + Port: to.Ptr[int32](80), + ProbeThreshold: to.Ptr[int32](1), + RequestPath: to.Ptr("healthcheck.aspx"), + Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + }, + }, + }, + }, + SKU: &armnetwork.LoadBalancerSKU{ + Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + }, + }, 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 poll 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 = armnetwork.LoadBalancersClientCreateOrUpdateResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // Zones: []*string{ + // to.Ptr("1"), + // }, + // }, + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerDelete.json +func ExampleLoadBalancersClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewLoadBalancersClient().BeginDelete(ctx, "rg1", "lb", 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 poll 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 = armnetwork.LoadBalancersClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerGet.json +func ExampleLoadBalancersClient_Get_getLoadBalancer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", 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 = armnetwork.LoadBalancersClientGetResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // Scope: to.Ptr(armnetwork.LoadBalancerScopePublic), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancerGetInboundNatRulePortMapping.json +func ExampleLoadBalancersClient_Get_getLoadBalancerWithInboundNatRulePortMapping() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", 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 = armnetwork.LoadBalancersClientGetResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ + // { + // Name: to.Ptr("8bec96ef-0a6a-45b8-9860-4ffde7bf3572"), + // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ + // InboundNatRulesPortMapping: []*armnetwork.NatRulePortMapping{ + // { + // BackendPort: to.Ptr[int32](3389), + // FrontendPort: to.Ptr[int32](3389), + // InboundNatRuleName: to.Ptr("natRule"), + // }, + // }, + // IPAddress: to.Ptr("10.0.0.4"), + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](0), + // FrontendPortRangeEnd: to.Ptr[int32](4000), + // FrontendPortRangeStart: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](1024), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerUpdateTags.json -func ExampleLoadBalancersClient_UpdateTags() { +// Generated from example definition: 2025-07-01/LoadBalancerGetReduced.json +func ExampleLoadBalancersClient_Get_getLoadBalancerReduced() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewLoadBalancersClient().UpdateTags(ctx, "rg1", "lb", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg-name", "lb-name", &armnetwork.LoadBalancersClientGetOptions{ + DetailLevel: to.Ptr(armnetwork.LoadBalancerDetailLevelReduced)}) 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.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // res = armnetwork.LoadBalancersClientGetResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-name/providers/Microsoft.Network/loadBalancers/lb-name"), + // Name: to.Ptr("lb-name"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("frontendConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-name/providers/Microsoft.Network/loadBalancers/lb-name/frontendIPConfigurations/frontendConfig1"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), + // Tier: to.Ptr(armnetwork.LoadBalancerSKUTierRegional), // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerListAll.json -func ExampleLoadBalancersClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/LoadBalancerList.json +func ExampleLoadBalancersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLoadBalancersClient().NewListAllPager(nil) + pager := clientFactory.NewLoadBalancersClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -2590,169 +2694,181 @@ func ExampleLoadBalancersClient_NewListAllPager() { _ = 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.LoadBalancerListResult = armnetwork.LoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // Name: to.Ptr("belb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // Name: to.Ptr("felb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // page = armnetwork.LoadBalancersClientListResponse{ + // LoadBalancerListResult: armnetwork.LoadBalancerListResult{ + // Value: []*armnetwork.LoadBalancer{ + // { + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("belb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // Name: to.Ptr("inrlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("felb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("inrlb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), + // }, + // BackendPort: to.Ptr[int32](80), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("prlb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }, - // { - // Name: to.Ptr("lb3"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb3"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // InboundNatPools: []*armnetwork.InboundNatPool{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // }, + // { + // Name: to.Ptr("lb2"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // }, + // Probes: []*armnetwork.Probe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // Probes: []*armnetwork.Probe{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancerList.json -func ExampleLoadBalancersClient_NewListPager() { +// Generated from example definition: 2025-07-01/LoadBalancerListAll.json +func ExampleLoadBalancersClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewLoadBalancersClient().NewListPager("rg1", nil) + pager := clientFactory.NewLoadBalancersClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -2763,257 +2879,426 @@ func ExampleLoadBalancersClient_NewListPager() { _ = 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.LoadBalancerListResult = armnetwork.LoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // Name: to.Ptr("belb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // Name: to.Ptr("felb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // page = armnetwork.LoadBalancersClientListAllResponse{ + // LoadBalancerListResult: armnetwork.LoadBalancerListResult{ + // Value: []*armnetwork.LoadBalancer{ + // { + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("belb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // Name: to.Ptr("inrlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("felb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("inrlb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), + // }, + // BackendPort: to.Ptr[int32](80), + // EnableFloatingIP: to.Ptr(true), + // EnableTCPReset: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("prlb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }, - // { - // Name: to.Ptr("lb2"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), // }, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // }, + // { + // Name: to.Ptr("lb3"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // }, + // Probes: []*armnetwork.Probe{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // Probes: []*armnetwork.Probe{ + // SKU: &armnetwork.LoadBalancerSKU{ + // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LoadBalancersSwapPublicIpAddresses.json -func ExampleLoadBalancersClient_BeginSwapPublicIPAddresses() { +// Generated from example definition: 2025-07-01/QueryInboundNatRulePortMapping.json +func ExampleLoadBalancersClient_BeginListInboundNatRulePortMappings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewLoadBalancersClient().BeginSwapPublicIPAddresses(ctx, "westus", armnetwork.LoadBalancerVipSwapRequest{ - FrontendIPConfigurations: []*armnetwork.LoadBalancerVipSwapRequestFrontendIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1"), - Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2"), - }, - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2"), - Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1"), - }, - }, - }}, + poller, err := clientFactory.NewLoadBalancersClient().BeginListInboundNatRulePortMappings(ctx, "rg1", "lb1", "bp1", armnetwork.QueryInboundNatRulePortMappingRequest{ + IPAddress: to.Ptr("10.0.0.4"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.LoadBalancersClientListInboundNatRulePortMappingsResponse{ + // BackendAddressInboundNatRulePortMappings: armnetwork.BackendAddressInboundNatRulePortMappings{ + // InboundNatRulePortMappings: []*armnetwork.InboundNatRulePortMapping{ + // { + // BackendPort: to.Ptr[int32](3389), + // FrontendPort: to.Ptr[int32](3389), + // InboundNatRuleName: to.Ptr("natRule"), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/QueryInboundNatRulePortMapping.json -func ExampleLoadBalancersClient_BeginListInboundNatRulePortMappings() { +// Generated from example definition: 2025-07-01/MigrateLoadBalancerToIPBased.json +func ExampleLoadBalancersClient_MigrateToIPBased() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewLoadBalancersClient().BeginListInboundNatRulePortMappings(ctx, "rg1", "lb1", "bp1", armnetwork.QueryInboundNatRulePortMappingRequest{ - IPAddress: to.Ptr("10.0.0.4"), + res, err := clientFactory.NewLoadBalancersClient().MigrateToIPBased(ctx, "rg1", "lb1", &armnetwork.LoadBalancersClientMigrateToIPBasedOptions{ + Parameters: &armnetwork.MigrateLoadBalancerToIPBasedRequest{ + Pools: []*string{ + to.Ptr("pool1"), + to.Ptr("pool2"), + }, + }}) + 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 = armnetwork.LoadBalancersClientMigrateToIPBasedResponse{ + // MigratedPools: armnetwork.MigratedPools{ + // MigratedPools: []*string{ + // to.Ptr("pool1"), + // to.Ptr("pool2"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/LoadBalancersSwapPublicIpAddresses.json +func ExampleLoadBalancersClient_BeginSwapPublicIPAddresses() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewLoadBalancersClient().BeginSwapPublicIPAddresses(ctx, "westus", armnetwork.LoadBalancerVipSwapRequest{ + FrontendIPConfigurations: []*armnetwork.LoadBalancerVipSwapRequestFrontendIPConfiguration{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1"), + Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2"), + }, + }, + }, + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2"), + Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ + PublicIPAddress: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1"), + }, + }, + }, + }, }, 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) + log.Fatalf("failed to poll 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.BackendAddressInboundNatRulePortMappings = armnetwork.BackendAddressInboundNatRulePortMappings{ - // InboundNatRulePortMappings: []*armnetwork.InboundNatRulePortMapping{ - // { - // BackendPort: to.Ptr[int32](3389), - // FrontendPort: to.Ptr[int32](3389), - // InboundNatRuleName: to.Ptr("natRule"), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }}, + // res = armnetwork.LoadBalancersClientSwapPublicIPAddressesResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/MigrateLoadBalancerToIPBased.json -func ExampleLoadBalancersClient_MigrateToIPBased() { +// Generated from example definition: 2025-07-01/LoadBalancerUpdateTags.json +func ExampleLoadBalancersClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewLoadBalancersClient().MigrateToIPBased(ctx, "rg1", "lb1", &armnetwork.LoadBalancersClientMigrateToIPBasedOptions{Parameters: &armnetwork.MigrateLoadBalancerToIPBasedRequest{ - Pools: []*string{ - to.Ptr("pool1"), - to.Ptr("pool2")}, - }, - }) + res, err := clientFactory.NewLoadBalancersClient().UpdateTags(ctx, "rg1", "lb", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigratedPools = armnetwork.MigratedPools{ - // MigratedPools: []*string{ - // to.Ptr("pool1"), - // to.Ptr("pool2")}, - // } + // res = armnetwork.LoadBalancersClientUpdateTagsResponse{ + // LoadBalancer: armnetwork.LoadBalancer{ + // Name: to.Ptr("lb"), + // Type: to.Ptr("Microsoft.Network/loadBalancers"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LoadBalancerPropertiesFormat{ + // BackendAddressPools: []*armnetwork.BackendAddressPool{ + // { + // Name: to.Ptr("be-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // Name: to.Ptr("fe-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ + // InboundNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // }, + // }, + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // InboundNatPools: []*armnetwork.InboundNatPool{ + // }, + // InboundNatRules: []*armnetwork.InboundNatRule{ + // { + // Name: to.Ptr("in-nat-rule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), + // Properties: &armnetwork.InboundNatRulePropertiesFormat{ + // BackendPort: to.Ptr[int32](3389), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](3389), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ + // { + // Name: to.Ptr("rulelb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ + // BackendAddressPool: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), + // }, + // BackendPort: to.Ptr[int32](80), + // DisableOutboundSnat: to.Ptr(false), + // EnableFloatingIP: to.Ptr(true), + // FrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // FrontendPort: to.Ptr[int32](80), + // IdleTimeoutInMinutes: to.Ptr[int32](15), + // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), + // Probe: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), + // }, + // }, + // }, + // OutboundRules: []*armnetwork.OutboundRule{ + // }, + // Probes: []*armnetwork.Probe{ + // { + // Name: to.Ptr("probe-lb"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), + // Properties: &armnetwork.ProbePropertiesFormat{ + // IntervalInSeconds: to.Ptr[int32](15), + // LoadBalancingRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), + // }, + // }, + // NumberOfProbes: to.Ptr[int32](2), + // Port: to.Ptr[int32](80), + // ProbeThreshold: to.Ptr[int32](1), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RequestPath: to.Ptr("healthcheck.aspx"), + // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go index 66887e9c15a2..fc29f2986d62 100644 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // LocalNetworkGatewaysClient contains the methods for the LocalNetworkGateways group. // Don't use this type directly, use NewLocalNetworkGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type LocalNetworkGatewaysClient struct { internal *arm.Client subscriptionID string } // NewLocalNetworkGatewaysClient creates a new instance of LocalNetworkGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewLocalNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalNetworkGatewaysClient, error) { @@ -43,9 +43,7 @@ func NewLocalNetworkGatewaysClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a local network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to the create or update local network gateway operation. // - options - LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *LocalNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalNetworkGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *LocalNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a local network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LocalNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *LocalNetworkGatewaysClient) createOrUpdate(ctx context.Context, re // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, _ *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, errors.New("parameter localNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified local network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *LocalNetworkGatewaysClient) BeginDelete(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalNetworkGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *LocalNetworkGatewaysClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified local network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, r // deleteCreateRequest creates the Delete request. func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, _ *LocalNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, errors.New("parameter localNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified local network gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get // method. @@ -232,6 +220,10 @@ func (client *LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, _ *LocalNetworkGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +232,13 @@ func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter localNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,9 +253,7 @@ func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) } // NewListPager - Gets all the local network gateways in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager // method. func (client *LocalNetworkGatewaysClient) NewListPager(resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) *runtime.Pager[LocalNetworkGatewaysClientListResponse] { @@ -296,21 +282,21 @@ func (client *LocalNetworkGatewaysClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *LocalNetworkGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -326,9 +312,7 @@ func (client *LocalNetworkGatewaysClient) listHandleResponse(resp *http.Response // UpdateTags - Updates a local network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to update local network gateway tags. // - options - LocalNetworkGatewaysClientUpdateTagsOptions contains the optional parameters for the LocalNetworkGatewaysClient.UpdateTags @@ -358,6 +342,10 @@ func (client *LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resour // updateTagsCreateRequest creates the UpdateTags request. func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject, _ *LocalNetworkGatewaysClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -366,18 +354,15 @@ func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, errors.New("parameter localNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go index 4d634bbc072e..e178f7757a66 100644 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LocalNetworkGatewayCreate.json +// Generated from example definition: 2025-07-01/LocalNetworkGatewayCreate.json func ExampleLocalNetworkGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -33,7 +30,8 @@ func ExampleLocalNetworkGatewaysClient_BeginCreateOrUpdate() { GatewayIPAddress: to.Ptr("11.12.13.14"), LocalNetworkAddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.1.0.0/16")}, + to.Ptr("10.1.0.0/16"), + }, }, }, }, nil) @@ -42,73 +40,40 @@ func ExampleLocalNetworkGatewaysClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("localgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("11.12.13.14"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, + // res = armnetwork.LocalNetworkGatewaysClientCreateOrUpdateResponse{ + // LocalNetworkGateway: armnetwork.LocalNetworkGateway{ + // Name: to.Ptr("localgw"), + // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // GatewayIPAddress: to.Ptr("11.12.13.14"), + // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.1.0.0/16"), + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LocalNetworkGatewayGet.json -func ExampleLocalNetworkGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalNetworkGatewaysClient().Get(ctx, "rg1", "localgw", 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.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("localgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LocalNetworkGatewayDelete.json +// Generated from example definition: 2025-07-01/LocalNetworkGatewayDelete.json func ExampleLocalNetworkGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -116,64 +81,64 @@ func ExampleLocalNetworkGatewaysClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.LocalNetworkGatewaysClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LocalNetworkGatewayUpdateTags.json -func ExampleLocalNetworkGatewaysClient_UpdateTags() { +// Generated from example definition: 2025-07-01/LocalNetworkGatewayGet.json +func ExampleLocalNetworkGatewaysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewLocalNetworkGatewaysClient().UpdateTags(ctx, "rg1", "lgw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewLocalNetworkGatewaysClient().Get(ctx, "rg1", "localgw", 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.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("lgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("12.0.0.1"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.LocalNetworkGatewaysClientGetResponse{ + // LocalNetworkGateway: armnetwork.LocalNetworkGateway{ + // Name: to.Ptr("localgw"), + // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // GatewayIPAddress: to.Ptr("x.x.x.x"), + // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.1.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/LocalNetworkGatewayList.json +// Generated from example definition: 2025-07-01/LocalNetworkGatewayList.json func ExampleLocalNetworkGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -188,19 +153,21 @@ func ExampleLocalNetworkGatewaysClient_NewListPager() { _ = 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.LocalNetworkGatewayListResult = armnetwork.LocalNetworkGatewayListResult{ - // Value: []*armnetwork.LocalNetworkGateway{ - // { - // Name: to.Ptr("localgw1"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, + // page = armnetwork.LocalNetworkGatewaysClientListResponse{ + // LocalNetworkGatewayListResult: armnetwork.LocalNetworkGatewayListResult{ + // Value: []*armnetwork.LocalNetworkGateway{ + // { + // Name: to.Ptr("localgw1"), + // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // GatewayIPAddress: to.Ptr("x.x.x.x"), + // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.1.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), @@ -209,19 +176,69 @@ func ExampleLocalNetworkGatewaysClient_NewListPager() { // { // Name: to.Ptr("localgw2"), // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), - // Location: to.Ptr("eastus"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), + // Location: to.Ptr("eastus"), // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ // GatewayIPAddress: to.Ptr("x.x.x.x"), // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("10.2.0.0/16")}, + // to.Ptr("10.2.0.0/16"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // }}, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/LocalNetworkGatewayUpdateTags.json +func ExampleLocalNetworkGatewaysClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + res, err := clientFactory.NewLocalNetworkGatewaysClient().UpdateTags(ctx, "rg1", "lgw", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.LocalNetworkGatewaysClientUpdateTagsResponse{ + // LocalNetworkGateway: armnetwork.LocalNetworkGateway{ + // Name: to.Ptr("lgw"), + // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // GatewayIPAddress: to.Ptr("12.0.0.1"), + // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/management_client.go b/sdk/resourcemanager/network/armnetwork/management_client.go index 653692ac11d3..dd73d5c1f415 100644 --- a/sdk/resourcemanager/network/armnetwork/management_client.go +++ b/sdk/resourcemanager/network/armnetwork/management_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// ManagementClient contains the methods for the NetworkManagementClient group. +// ManagementClient contains the methods for the Management group. // Don't use this type directly, use NewManagementClient() instead. +// +// Generated from API version 2025-07-01 type ManagementClient struct { internal *arm.Client subscriptionID string } // NewManagementClient creates a new instance of ManagementClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) { @@ -44,9 +44,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // CheckDNSNameAvailability - Checks whether a domain name in the cloudapp.azure.com zone is available for use. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The location of the domain name. +// - location - The location name. // - domainNameLabel - The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. // - options - ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability // method. @@ -74,23 +72,23 @@ func (client *ManagementClient) CheckDNSNameAvailability(ctx context.Context, lo // checkDNSNameAvailabilityCreateRequest creates the CheckDNSNameAvailability request. func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx context.Context, location string, domainNameLabel string, _ *ManagementClientCheckDNSNameAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkDnsNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("domainNameLabel", domainNameLabel) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -106,9 +104,7 @@ func (client *ManagementClient) checkDNSNameAvailabilityHandleResponse(resp *htt // BeginDeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. // - options - ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink @@ -120,8 +116,7 @@ func (client *ManagementClient) BeginDeleteBastionShareableLink(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagementClientDeleteBastionShareableLinkResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -133,8 +128,6 @@ func (client *ManagementClient) BeginDeleteBastionShareableLink(ctx context.Cont // DeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagementClient) deleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginDeleteBastionShareableLink" @@ -159,6 +152,10 @@ func (client *ManagementClient) deleteBastionShareableLink(ctx context.Context, // deleteBastionShareableLinkCreateRequest creates the DeleteBastionShareableLink request. func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, _ *ManagementClientBeginDeleteBastionShareableLinkOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -167,18 +164,14 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { return nil, err } @@ -187,9 +180,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont // BeginDeleteBastionShareableLinkByToken - Deletes the Bastion Shareable Links for all the tokens specified in the request. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - bslTokenRequest - Post request for Delete Bastion Shareable Link By Token endpoint. // - options - ManagementClientBeginDeleteBastionShareableLinkByTokenOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLinkByToken @@ -201,8 +192,7 @@ func (client *ManagementClient) BeginDeleteBastionShareableLinkByToken(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagementClientDeleteBastionShareableLinkByTokenResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -214,8 +204,6 @@ func (client *ManagementClient) BeginDeleteBastionShareableLinkByToken(ctx conte // DeleteBastionShareableLinkByToken - Deletes the Bastion Shareable Links for all the tokens specified in the request. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagementClient) deleteBastionShareableLinkByToken(ctx context.Context, resourceGroupName string, bastionHostName string, bslTokenRequest BastionShareableLinkTokenListRequest, options *ManagementClientBeginDeleteBastionShareableLinkByTokenOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginDeleteBastionShareableLinkByToken" @@ -240,6 +228,10 @@ func (client *ManagementClient) deleteBastionShareableLinkByToken(ctx context.Co // deleteBastionShareableLinkByTokenCreateRequest creates the DeleteBastionShareableLinkByToken request. func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslTokenRequest BastionShareableLinkTokenListRequest, _ *ManagementClientBeginDeleteBastionShareableLinkByTokenOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinksByToken" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -248,18 +240,14 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslTokenRequest); err != nil { return nil, err } @@ -267,9 +255,7 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c } // NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - sessionIDs - The list of sessionids to disconnect. // - options - ManagementClientDisconnectActiveSessionsOptions contains the optional parameters for the ManagementClient.NewDisconnectActiveSessionsPager @@ -300,6 +286,10 @@ func (client *ManagementClient) NewDisconnectActiveSessionsPager(resourceGroupNa // disconnectActiveSessionsCreateRequest creates the DisconnectActiveSessions request. func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, _ *ManagementClientDisconnectActiveSessionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -308,18 +298,15 @@ func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx contex return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sessionIDs); err != nil { return nil, err } @@ -337,8 +324,6 @@ func (client *ManagementClient) disconnectActiveSessionsHandleResponse(resp *htt // ExpressRouteProviderPort - Retrieves detail of a provider port. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - providerport - The name of the provider port. // - options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort // method. @@ -367,21 +352,21 @@ func (client *ManagementClient) ExpressRouteProviderPort(ctx context.Context, pr // expressRouteProviderPortCreateRequest creates the ExpressRouteProviderPort request. func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx context.Context, providerport string, _ *ManagementClientExpressRouteProviderPortOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}" - if providerport == "" { - return nil, errors.New("parameter providerport cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{providerport}", url.PathEscape(providerport)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if providerport == "" { + return nil, errors.New("parameter providerport cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerport}", url.PathEscape(providerport)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -398,10 +383,8 @@ func (client *ManagementClient) expressRouteProviderPortHandleResponse(resp *htt // BeginGeneratevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan // and associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name. -// - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN. // - vpnClientParams - Parameters supplied to the generate VirtualWan VPN profile generation operation. // - options - ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters // for the ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. @@ -412,8 +395,7 @@ func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpn return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -426,8 +408,6 @@ func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpn // Generatevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan and // associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile" @@ -451,7 +431,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi // generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest creates the Generatevirtualwanvpnserverconfigurationvpnprofile request. func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, _ *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/generateVpnProfile" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -469,9 +449,10 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnClientParams); err != nil { return nil, err } @@ -479,9 +460,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi } // BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - options - ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions // method. @@ -508,9 +487,8 @@ func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[ManagementClientGetActiveSessionsResponse]]{ - FinalStateVia: runtime.FinalStateViaLocation, - Response: &pager, - Tracer: client.internal.Tracer(), + Response: &pager, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -522,8 +500,6 @@ func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, reso } // GetActiveSessions - Returns the list of currently active sessions on the Bastion. -// -// Generated from API version 2025-05-01 func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGetActiveSessions" @@ -548,6 +524,10 @@ func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceG // getActiveSessionsCreateRequest creates the GetActiveSessions request. func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, _ *ManagementClientBeginGetActiveSessionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -556,17 +536,13 @@ func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Conte return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -581,9 +557,7 @@ func (client *ManagementClient) getActiveSessionsHandleResponse(resp *http.Respo } // NewGetBastionShareableLinkPager - Return the Bastion Shareable Links for all the VMs specified in the request. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. // - options - ManagementClientGetBastionShareableLinkOptions contains the optional parameters for the ManagementClient.NewGetBastionShareableLinkPager @@ -614,6 +588,10 @@ func (client *ManagementClient) NewGetBastionShareableLinkPager(resourceGroupNam // getBastionShareableLinkCreateRequest creates the GetBastionShareableLink request. func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, _ *ManagementClientGetBastionShareableLinkOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -622,18 +600,15 @@ func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { return nil, err } @@ -651,9 +626,7 @@ func (client *ManagementClient) getBastionShareableLinkHandleResponse(resp *http // ListActiveConnectivityConfigurations - Lists active connectivity configurations in a network manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. // - options - ManagementClientListActiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListActiveConnectivityConfigurations @@ -703,9 +676,10 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsCreateReques if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -723,9 +697,7 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsHandleRespon // ListActiveSecurityAdminRules - Lists active security admin rules in a network manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. // - options - ManagementClientListActiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListActiveSecurityAdminRules @@ -775,9 +747,10 @@ func (client *ManagementClient) listActiveSecurityAdminRulesCreateRequest(ctx co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -796,9 +769,7 @@ func (client *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp // ListNetworkManagerEffectiveConnectivityConfigurations - List all effective connectivity configurations applied on a virtual // network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. // - options - ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions contains the optional parameters @@ -848,9 +819,10 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -868,9 +840,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura // ListNetworkManagerEffectiveSecurityAdminRules - List all effective security admin rules applied on a virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. // - options - ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions contains the optional parameters for the @@ -920,9 +890,10 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCre if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -939,9 +910,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHan } // BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. // - options - ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink @@ -969,9 +938,8 @@ func (client *ManagementClient) BeginPutBastionShareableLink(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]]{ - FinalStateVia: runtime.FinalStateViaLocation, - Response: &pager, - Tracer: client.internal.Tracer(), + Response: &pager, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -983,8 +951,6 @@ func (client *ManagementClient) BeginPutBastionShareableLink(ctx context.Context } // PutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. -// -// Generated from API version 2025-05-01 func (client *ManagementClient) putBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginPutBastionShareableLink" @@ -1009,6 +975,10 @@ func (client *ManagementClient) putBastionShareableLink(ctx context.Context, res // putBastionShareableLinkCreateRequest creates the PutBastionShareableLink request. func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, _ *ManagementClientBeginPutBastionShareableLinkOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1017,18 +987,15 @@ func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context return nil, errors.New("parameter bastionHostName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { return nil, err } @@ -1046,10 +1013,8 @@ func (client *ManagementClient) putBastionShareableLinkHandleResponse(resp *http // SupportedSecurityProviders - Gives the supported security providers for the virtual wan. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name. -// - virtualWANName - The name of the VirtualWAN for which supported security providers are needed. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN. // - options - ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders // method. func (client *ManagementClient) SupportedSecurityProviders(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (ManagementClientSupportedSecurityProvidersResponse, error) { @@ -1094,8 +1059,8 @@ func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go b/sdk/resourcemanager/network/armnetwork/management_client_example_test.go index 16bf0abacdae..48e888a3d5ee 100644 --- a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/management_client_example_test.go @@ -1,89 +1,50 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionShareableLinkCreate.json -func ExampleManagementClient_BeginPutBastionShareableLink() { +// Generated from example definition: 2025-07-01/CheckDnsNameAvailability.json +func ExampleManagementClient_CheckDNSNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagementClient().BeginPutBastionShareableLink(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ - VMs: []*armnetwork.BastionShareableLink{ - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - }, - }}, - }, nil) + res, err := clientFactory.NewManagementClient().CheckDNSNameAvailability(ctx, "westus", "testdns", 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) - } - for res.More() { - page, err := res.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.BastionShareableLinkListResult = armnetwork.BastionShareableLinkListResult{ - // Value: []*armnetwork.BastionShareableLink{ - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), - // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // }, - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), - // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - // }, - // }}, - // } - } + // 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 = armnetwork.ManagementClientCheckDNSNameAvailabilityResponse{ + // DNSNameAvailabilityResult: armnetwork.DNSNameAvailabilityResult{ + // Available: to.Ptr(false), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionShareableLinkDelete.json +// Generated from example definition: 2025-07-01/BastionShareableLinkDelete.json func ExampleManagementClient_BeginDeleteBastionShareableLink() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -91,72 +52,73 @@ func ExampleManagementClient_BeginDeleteBastionShareableLink() { VMs: []*armnetwork.BastionShareableLink{ { VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), }, }, { VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), }, - }}, + }, + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ManagementClientDeleteBastionShareableLinkResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionShareableLinkDeleteByToken.json +// Generated from example definition: 2025-07-01/BastionShareableLinkDeleteByToken.json func ExampleManagementClient_BeginDeleteBastionShareableLinkByToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewManagementClient().BeginDeleteBastionShareableLinkByToken(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkTokenListRequest{ Tokens: []*string{ to.Ptr("abcd1234-efgh-hijk-5678-abcdefgh1234"), - to.Ptr("dcba4321-hgfe-kjih-8765-hgfedcba4321")}, + to.Ptr("dcba4321-hgfe-kjih-8765-hgfedcba4321"), + }, }, 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) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionShareableLinkGet.json -func ExampleManagementClient_NewGetBastionShareableLinkPager() { +// Generated from example definition: 2025-07-01/BastionSessionDelete.json +func ExampleManagementClient_NewDisconnectActiveSessionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagementClient().NewGetBastionShareableLinkPager("rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ - VMs: []*armnetwork.BastionShareableLink{ - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - }, - }}, + pager := clientFactory.NewManagementClient().NewDisconnectActiveSessionsPager("rg1", "bastionhosttenant", armnetwork.SessionIDs{ + SessionIDs: []*string{ + to.Ptr("session1"), + to.Ptr("session2"), + to.Ptr("session3"), + }, }, nil) for pager.More() { page, err := pager.NextPage(ctx) @@ -168,34 +130,108 @@ func ExampleManagementClient_NewGetBastionShareableLinkPager() { _ = 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.BastionShareableLinkListResult = armnetwork.BastionShareableLinkListResult{ - // Value: []*armnetwork.BastionShareableLink{ - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), - // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + // page = armnetwork.ManagementClientDisconnectActiveSessionsResponse{ + // BastionSessionDeleteResult: armnetwork.BastionSessionDeleteResult{ + // Value: []*armnetwork.BastionSessionState{ + // { + // Message: to.Ptr("session session1 invalidated!"), + // SessionID: to.Ptr("session1"), + // State: to.Ptr("Disconnected"), // }, - // }, - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), - // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + // { + // Message: to.Ptr("session session2 could not be disconnected!"), + // SessionID: to.Ptr("session2"), + // State: to.Ptr("Failed"), + // }, + // { + // Message: to.Ptr("session session3 not found!"), + // SessionID: to.Ptr("session3"), + // State: to.Ptr("NotFound"), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionSessionsList.json +// Generated from example definition: 2025-07-01/expressRouteProviderPort.json +func ExampleManagementClient_ExpressRouteProviderPort() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagementClient().ExpressRouteProviderPort(ctx, "abc", 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 = armnetwork.ManagementClientExpressRouteProviderPortResponse{ + // ExpressRouteProviderPort: armnetwork.ExpressRouteProviderPort{ + // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), + // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), + // Location: to.Ptr("uswest"), + // Properties: &armnetwork.ExpressRouteProviderPortProperties{ + // OverprovisionFactor: to.Ptr[int32](4), + // PeeringLocation: to.Ptr("SiliconValley"), + // PortBandwidthInMbps: to.Ptr[int32](4000), + // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), + // PrimaryAzurePort: to.Ptr("bvtazureixp01"), + // RemainingBandwidthInMbps: to.Ptr[int32](1500), + // SecondaryAzurePort: to.Ptr("bvtazureixp01"), + // UsedBandwidthInMbps: to.Ptr[int32](2500), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/GenerateVirtualWanVpnServerConfigurationVpnProfile.json +func ExampleManagementClient_BeginGeneratevirtualwanvpnserverconfigurationvpnprofile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagementClient().BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(ctx, "rg1", "wan1", armnetwork.VirtualWanVPNProfileParameters{ + AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), + VPNServerConfigurationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), + }, 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 poll 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 = armnetwork.ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse{ + // VPNProfileResponse: armnetwork.VPNProfileResponse{ + // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/BastionSessionsList.json func ExampleManagementClient_BeginGetActiveSessions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -205,7 +241,7 @@ func ExampleManagementClient_BeginGetActiveSessions() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } for res.More() { page, err := res.NextPage(ctx) @@ -217,37 +253,53 @@ func ExampleManagementClient_BeginGetActiveSessions() { _ = 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.BastionActiveSessionListResult = armnetwork.BastionActiveSessionListResult{ - // Value: []*armnetwork.BastionActiveSession{ - // { - // ResourceType: to.Ptr("VM"), - // SessionDurationInMins: to.Ptr[float32](0), - // SessionID: to.Ptr("sessionId"), - // StartTime: "2019-1-1T12:00:00.0000Z", - // TargetHostName: to.Ptr("vm01"), - // TargetIPAddress: to.Ptr("1.1.1.1"), - // TargetResourceGroup: to.Ptr("rg1"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01"), - // TargetSubscriptionID: to.Ptr("subid"), - // UserName: to.Ptr("user"), - // Protocol: to.Ptr(armnetwork.BastionConnectProtocolSSH), - // }}, + // page = armnetwork.ManagementClientGetActiveSessionsResponse{ + // BastionActiveSessionListResult: armnetwork.BastionActiveSessionListResult{ + // Value: []*armnetwork.BastionActiveSession{ + // { + // ResourceType: to.Ptr("VM"), + // SessionDurationInMins: to.Ptr[float32](0), + // SessionID: to.Ptr("sessionId"), + // StartTime: "2019-1-1T12:00:00.0000Z", + // TargetHostName: to.Ptr("vm01"), + // TargetIPAddress: to.Ptr("1.1.1.1"), + // TargetResourceGroup: to.Ptr("rg1"), + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01"), + // TargetSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // UserName: to.Ptr("user"), + // Protocol: to.Ptr(armnetwork.BastionConnectProtocolSSH), + // }, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/BastionSessionDelete.json -func ExampleManagementClient_NewDisconnectActiveSessionsPager() { +// Generated from example definition: 2025-07-01/BastionShareableLinkGet.json +func ExampleManagementClient_NewGetBastionShareableLinkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagementClient().NewDisconnectActiveSessionsPager("rg1", "bastionhosttenant", armnetwork.SessionIDs{}, nil) + pager := clientFactory.NewManagementClient().NewGetBastionShareableLinkPager("rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ + VMs: []*armnetwork.BastionShareableLink{ + { + VM: &armnetwork.VM{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + }, + }, + { + VM: &armnetwork.VM{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + }, + }, + }, + }, nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -258,399 +310,412 @@ func ExampleManagementClient_NewDisconnectActiveSessionsPager() { _ = 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.BastionSessionDeleteResult = armnetwork.BastionSessionDeleteResult{ - // Value: []*armnetwork.BastionSessionState{ - // { - // Message: to.Ptr("session session1 invalidated!"), - // SessionID: to.Ptr("session1"), - // State: to.Ptr("Disconnected"), - // }, - // { - // Message: to.Ptr("session session2 could not be disconnected!"), - // SessionID: to.Ptr("session2"), - // State: to.Ptr("Failed"), + // page = armnetwork.ManagementClientGetBastionShareableLinkResponse{ + // BastionShareableLinkListResult: armnetwork.BastionShareableLinkListResult{ + // Value: []*armnetwork.BastionShareableLink{ + // { + // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), + // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), + // VM: &armnetwork.VM{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // }, + // { + // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), + // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), + // VM: &armnetwork.VM{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + // }, + // }, // }, - // { - // Message: to.Ptr("session session3 not found!"), - // SessionID: to.Ptr("session3"), - // State: to.Ptr("NotFound"), - // }}, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CheckDnsNameAvailability.json -func ExampleManagementClient_CheckDNSNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().CheckDNSNameAvailability(ctx, "westus", "testdns", 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.DNSNameAvailabilityResult = armnetwork.DNSNameAvailabilityResult{ - // Available: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/expressRouteProviderPort.json -func ExampleManagementClient_ExpressRouteProviderPort() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ExpressRouteProviderPort(ctx, "abc", 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.ExpressRouteProviderPort = armnetwork.ExpressRouteProviderPort{ - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("SiliconValley"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // RemainingBandwidthInMbps: to.Ptr[int32](1500), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // UsedBandwidthInMbps: to.Ptr[int32](2500), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerActiveConnectivityConfigurationsList.json +// Generated from example definition: 2025-07-01/NetworkManagerActiveConnectivityConfigurationsList.json func ExampleManagementClient_ListActiveConnectivityConfigurations() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagementClient().ListActiveConnectivityConfigurations(ctx, "myResourceGroup", "testNetworkManager", armnetwork.ActiveConfigurationParameter{ Regions: []*string{ - to.Ptr("westus")}, + to.Ptr("westus"), + }, SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveConnectivityConfigurationsOptions{Top: nil}) + }, 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.ActiveConnectivityConfigurationsListResult = armnetwork.ActiveConnectivityConfigurationsListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []*armnetwork.ActiveConnectivityConfiguration{ - // { - // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // res = armnetwork.ManagementClientListActiveConnectivityConfigurationsResponse{ + // ActiveConnectivityConfigurationsListResult: armnetwork.ActiveConnectivityConfigurationsListResult{ + // SkipToken: to.Ptr("FakeSkipTokenCode"), + // Value: []*armnetwork.ActiveConnectivityConfiguration{ + // { + // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T18:03:22.2578238+05:30"); return t}()), + // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A group for all test Virtual Networks"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), + // Properties: &armnetwork.ConnectivityConfigurationProperties{ + // Description: to.Ptr("Sample Configuration"), + // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // { + // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), + // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), + // }, + // }, + // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), + // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), + // Hubs: []*armnetwork.Hub{ + // { + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), + // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), + // }, + // }, + // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Region: to.Ptr("westus"), // }, - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T12:33:22.257Z"); return t}()), - // Region: to.Ptr("westus"), - // }}, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerActiveSecurityAdminRulesList.json +// Generated from example definition: 2025-07-01/NetworkManagerActiveSecurityAdminRulesList.json func ExampleManagementClient_ListActiveSecurityAdminRules() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagementClient().ListActiveSecurityAdminRules(ctx, "myResourceGroup", "testNetworkManager", armnetwork.ActiveConfigurationParameter{ Regions: []*string{ - to.Ptr("westus")}, + to.Ptr("westus"), + }, SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveSecurityAdminRulesOptions{Top: nil}) + }, 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.ActiveSecurityAdminRulesListResult = armnetwork.ActiveSecurityAdminRulesListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []armnetwork.ActiveBaseSecurityAdminRuleClassification{ - // &armnetwork.ActiveDefaultSecurityAdminRule{ - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T12:33:22.257Z"); return t}()), - // ConfigurationDescription: to.Ptr("SampleDescription"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), - // Region: to.Ptr("westus"), - // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // }}, - // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), - // RuleGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.ManagementClientListActiveSecurityAdminRulesResponse{ + // ActiveSecurityAdminRulesListResult: armnetwork.ActiveSecurityAdminRulesListResult{ + // SkipToken: to.Ptr("FakeSkipTokenCode"), + // Value: []armnetwork.ActiveBaseSecurityAdminRuleClassification{ + // &armnetwork.ActiveDefaultSecurityAdminRule{ + // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T18:03:22.2578238+05:30"); return t}()), + // ConfigurationDescription: to.Ptr("SampleDescription"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), + // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), + // Properties: &armnetwork.DefaultAdminPropertiesFormat{ + // Description: to.Ptr("Sample Admin Rule"), + // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), // }, - // }}, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, // Destinations: []*armnetwork.AddressPrefixItem{ // { // AddressPrefix: to.Ptr("*"), // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, + // }, + // }, // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), // Flag: to.Ptr("AllowVnetInbound"), // Priority: to.Ptr[int32](1), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // Region: to.Ptr("westus"), + // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), // }, - // }}, - // } + // }, + // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), + // RuleGroups: []*armnetwork.ConfigurationGroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A group for all test Virtual Networks"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerEffectiveConnectivityConfigurationsList.json +// Generated from example definition: 2025-07-01/NetworkManagerEffectiveConnectivityConfigurationsList.json func ExampleManagementClient_ListNetworkManagerEffectiveConnectivityConfigurations() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagementClient().ListNetworkManagerEffectiveConnectivityConfigurations(ctx, "myResourceGroup", "testVirtualNetwork", armnetwork.QueryRequestOptions{ SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions{Top: nil}) + }, 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.ManagerEffectiveConnectivityConfigurationListResult = armnetwork.ManagerEffectiveConnectivityConfigurationListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []*armnetwork.EffectiveConnectivityConfiguration{ - // { - // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // res = armnetwork.ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{ + // ManagerEffectiveConnectivityConfigurationListResult: armnetwork.ManagerEffectiveConnectivityConfigurationListResult{ + // SkipToken: to.Ptr("FakeSkipTokenCode"), + // Value: []*armnetwork.EffectiveConnectivityConfiguration{ + // { + // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ - // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), - // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), - // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A group for all test Virtual Networks"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), + // Properties: &armnetwork.ConnectivityConfigurationProperties{ + // Description: to.Ptr("Sample Configuration"), + // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ + // { + // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), + // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), + // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), + // }, + // }, + // ConnectivityCapabilities: &armnetwork.ConnectivityConfigurationPropertiesConnectivityCapabilities{ + // ConnectedGroupAddressOverlap: to.Ptr(armnetwork.ConnectedGroupAddressOverlapAllowed), + // ConnectedGroupPrivateEndpointsScale: to.Ptr(armnetwork.ConnectedGroupPrivateEndpointsScaleStandard), + // PeeringEnforcement: to.Ptr(armnetwork.PeeringEnforcementUnenforced), + // }, + // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), + // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), + // Hubs: []*armnetwork.Hub{ + // { + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), + // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), + // }, + // }, + // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerEffectiveSecurityAdminRulesList.json +// Generated from example definition: 2025-07-01/NetworkManagerEffectiveSecurityAdminRulesList.json func ExampleManagementClient_ListNetworkManagerEffectiveSecurityAdminRules() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagementClient().ListNetworkManagerEffectiveSecurityAdminRules(ctx, "myResourceGroup", "testVirtualNetwork", armnetwork.QueryRequestOptions{ SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions{Top: nil}) + }, 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.ManagerEffectiveSecurityAdminRulesListResult = armnetwork.ManagerEffectiveSecurityAdminRulesListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []armnetwork.EffectiveBaseSecurityAdminRuleClassification{ - // &armnetwork.EffectiveDefaultSecurityAdminRule{ - // ConfigurationDescription: to.Ptr("SampleDescription"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), - // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // }}, - // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), - // RuleGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{ + // ManagerEffectiveSecurityAdminRulesListResult: armnetwork.ManagerEffectiveSecurityAdminRulesListResult{ + // SkipToken: to.Ptr("FakeSkipTokenCode"), + // Value: []armnetwork.EffectiveBaseSecurityAdminRuleClassification{ + // &armnetwork.EffectiveDefaultSecurityAdminRule{ + // ConfigurationDescription: to.Ptr("SampleDescription"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), + // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), + // Properties: &armnetwork.DefaultAdminPropertiesFormat{ + // Description: to.Ptr("Sample Admin Rule"), + // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), // }, - // }}, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, // Destinations: []*armnetwork.AddressPrefixItem{ // { // AddressPrefix: to.Ptr("*"), // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, + // }, + // }, // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), // Flag: to.Ptr("AllowVnetInbound"), // Priority: to.Ptr[int32](1), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, // }, - // }}, - // } + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // }, + // }, + // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), + // RuleGroups: []*armnetwork.ConfigurationGroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), + // Properties: &armnetwork.GroupProperties{ + // Description: to.Ptr("A group for all test Virtual Networks"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWanSupportedSecurityProviders.json -func ExampleManagementClient_SupportedSecurityProviders() { +// Generated from example definition: 2025-07-01/BastionShareableLinkCreate.json +func ExampleManagementClient_BeginPutBastionShareableLink() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagementClient().SupportedSecurityProviders(ctx, "rg1", "wan1", nil) + poller, err := clientFactory.NewManagementClient().BeginPutBastionShareableLink(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ + VMs: []*armnetwork.BastionShareableLink{ + { + VM: &armnetwork.VM{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + }, + }, + { + VM: &armnetwork.VM{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + }, + }, + }, + }, 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.VirtualWanSecurityProviders = armnetwork.VirtualWanSecurityProviders{ - // SupportedProviders: []*armnetwork.VirtualWanSecurityProvider{ - // { - // Name: to.Ptr("AzureFirewall"), - // Type: to.Ptr(armnetwork.VirtualWanSecurityProviderTypeNative), - // URL: to.Ptr(""), - // }}, - // } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + for res.More() { + page, err := res.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 = armnetwork.ManagementClientPutBastionShareableLinkResponse{ + // BastionShareableLinkListResult: armnetwork.BastionShareableLinkListResult{ + // Value: []*armnetwork.BastionShareableLink{ + // { + // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), + // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), + // VM: &armnetwork.VM{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // }, + // { + // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), + // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), + // VM: &armnetwork.VM{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), + // }, + // }, + // }, + // }, + // } + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GenerateVirtualWanVpnServerConfigurationVpnProfile.json -func ExampleManagementClient_BeginGeneratevirtualwanvpnserverconfigurationvpnprofile() { +// Generated from example definition: 2025-07-01/VirtualWanSupportedSecurityProviders.json +func ExampleManagementClient_SupportedSecurityProviders() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagementClient().BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(ctx, "rg1", "wan1", armnetwork.VirtualWanVPNProfileParameters{ - AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), - VPNServerConfigurationResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), - }, nil) + res, err := clientFactory.NewManagementClient().SupportedSecurityProviders(ctx, "rg1", "wan1", 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.VPNProfileResponse = armnetwork.VPNProfileResponse{ - // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // res = armnetwork.ManagementClientSupportedSecurityProvidersResponse{ + // VirtualWanSecurityProviders: armnetwork.VirtualWanSecurityProviders{ + // SupportedProviders: []*armnetwork.VirtualWanSecurityProvider{ + // { + // Name: to.Ptr("AzureFirewall"), + // Type: to.Ptr(armnetwork.VirtualWanSecurityProviderTypeNative), + // URL: to.Ptr(""), + // }, + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go index 475cbfc3fef4..b7fe3bbbd8a9 100644 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,6 +19,8 @@ import ( // ManagementGroupNetworkManagerConnectionsClient contains the methods for the ManagementGroupNetworkManagerConnections group. // Don't use this type directly, use NewManagementGroupNetworkManagerConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ManagementGroupNetworkManagerConnectionsClient struct { internal *arm.Client } @@ -40,9 +41,7 @@ func NewManagementGroupNetworkManagerConnectionsClient(credential azcore.TokenCr // CreateOrUpdate - Create a network manager connection on this management group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - managementGroupID - The management group ID. // - networkManagerConnectionName - Name for the network manager connection. // - parameters - Network manager connection to be created/updated. // - options - ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the @@ -85,9 +84,10 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -105,9 +105,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateHand // Delete - Delete specified pending connection created by this management group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - managementGroupID - The management group ID. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete // method. @@ -148,17 +146,14 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get a specified connection created by this management group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - managementGroupID - The management group ID. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get // method. @@ -200,8 +195,8 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -216,9 +211,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getHandleResponse( } // NewListPager - List all network manager connections created by this management group. -// -// Generated from API version 2025-05-01 -// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - managementGroupID - The management group ID. // - options - ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.NewListPager // method. func (client *ManagementGroupNetworkManagerConnectionsClient) NewListPager(managementGroupID string, options *ManagementGroupNetworkManagerConnectionsClientListOptions) *runtime.Pager[ManagementGroupNetworkManagerConnectionsClientListResponse] { @@ -262,8 +255,8 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest( if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go index 55dce3e71479..b57a05352317 100644 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go @@ -1,34 +1,31 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionManagementGroupPut.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectionManagementGroupPut.json func ExampleManagementGroupNetworkManagerConnectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().CreateOrUpdate(ctx, "managementGroupA", "TestNMConnection", armnetwork.ManagerConnection{ Properties: &armnetwork.ManagerConnectionProperties{ - NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + NetworkManagerID: to.Ptr("/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), }, }, nil) if err != nil { @@ -37,95 +34,102 @@ func ExampleManagementGroupNetworkManagerConnectionsClient_CreateOrUpdate() { // 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.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{ + // ManagerConnection: armnetwork.ManagerConnection{ + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionManagementGroupGet.json -func ExampleManagementGroupNetworkManagerConnectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerConnectionManagementGroupDelete.json +func ExampleManagementGroupNetworkManagerConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Get(ctx, "managementGroupA", "TestNMConnection", nil) + res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Delete(ctx, "managementGroupA", "TestNMConnection", 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.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.ManagementGroupNetworkManagerConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionManagementGroupDelete.json -func ExampleManagementGroupNetworkManagerConnectionsClient_Delete() { +// Generated from example definition: 2025-07-01/NetworkManagerConnectionManagementGroupGet.json +func ExampleManagementGroupNetworkManagerConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Delete(ctx, "managementGroupA", "TestNMConnection", nil) + res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Get(ctx, "managementGroupA", "TestNMConnection", 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 = armnetwork.ManagementGroupNetworkManagerConnectionsClientGetResponse{ + // ManagerConnection: armnetwork.ManagerConnection{ + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionManagementGroupList.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectionManagementGroupList.json func ExampleManagementGroupNetworkManagerConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().NewListPager("managementGroupA", &armnetwork.ManagementGroupNetworkManagerConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().NewListPager("managementGroupA", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -136,26 +140,30 @@ func ExampleManagementGroupNetworkManagerConnectionsClient_NewListPager() { _ = 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.ManagerConnectionListResult = armnetwork.ManagerConnectionListResult{ - // Value: []*armnetwork.ManagerConnection{ - // { - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.ManagementGroupNetworkManagerConnectionsClientListResponse{ + // ManagerConnectionListResult: armnetwork.ManagerConnectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ManagerConnection{ + // { + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client.go b/sdk/resourcemanager/network/armnetwork/managercommits_client.go index 55618003352c..8015238bb04f 100644 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client.go +++ b/sdk/resourcemanager/network/armnetwork/managercommits_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// ManagerCommitsClient contains the methods for the NetworkManagerCommits group. +// ManagerCommitsClient contains the methods for the ManagerCommits group. // Don't use this type directly, use NewManagerCommitsClient() instead. +// +// Generated from API version 2025-07-01 type ManagerCommitsClient struct { internal *arm.Client subscriptionID string } // NewManagerCommitsClient creates a new instance of ManagerCommitsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewManagerCommitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerCommitsClient, error) { @@ -43,9 +43,7 @@ func NewManagerCommitsClient(subscriptionID string, credential azcore.TokenCrede // BeginPost - Post a Network Manager Commit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network commit is. // - options - ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost @@ -57,8 +55,7 @@ func (client *ManagerCommitsClient) BeginPost(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagerCommitsClientPostResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ManagerCommitsClient) BeginPost(ctx context.Context, resourceGroup // Post - Post a Network Manager Commit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagerCommitsClient) post(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*http.Response, error) { var err error const operationName = "ManagerCommitsClient.BeginPost" @@ -113,9 +108,10 @@ func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go index 9c328210db73..07b56447ebeb 100644 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go @@ -1,54 +1,57 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerCommitPost.json +// Generated from example definition: 2025-07-01/NetworkManagerCommitPost.json func ExampleManagerCommitsClient_BeginPost() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewManagerCommitsClient().BeginPost(ctx, "resoureGroupSample", "testNetworkManager", armnetwork.ManagerCommit{ CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), ConfigurationIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + }, TargetLocations: []*string{ - to.Ptr("useast")}, + to.Ptr("useast"), + }, }, 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) + log.Fatalf("failed to poll 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.ManagerCommit = armnetwork.ManagerCommit{ - // CommitID: to.Ptr("testCommitId"), - // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), - // ConfigurationIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")}, + // res = armnetwork.ManagerCommitsClientPostResponse{ + // ManagerCommit: armnetwork.ManagerCommit{ + // CommitID: to.Ptr("testCommitId"), + // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), + // ConfigurationIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig"), + // }, // TargetLocations: []*string{ - // to.Ptr("useast")}, - // } + // to.Ptr("useast"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go index 86d195cb7261..58a237cabb0a 100644 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// ManagerDeploymentStatusClient contains the methods for the NetworkManagerDeploymentStatus group. +// ManagerDeploymentStatusClient contains the methods for the ManagerDeploymentStatus group. // Don't use this type directly, use NewManagerDeploymentStatusClient() instead. +// +// Generated from API version 2025-07-01 type ManagerDeploymentStatusClient struct { internal *arm.Client subscriptionID string } // NewManagerDeploymentStatusClient creates a new instance of ManagerDeploymentStatusClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewManagerDeploymentStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerDeploymentStatusClient, error) { @@ -44,9 +44,7 @@ func NewManagerDeploymentStatusClient(subscriptionID string, credential azcore.T // List - Post to List of Network Manager Deployment Status. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network deployment status is. // - options - ManagerDeploymentStatusClientListOptions contains the optional parameters for the ManagerDeploymentStatusClient.List @@ -96,9 +94,10 @@ func (client *ManagerDeploymentStatusClient) listCreateRequest(ctx context.Conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go index badba482795b..b5ffe4d4d3e3 100644 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go @@ -1,54 +1,55 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerDeploymentStatusList.json +// Generated from example definition: 2025-07-01/NetworkManagerDeploymentStatusList.json func ExampleManagerDeploymentStatusClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewManagerDeploymentStatusClient().List(ctx, "resoureGroupSample", "testNetworkManager", armnetwork.ManagerDeploymentStatusParameter{ DeploymentTypes: []*armnetwork.ConfigurationType{ to.Ptr(armnetwork.ConfigurationTypeConnectivity), - to.Ptr(armnetwork.ConfigurationType("AdminPolicy"))}, + to.Ptr(armnetwork.ConfigurationType("AdminPolicy")), + }, Regions: []*string{ to.Ptr("eastus"), - to.Ptr("westus")}, + to.Ptr("westus"), + }, SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagerDeploymentStatusClientListOptions{Top: nil}) + }, 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.ManagerDeploymentStatusListResult = armnetwork.ManagerDeploymentStatusListResult{ - // SkipToken: to.Ptr("NextFakeSkipTokenCode"), - // Value: []*armnetwork.ManagerDeploymentStatus{ - // { - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-26T06:58:50.883Z"); return t}()), - // ConfigurationIDs: []*string{ - // to.Ptr("SecConfig1"), - // to.Ptr("SecConfig2")}, + // res = armnetwork.ManagerDeploymentStatusClientListResponse{ + // ManagerDeploymentStatusListResult: armnetwork.ManagerDeploymentStatusListResult{ + // SkipToken: to.Ptr("NextFakeSkipTokenCode"), + // Value: []*armnetwork.ManagerDeploymentStatus{ + // { + // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-26T06:58:50.883Z"); return t}()), + // ConfigurationIDs: []*string{ + // to.Ptr("SecConfig1"), + // to.Ptr("SecConfig2"), + // }, // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeploying), // DeploymentType: to.Ptr(armnetwork.ConfigurationType("AdminPolicy")), // ErrorMessage: to.Ptr(""), @@ -58,11 +59,14 @@ func ExampleManagerDeploymentStatusClient_List() { // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-26T06:58:50.883Z"); return t}()), // ConfigurationIDs: []*string{ // to.Ptr("ConnConfig1"), - // to.Ptr("ConnConfig2")}, - // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeployed), - // DeploymentType: to.Ptr(armnetwork.ConfigurationTypeConnectivity), - // ErrorMessage: to.Ptr(""), - // Region: to.Ptr("eastus"), - // }}, - // } + // to.Ptr("ConnConfig2"), + // }, + // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeployed), + // DeploymentType: to.Ptr(armnetwork.ConfigurationTypeConnectivity), + // ErrorMessage: to.Ptr(""), + // Region: to.Ptr("eastus"), + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go index f0f138356c37..4c980d5a4731 100644 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// ManagerRoutingConfigurationsClient contains the methods for the NetworkManagerRoutingConfigurations group. +// ManagerRoutingConfigurationsClient contains the methods for the ManagerRoutingConfigurations group. // Don't use this type directly, use NewManagerRoutingConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type ManagerRoutingConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewManagerRoutingConfigurationsClient creates a new instance of ManagerRoutingConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewManagerRoutingConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerRoutingConfigurationsClient, error) { @@ -44,8 +44,6 @@ func NewManagerRoutingConfigurationsClient(subscriptionID string, credential azc // CreateOrUpdate - Creates or updates a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -98,9 +96,10 @@ func (client *ManagerRoutingConfigurationsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingConfiguration); err != nil { return nil, err } @@ -118,8 +117,6 @@ func (client *ManagerRoutingConfigurationsClient) createOrUpdateHandleResponse(r // BeginDelete - Deletes a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -132,8 +129,7 @@ func (client *ManagerRoutingConfigurationsClient) BeginDelete(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagerRoutingConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -145,8 +141,6 @@ func (client *ManagerRoutingConfigurationsClient) BeginDelete(ctx context.Contex // Delete - Deletes a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagerRoutingConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ManagerRoutingConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagerRoutingConfigurationsClient.BeginDelete" @@ -192,19 +186,16 @@ func (client *ManagerRoutingConfigurationsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -256,8 +247,8 @@ func (client *ManagerRoutingConfigurationsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -272,8 +263,6 @@ func (client *ManagerRoutingConfigurationsClient) getHandleResponse(resp *http.R } // NewListPager - Lists all the network manager routing configurations in a network manager, in a paginated format. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ManagerRoutingConfigurationsClientListOptions contains the optional parameters for the ManagerRoutingConfigurationsClient.NewListPager @@ -327,8 +316,8 @@ func (client *ManagerRoutingConfigurationsClient) listCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go index bdafca5f70a9..b54f11e34fa6 100644 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go @@ -1,169 +1,177 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingConfigurationList.json -func ExampleManagerRoutingConfigurationsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingConfigurationPut.json +func ExampleManagerRoutingConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagerRoutingConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.ManagerRoutingConfigurationsClientListOptions{Top: nil, - SkipToken: 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.ManagerRoutingConfigurationListResult = armnetwork.ManagerRoutingConfigurationListResult{ - // Value: []*armnetwork.ManagerRoutingConfiguration{ - // { - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewManagerRoutingConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", armnetwork.ManagerRoutingConfiguration{ + Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ + Description: to.Ptr("A sample policy"), + RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), + }, + }, 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 = armnetwork.ManagerRoutingConfigurationsClientCreateOrUpdateResponse{ + // ManagerRoutingConfiguration: armnetwork.ManagerRoutingConfiguration{ + // Name: to.Ptr("myTestRoutingConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig"), + // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingConfigurationGet.json -func ExampleManagerRoutingConfigurationsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingConfigurationDelete.json +func ExampleManagerRoutingConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagerRoutingConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", nil) + poller, err := clientFactory.NewManagerRoutingConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", 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 poll 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.ManagerRoutingConfiguration = armnetwork.ManagerRoutingConfiguration{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.ManagerRoutingConfigurationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingConfigurationPut.json -func ExampleManagerRoutingConfigurationsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingConfigurationGet.json +func ExampleManagerRoutingConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagerRoutingConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", armnetwork.ManagerRoutingConfiguration{ - Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - Description: to.Ptr("A sample policy"), - RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), - }, - }, nil) + res, err := clientFactory.NewManagerRoutingConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", 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.ManagerRoutingConfiguration = armnetwork.ManagerRoutingConfiguration{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.ManagerRoutingConfigurationsClientGetResponse{ + // ManagerRoutingConfiguration: armnetwork.ManagerRoutingConfiguration{ + // Name: to.Ptr("myTestRoutingConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), + // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingConfigurationDelete.json -func ExampleManagerRoutingConfigurationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingConfigurationList.json +func ExampleManagerRoutingConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagerRoutingConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", &armnetwork.ManagerRoutingConfigurationsClientBeginDeleteOptions{Force: 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) + pager := clientFactory.NewManagerRoutingConfigurationsClient().NewListPager("rg1", "testNetworkManager", 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 = armnetwork.ManagerRoutingConfigurationsClientListResponse{ + // ManagerRoutingConfigurationListResult: armnetwork.ManagerRoutingConfigurationListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ManagerRoutingConfiguration{ + // { + // Name: to.Ptr("myTestRoutingConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), + // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RouteTableUsageMode: to.Ptr(armnetwork.RouteTableUsageModeManagedOnly), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/managers_client.go b/sdk/resourcemanager/network/armnetwork/managers_client.go index 86f426f4c2cc..c0866b358998 100644 --- a/sdk/resourcemanager/network/armnetwork/managers_client.go +++ b/sdk/resourcemanager/network/armnetwork/managers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// ManagersClient contains the methods for the NetworkManagers group. +// ManagersClient contains the methods for the Managers group. // Don't use this type directly, use NewManagersClient() instead. +// +// Generated from API version 2025-07-01 type ManagersClient struct { internal *arm.Client subscriptionID string } // NewManagersClient creates a new instance of ManagersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewManagersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagersClient, error) { @@ -44,9 +44,7 @@ func NewManagersClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a Network Manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. // - options - ManagersClientCreateOrUpdateOptions contains the optional parameters for the ManagersClient.CreateOrUpdate method. @@ -92,9 +90,10 @@ func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -112,9 +111,7 @@ func (client *ManagersClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes a network manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*runtime.Poller[ManagersClientDeleteResponse], error) { @@ -124,8 +121,7 @@ func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -137,8 +133,6 @@ func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a network manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagersClient.BeginDelete" @@ -180,20 +174,17 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Network Manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. func (client *ManagersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (ManagersClientGetResponse, error) { @@ -238,8 +229,8 @@ func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -254,9 +245,7 @@ func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersCl } // NewListPager - List network managers in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. func (client *ManagersClient) NewListPager(resourceGroupName string, options *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagersClientListResponse]{ @@ -303,8 +292,8 @@ func (client *ManagersClient) listCreateRequest(ctx context.Context, resourceGro if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -319,8 +308,6 @@ func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersC } // NewListBySubscriptionPager - List all network managers in a subscription. -// -// Generated from API version 2025-05-01 // - options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager // method. func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { @@ -364,8 +351,8 @@ func (client *ManagersClient) listBySubscriptionCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,9 +368,7 @@ func (client *ManagersClient) listBySubscriptionHandleResponse(resp *http.Respon // Patch - Patch NetworkManager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. // - options - ManagersClientPatchOptions contains the optional parameters for the ManagersClient.Patch method. @@ -429,9 +414,10 @@ func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go index 93727eb32d7e..7982a825f4b3 100644 --- a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go @@ -1,74 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerGet.json -func ExampleManagersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagersClient().Get(ctx, "rg1", "testNetworkManager", 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.Manager = armnetwork.Manager{ - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeSecurityUser)}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // }, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerPut.json +// Generated from example definition: 2025-07-01/NetworkManagerPut.json func ExampleManagersClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -76,12 +27,15 @@ func ExampleManagersClient_CreateOrUpdate() { Properties: &armnetwork.ManagerProperties{ Description: to.Ptr("My Test Network Manager"), NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, + to.Ptr(armnetwork.ConfigurationTypeConnectivity), + }, NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ ManagementGroups: []*string{ - to.Ptr("/Microsoft.Management/testmg")}, + to.Ptr("/Microsoft.Management/testmg"), + }, Subscriptions: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + }, }, }, }, nil) @@ -91,127 +45,129 @@ func ExampleManagersClient_CreateOrUpdate() { // 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.Manager = armnetwork.Manager{ - // Name: to.Ptr("TestNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, + // res = armnetwork.ManagersClientCreateOrUpdateResponse{ + // Manager: armnetwork.Manager{ + // Name: to.Ptr("TestNetworkManager"), + // Type: to.Ptr("Microsoft.Network/networkManagers"), + // Etag: to.Ptr("sadf-asdf-asdf-asdf"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager"), + // Properties: &armnetwork.ManagerProperties{ + // Description: to.Ptr("My Test Network Manager"), + // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ + // to.Ptr(armnetwork.ConfigurationTypeConnectivity), + // }, // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ // ManagementGroups: []*string{ - // to.Ptr("Microsoft.Management/managementGroups/testMg")}, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // to.Ptr("Microsoft.Management/managementGroups/testMg"), // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // Subscriptions: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), // }, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerDelete.json +// Generated from example definition: 2025-07-01/NetworkManagerDelete.json func ExampleManagersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagersClient().BeginDelete(ctx, "rg1", "testNetworkManager", &armnetwork.ManagersClientBeginDeleteOptions{Force: to.Ptr(false)}) + poller, err := clientFactory.NewManagersClient().BeginDelete(ctx, "rg1", "testNetworkManager", &armnetwork.ManagersClientBeginDeleteOptions{ + Force: to.Ptr(false)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ManagersClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerPatch.json -func ExampleManagersClient_Patch() { +// Generated from example definition: 2025-07-01/NetworkManagerGet.json +func ExampleManagersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagersClient().Patch(ctx, "rg1", "testNetworkManager", armnetwork.PatchObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewManagersClient().Get(ctx, "rg1", "testNetworkManager", 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.Manager = armnetwork.Manager{ - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManager"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, + // res = armnetwork.ManagersClientGetResponse{ + // Manager: armnetwork.Manager{ + // Name: to.Ptr("testNetworkManager"), + // Type: to.Ptr("Microsoft.Network/networkManagers"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // Properties: &armnetwork.ManagerProperties{ + // Description: to.Ptr("My Test Network Manager"), + // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ + // to.Ptr(armnetwork.ConfigurationTypeSecurityUser), + // }, // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ // ManagementGroups: []*string{ // }, // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerListAll.json -func ExampleManagersClient_NewListBySubscriptionPager() { +// Generated from example definition: 2025-07-01/NetworkManagerList.json +func ExampleManagersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagersClient().NewListBySubscriptionPager(&armnetwork.ManagersClientListBySubscriptionOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewManagersClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -222,53 +178,57 @@ func ExampleManagersClient_NewListBySubscriptionPager() { _ = 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.ManagerListResult = armnetwork.ManagerListResult{ - // Value: []*armnetwork.Manager{ - // { - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeSecurityUser)}, + // page = armnetwork.ManagersClientListResponse{ + // ManagerListResult: armnetwork.ManagerListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.Manager{ + // { + // Name: to.Ptr("testNetworkManager"), + // Type: to.Ptr("Microsoft.Network/networkManagers"), + // Etag: to.Ptr("sadf-asdf-asdf-asdf"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // Properties: &armnetwork.ManagerProperties{ + // Description: to.Ptr("My Test Network Manager"), + // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ + // to.Ptr(armnetwork.ConfigurationTypeConnectivity), + // }, // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ // ManagementGroups: []*string{ // }, // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // }}, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerList.json -func ExampleManagersClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerListAll.json +func ExampleManagersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagersClient().NewListPager("rg1", &armnetwork.ManagersClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewManagersClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -279,35 +239,102 @@ func ExampleManagersClient_NewListPager() { _ = 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.ManagerListResult = armnetwork.ManagerListResult{ - // Value: []*armnetwork.Manager{ - // { - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, + // page = armnetwork.ManagersClientListBySubscriptionResponse{ + // ManagerListResult: armnetwork.ManagerListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagers?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.Manager{ + // { + // Name: to.Ptr("testNetworkManager"), + // Type: to.Ptr("Microsoft.Network/networkManagers"), + // Etag: to.Ptr("sadf-asdf-asdf-asdf"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // Properties: &armnetwork.ManagerProperties{ + // Description: to.Ptr("My Test Network Manager"), + // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ + // to.Ptr(armnetwork.ConfigurationTypeSecurityUser), + // }, // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ // ManagementGroups: []*string{ // }, // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // }}, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/NetworkManagerPatch.json +func ExampleManagersClient_Patch() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagersClient().Patch(ctx, "rg1", "testNetworkManager", armnetwork.PatchObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ManagersClientPatchResponse{ + // Manager: armnetwork.Manager{ + // Name: to.Ptr("testNetworkManager"), + // Type: to.Ptr("Microsoft.Network/networkManager"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ManagerProperties{ + // Description: to.Ptr("My Test Network Manager"), + // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ + // to.Ptr(armnetwork.ConfigurationTypeConnectivity), + // }, + // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ + // ManagementGroups: []*string{ + // }, + // Subscriptions: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/models.go b/sdk/resourcemanager/network/armnetwork/models.go index b409f8f971dd..1b02d8b7b2a1 100644 --- a/sdk/resourcemanager/network/armnetwork/models.go +++ b/sdk/resourcemanager/network/armnetwork/models.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -256,7 +255,8 @@ type AdminPropertiesFormat struct { // AdminRule - Network admin rule. type AdminRule struct { - // REQUIRED; Whether the rule is custom or default. + // CONSTANT; Whether the rule is custom or default. + // Field has constant value AdminRuleKindCustom, any specified value is ignored. Kind *AdminRuleKind // Indicates the properties of the security admin rule @@ -311,13 +311,13 @@ type AdminRuleCollection struct { Type *string } -// AdminRuleCollectionListResult - Security admin configuration rule collection list result. +// AdminRuleCollectionListResult - The response of a AdminRuleCollection list operation. type AdminRuleCollectionListResult struct { - // Gets the URL to get the next set of results. - NextLink *string - - // A list of network manager security admin configuration rule collections + // REQUIRED; The AdminRuleCollection items on this page Value []*AdminRuleCollection + + // The link to the next page of items + NextLink *string } // AdminRuleCollectionPropertiesFormat - Defines the admin rule collection properties. @@ -335,13 +335,13 @@ type AdminRuleCollectionPropertiesFormat struct { ResourceGUID *string } -// AdminRuleListResult - security configuration admin rule list result. +// AdminRuleListResult - Paged collection of BaseAdminRule items type AdminRuleListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of admin rules + // REQUIRED; The BaseAdminRule items on this page Value []BaseAdminRuleClassification + + // The link to the next page of items + NextLink *string } // AdvertisedPublicPrefixProperties - Prefix properties required to perform validation using openssl signature. @@ -359,6 +359,12 @@ type AdvertisedPublicPrefixProperties struct { ValidationState *AdvertisedPublicPrefixPropertiesValidationState } +// AfcConfiguration - AFC configuration for the Azure Firewall. +type AfcConfiguration struct { + // READ-ONLY; The endpoint URL of the AFC control plane associated with this Azure Firewall. + ServiceEndpoint *string +} + // ApplicationGateway - Application gateway resource. type ApplicationGateway struct { // Resource ID. @@ -464,11 +470,11 @@ type ApplicationGatewayAvailableSSLOptionsPropertiesFormat struct { // ApplicationGatewayAvailableSSLPredefinedPolicies - Response for ApplicationGatewayAvailableSslOptions API service call. type ApplicationGatewayAvailableSSLPredefinedPolicies struct { - // URL to get the next set of results. - NextLink *string - - // List of available Ssl predefined policy. + // REQUIRED; The ApplicationGatewaySslPredefinedPolicy items on this page Value []*ApplicationGatewaySSLPredefinedPolicy + + // The link to the next page of items + NextLink *string } // ApplicationGatewayAvailableWafRuleSetsResult - Response for ApplicationGatewayAvailableWafRuleSets API service call. @@ -1013,8 +1019,7 @@ type ApplicationGatewayHeaderConfiguration struct { HeaderValue *string // An optional field under "Rewrite Action". It lets you capture and modify the value(s) of a specific header when multiple - // headers with the same name exist. Currently supported for Set-Cookie Response - // header only. For more details, visit https://aka.ms/appgwheadercrud + // headers with the same name exist. Currently supported for Set-Cookie Response header only. For more details, visit https://aka.ms/appgwheadercrud HeaderValueMatcher *HeaderValueMatcher } @@ -1046,13 +1051,13 @@ type ApplicationGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *ProvisioningState } -// ApplicationGatewayListResult - Response for ListApplicationGateways API service call. +// ApplicationGatewayListResult - The response of a ApplicationGateway list operation. type ApplicationGatewayListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of an application gateways in a resource group. + // REQUIRED; The ApplicationGateway items on this page Value []*ApplicationGateway + + // The link to the next page of items + NextLink *string } // ApplicationGatewayListener - Listener of an application gateway. @@ -1153,6 +1158,15 @@ type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { WeightPerServer *int32 } +// ApplicationGatewayManagedHsm - Managed HSM properties of an application gateway. +type ApplicationGatewayManagedHsm struct { + // Key identifier of a key stored in Managed HSM. + KeyID *string + + // Base-64 encoded value of a base-64 public certificate. + PublicCertData *string +} + // ApplicationGatewayOnDemandProbe - Details of on demand test probe request. type ApplicationGatewayOnDemandProbe struct { // Reference to backend pool of application gateway to which probe request will be sent. @@ -1170,7 +1184,7 @@ type ApplicationGatewayOnDemandProbe struct { // Criterion for classifying a healthy probe response. Match *ApplicationGatewayProbeHealthResponseMatch - // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. Path *string // Whether the host header should be picked from the backend http settings. Default value is false. @@ -1234,7 +1248,7 @@ type ApplicationGatewayPrivateEndpointConnection struct { // Resource ID. ID *string - // Name of the private endpoint connection on an application gateway. + // Name of the resource. Name *string // Properties of the application gateway private endpoint connection. @@ -1243,18 +1257,18 @@ type ApplicationGatewayPrivateEndpointConnection struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } -// ApplicationGatewayPrivateEndpointConnectionListResult - Response for ListApplicationGatewayPrivateEndpointConnection API -// service call. Gets all private endpoint connections for an application gateway. +// ApplicationGatewayPrivateEndpointConnectionListResult - The response of a ApplicationGatewayPrivateEndpointConnection list +// operation. type ApplicationGatewayPrivateEndpointConnectionListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of private endpoint connections on an application gateway. + // REQUIRED; The ApplicationGatewayPrivateEndpointConnection items on this page Value []*ApplicationGatewayPrivateEndpointConnection + + // The link to the next page of items + NextLink *string } // ApplicationGatewayPrivateEndpointConnectionProperties - Properties of Private Link Resource of an application gateway. @@ -1353,14 +1367,13 @@ type ApplicationGatewayPrivateLinkResource struct { Type *string } -// ApplicationGatewayPrivateLinkResourceListResult - Response for ListApplicationGatewayPrivateLinkResources API service call. -// Gets all private link resources for an application gateway. +// ApplicationGatewayPrivateLinkResourceListResult - The response of a ApplicationGatewayPrivateLinkResource list operation. type ApplicationGatewayPrivateLinkResourceListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of private link resources of an application gateway. + // REQUIRED; The ApplicationGatewayPrivateLinkResource items on this page Value []*ApplicationGatewayPrivateLinkResource + + // The link to the next page of items + NextLink *string } // ApplicationGatewayPrivateLinkResourceProperties - Properties of a private link resource. @@ -1420,7 +1433,7 @@ type ApplicationGatewayProbePropertiesFormat struct { // Minimum number of servers that are always marked healthy. Default value is 0. MinServers *int32 - // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. Path *string // Whether the host header should be picked from the backend http settings. Default value is false. @@ -1430,8 +1443,7 @@ type ApplicationGatewayProbePropertiesFormat struct { PickHostNameFromBackendSettings *bool // Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, - // port from http settings will be used. This property is valid for Basic, - // Standardv2 and WAFv2 only. + // port from http settings will be used. This property is valid for Basic, Standard_v2 and WAF_v2 only. Port *int32 // The protocol used for the probe. @@ -1451,23 +1463,19 @@ type ApplicationGatewayProbePropertiesFormat struct { // ApplicationGatewayPropertiesFormat - Properties of the application gateway. type ApplicationGatewayPropertiesFormat struct { - // Authentication certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). AuthenticationCertificates []*ApplicationGatewayAuthenticationCertificate // Autoscale Configuration. AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration - // Backend address pool of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). BackendAddressPools []*ApplicationGatewayBackendAddressPool - // Backend http settings of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). BackendHTTPSettingsCollection []*ApplicationGatewayBackendHTTPSettings - // Backend settings of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] - // . + // Backend settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). BackendSettingsCollection []*ApplicationGatewayBackendSettings // Custom error configurations of the application gateway resource. @@ -1479,8 +1487,8 @@ type ApplicationGatewayPropertiesFormat struct { // Whether HTTP2 is enabled on the application gateway resource. EnableHTTP2 *bool - // Entra JWT validation configurations for the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Entra JWT validation configurations for the application gateway resource. For default limits, see [Application Gateway + // limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). EntraJWTValidationConfigs []*ApplicationGatewayEntraJWTValidationConfig // Reference to the FirewallPolicy resource. @@ -1489,23 +1497,22 @@ type ApplicationGatewayPropertiesFormat struct { // If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. ForceFirewallPolicyAssociation *bool - // Frontend IP addresses of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). FrontendIPConfigurations []*ApplicationGatewayFrontendIPConfiguration - // Frontend ports of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). FrontendPorts []*ApplicationGatewayFrontendPort - // Subnets of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). GatewayIPConfigurations []*ApplicationGatewayIPConfiguration // Global Configuration. GlobalConfiguration *ApplicationGatewayGlobalConfiguration - // Http listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). HTTPListeners []*ApplicationGatewayHTTPListener - // Listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). Listeners []*ApplicationGatewayListener // Load distribution policies of the application gateway resource. @@ -1517,8 +1524,7 @@ type ApplicationGatewayPropertiesFormat struct { // Probes of the application gateway resource. Probes []*ApplicationGatewayProbe - // Redirect configurations of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). RedirectConfigurations []*ApplicationGatewayRedirectConfiguration // Request routing rules of the application gateway resource. @@ -1533,25 +1539,22 @@ type ApplicationGatewayPropertiesFormat struct { // SKU of the application gateway resource. SKU *ApplicationGatewaySKU - // SSL certificates of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] - // . + // SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). SSLCertificates []*ApplicationGatewaySSLCertificate // SSL policy of the application gateway resource. SSLPolicy *ApplicationGatewaySSLPolicy - // SSL profiles of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // SSL profiles of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). SSLProfiles []*ApplicationGatewaySSLProfile - // Trusted client certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Trusted client certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). TrustedClientCertificates []*ApplicationGatewayTrustedClientCertificate - // Trusted Root certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). TrustedRootCertificates []*ApplicationGatewayTrustedRootCertificate - // URL path map of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + // URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). URLPathMaps []*ApplicationGatewayURLPathMap // Web application firewall configuration. @@ -1815,6 +1818,9 @@ type ApplicationGatewaySSLCertificatePropertiesFormat struct { // Base-64 encoded pfx certificate. Only applicable in PUT Request. Data *string + // Managed HSM properties of the Application Gateway resource. + Hsm *ApplicationGatewayManagedHsm + // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. KeyVaultSecretID *string @@ -2044,11 +2050,11 @@ type ApplicationGatewayWafDynamicManifestResult struct { // ApplicationGatewayWafDynamicManifestResultList - Response for ApplicationGatewayWafDynamicManifests API service call. type ApplicationGatewayWafDynamicManifestResultList struct { - // URL to get the next set of results. - NextLink *string - - // The list of application gateway waf manifest. + // REQUIRED; The ApplicationGatewayWafDynamicManifestResult items on this page Value []*ApplicationGatewayWafDynamicManifestResult + + // The link to the next page of items + NextLink *string } // ApplicationGatewayWebApplicationFirewallConfiguration - Application gateway web application firewall configuration. @@ -2086,7 +2092,8 @@ type ApplicationGatewayWebApplicationFirewallConfiguration struct { // ApplicationRule - Rule of type application. type ApplicationRule struct { - // REQUIRED; Rule Type. + // CONSTANT; Rule Type. + // Field has constant value FirewallPolicyRuleTypeApplicationRule, any specified value is ignored. RuleType *FirewallPolicyRuleType // Description of the rule. @@ -2159,12 +2166,12 @@ type ApplicationSecurityGroup struct { Type *string } -// ApplicationSecurityGroupListResult - A list of application security groups. +// ApplicationSecurityGroupListResult - The response of a ApplicationSecurityGroup list operation. type ApplicationSecurityGroupListResult struct { - // A list of application security groups. + // REQUIRED; The ApplicationSecurityGroup items on this page Value []*ApplicationSecurityGroup - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -2174,19 +2181,17 @@ type ApplicationSecurityGroupPropertiesFormat struct { ProvisioningState *ProvisioningState // READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even - // if the user changes its name or migrate the resource across subscriptions or resource - // groups. + // if the user changes its name or migrate the resource across subscriptions or resource groups. ResourceGUID *string } -// AuthorizationListResult - Response for ListAuthorizations API service call retrieves all authorizations that belongs to -// an ExpressRouteCircuit. +// AuthorizationListResult - Paged collection of ExpressRouteCircuitAuthorization items type AuthorizationListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The authorizations in an ExpressRoute Circuit. + // REQUIRED; The ExpressRouteCircuitAuthorization items on this page Value []*ExpressRouteCircuitAuthorization + + // The link to the next page of items + NextLink *string } // AuthorizationPropertiesFormat - Properties of ExpressRouteCircuitAuthorization. @@ -2213,10 +2218,10 @@ type AutoApprovedPrivateLinkService struct { // AutoApprovedPrivateLinkServicesResult - An array of private link service id that can be linked to a private end point with // auto approved. type AutoApprovedPrivateLinkServicesResult struct { - // An array of auto approved private link service. + // REQUIRED; The AutoApprovedPrivateLinkService items on this page Value []*AutoApprovedPrivateLinkService - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -2252,10 +2257,10 @@ type AvailableDelegation struct { // AvailableDelegationsResult - An array of available delegations. type AvailableDelegationsResult struct { - // An array of available delegations. + // REQUIRED; The AvailableDelegation items on this page Value []*AvailableDelegation - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -2279,10 +2284,10 @@ type AvailablePrivateEndpointType struct { // AvailablePrivateEndpointTypesResult - An array of available PrivateEndpoint types. type AvailablePrivateEndpointTypesResult struct { - // An array of available privateEndpoint type. + // REQUIRED; The AvailablePrivateEndpointType items on this page Value []*AvailablePrivateEndpointType - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -2357,27 +2362,13 @@ type AvailableServiceAlias struct { // AvailableServiceAliasesResult - An array of available service aliases. type AvailableServiceAliasesResult struct { - // An array of available service aliases. + // REQUIRED; The AvailableServiceAlias items on this page Value []*AvailableServiceAlias - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// AzureAsyncOperationResult - The response body contains the status of the specified asynchronous operation, indicating whether -// it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP -// status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response -// body includes the HTTP status code for the successful request. If the -// asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information -// regarding the failure. -type AzureAsyncOperationResult struct { - // Details of the error occurred during specified asynchronous operation. - Error *Error - - // Status of the Azure async operation. - Status *NetworkOperationStatus -} - // AzureFirewall - Azure Firewall resource. type AzureFirewall struct { // The extended location of type local virtual network gateway. @@ -2504,13 +2495,13 @@ type AzureFirewallFqdnTag struct { Type *string } -// AzureFirewallFqdnTagListResult - Response for ListAzureFirewallFqdnTags API service call. +// AzureFirewallFqdnTagListResult - The response of a AzureFirewallFqdnTag list operation. type AzureFirewallFqdnTagListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Azure Firewall FQDN Tags in a resource group. + // REQUIRED; The AzureFirewallFqdnTag items on this page Value []*AzureFirewallFqdnTag + + // The link to the next page of items + NextLink *string } // AzureFirewallFqdnTagPropertiesFormat - Azure Firewall FQDN Tag Properties. @@ -2564,13 +2555,13 @@ type AzureFirewallIPGroups struct { ID *string } -// AzureFirewallListResult - Response for ListAzureFirewalls API service call. +// AzureFirewallListResult - The response of a AzureFirewall list operation. type AzureFirewallListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Azure Firewalls in a resource group. + // REQUIRED; The AzureFirewall items on this page Value []*AzureFirewall + + // The link to the next page of items + NextLink *string } // AzureFirewallNatRCAction - AzureFirewall NAT Rule Collection Action. @@ -2767,6 +2758,9 @@ type AzureFirewallPropertiesFormat struct { // The virtualHub to which the firewall belongs. VirtualHub *SubResource + // READ-ONLY; AFC configuration for the Azure Firewall. + AfcConfiguration *AfcConfiguration + // READ-ONLY; IpGroups associated with AzureFirewall. IPGroups []*AzureFirewallIPGroups @@ -2876,13 +2870,13 @@ type AzureWebCategory struct { Type *string } -// AzureWebCategoryListResult - Response for ListAzureWebCategories API service call. +// AzureWebCategoryListResult - List of Azure Web Categories for a given Subscription. type AzureWebCategoryListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Azure Web Categories for a given Subscription. + // REQUIRED; The AzureWebCategory items on this page Value []*AzureWebCategory + + // The link to the next page of items + NextLink *string } // AzureWebCategoryPropertiesFormat - Azure Web Category Properties. @@ -2923,8 +2917,7 @@ type BackendAddressPool struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can - // be used to access the resource. + // Name of the resource. Name *string // Properties of load balancer backend address pool. @@ -2933,7 +2926,7 @@ type BackendAddressPool struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -3038,11 +3031,11 @@ type BastionActiveSession struct { // BastionActiveSessionListResult - Response for GetActiveSessions. type BastionActiveSessionListResult struct { - // The URL to get the next set of results. - NextLink *string - - // List of active sessions on the bastion. + // REQUIRED; The BastionActiveSession items on this page Value []*BastionActiveSession + + // The link to the next page of items + NextLink *string } // BastionHost - Bastion Host resource. @@ -3108,13 +3101,13 @@ type BastionHostIPConfigurationPropertiesFormat struct { ProvisioningState *ProvisioningState } -// BastionHostListResult - Response for ListBastionHosts API service call. +// BastionHostListResult - The response of a BastionHost list operation. type BastionHostListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Bastion Hosts in a resource group. + // REQUIRED; The BastionHost items on this page Value []*BastionHost + + // The link to the next page of items + NextLink *string } // BastionHostPropertiesFormat - Properties of the Bastion Host. @@ -3167,11 +3160,11 @@ type BastionHostPropertiesFormatNetworkACLs struct { // BastionSessionDeleteResult - Response for DisconnectActiveSessions. type BastionSessionDeleteResult struct { - // The URL to get the next set of results. - NextLink *string - - // List of sessions with their corresponding state. + // REQUIRED; The BastionSessionState items on this page Value []*BastionSessionState + + // The link to the next page of items + NextLink *string } // BastionSessionState - The session state detail for a target. @@ -3209,11 +3202,11 @@ type BastionShareableLinkListRequest struct { // BastionShareableLinkListResult - Response for all the Bastion Shareable Link endpoints. type BastionShareableLinkListResult struct { - // The URL to get the next set of results. - NextLink *string - - // List of Bastion Shareable Links for the request. + // REQUIRED; The BastionShareableLink items on this page Value []*BastionShareableLink + + // The link to the next page of items + NextLink *string } // BastionShareableLinkTokenListRequest - Post request for Delete Bastion Shareable Link By Token endpoint. @@ -3227,7 +3220,7 @@ type BgpConnection struct { // Resource ID. ID *string - // Name of the connection. + // Name of the resource. Name *string // The properties of the Bgp connections. @@ -3236,7 +3229,7 @@ type BgpConnection struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Connection type. + // READ-ONLY; Resource type. Type *string } @@ -3251,6 +3244,9 @@ type BgpConnectionProperties struct { // Peer IP. PeerIP *string + // The routing configuration indicating the associated and propagated route tables for this connection. + RoutingConfiguration *RoutingConfiguration + // READ-ONLY; The current state of the VirtualHub to Peer. ConnectionState *HubBgpConnectionStatus @@ -3312,13 +3308,13 @@ type BgpServiceCommunity struct { Type *string } -// BgpServiceCommunityListResult - Response for the ListServiceCommunity API service call. +// BgpServiceCommunityListResult - The response of a BgpServiceCommunity list operation. type BgpServiceCommunityListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of service community resources. + // REQUIRED; The BgpServiceCommunity items on this page Value []*BgpServiceCommunity + + // The link to the next page of items + NextLink *string } // BgpServiceCommunityPropertiesFormat - Properties of Service Community. @@ -3375,21 +3371,6 @@ type CheckPrivateLinkServiceVisibilityRequest struct { PrivateLinkServiceAlias *string } -// ChildResource - Proxy resource representation. -type ChildResource struct { - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - type CircuitMetadataMap struct { // Link to the Express Route circuit Link *string @@ -3401,99 +3382,61 @@ type CircuitMetadataMap struct { Name *string } -// CommonErrorAdditionalInfo - The resource management error additional info. -type CommonErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info any - - // READ-ONLY; The additional info type. - Type *string -} - -// CommonErrorDetail - The error detail. -type CommonErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*CommonErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*CommonErrorDetail - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} +// Commit - The commit resource +type Commit struct { + // The Commit properties + Properties *CommitProperties -// CommonErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). -type CommonErrorResponse struct { - // The error object. - Error *CommonErrorDetail -} + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string -// CommonProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags -// and a location -type CommonProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Resource ID. ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; Resource name. Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + // READ-ONLY; The system metadata related to this resource. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + // READ-ONLY; Resource type. Type *string } -// CommonResource - Common fields that are returned in the response for all Azure Resource Manager resources -type CommonResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData +// CommitListResult - The response of a Commit list operation. +type CommitListResult struct { + // REQUIRED; The Commit items on this page + Value []*Commit - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // The link to the next page of items + NextLink *string } -// CommonTrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has -// 'tags' and a 'location' -type CommonTrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string +// CommitProperties - Properties of commit +type CommitProperties struct { + // REQUIRED; Commit Type. + CommitType *ConfigurationType - // Resource tags. - Tags map[string]*string + // REQUIRED; List of target locations. + TargetLocations []*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string + // List of configuration IDs. + ConfigurationIDs []*string - // READ-ONLY; The name of the resource - Name *string + // A description of the commit. + Description *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData + // A value that, when changed, forces the commit to be re-evaluated and redeployed. + ForceUpdateTag *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // READ-ONLY; List of active locations. + ActiveLocations []*string -type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string + // READ-ONLY; Unique identifier for this resource. + ResourceGUID *string } // ConfigurationDiagnosticParameters - Parameters to get network configuration diagnostic. @@ -3678,6 +3621,9 @@ type ConnectionMonitorIcmpConfiguration struct { // ConnectionMonitorListResult - List of connection monitors. type ConnectionMonitorListResult struct { + // URL to get the next set of results. + NextLink *string + // Information about connection monitors. Value []*ConnectionMonitorResult } @@ -3721,15 +3667,6 @@ type ConnectionMonitorParameters struct { TestGroups []*ConnectionMonitorTestGroup } -// ConnectionMonitorQueryResult - List of connection states snapshots. -type ConnectionMonitorQueryResult struct { - // Status of connection monitor source. - SourceStatus *ConnectionMonitorSourceStatus - - // Information about connection states. - States []*ConnectionStateSnapshot -} - // ConnectionMonitorResult - Information about the connection monitor. type ConnectionMonitorResult struct { // Connection monitor location. @@ -3878,6 +3815,40 @@ type ConnectionMonitorWorkspaceSettings struct { WorkspaceResourceID *string } +// ConnectionPolicy resource defined for VirtualHub. +type ConnectionPolicy struct { + // Resource ID. + ID *string + + // Properties of the ConnectionPolicy resource. + Properties *ConnectionPolicyProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ConnectionPolicyProperties - Properties of the ConnectionPolicy resource. +type ConnectionPolicyProperties struct { + // Enable internet security. + EnableInternetSecurity *bool + + // The Routing Configuration indicating the associated and propagated route tables on this connection. + RoutingConfiguration *RoutingConfiguration + + // READ-ONLY; List of connection names (e.g. VpnConnection, HubVirtualNetworkConnection) associated with this ConnectionPolicy. + // These are resource names, not Azure resource IDs, consistent with the established VirtualWAN pattern used by HubRouteTable.associatedConnections. + AssociatedConnections []*string + + // READ-ONLY; The provisioning state of the ConnectionPolicy resource. + ProvisioningState *ProvisioningState +} + // ConnectionResetSharedKey - The virtual network connection reset shared key. type ConnectionResetSharedKey struct { // REQUIRED; The virtual network connection reset shared key length, should between 1 and 128. @@ -3898,7 +3869,7 @@ type ConnectionSharedKeyResult struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the shared key. @@ -3911,44 +3882,11 @@ type ConnectionSharedKeyResult struct { // ConnectionSharedKeyResultList - The list of shared keys for the vpn link connection. It should only contain one shared // key for each vpn link connection. type ConnectionSharedKeyResultList struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of SharedKeys. + // REQUIRED; The ConnectionSharedKeyResult items on this page Value []*ConnectionSharedKeyResult -} - -// ConnectionStateSnapshot - Connection state snapshot. -type ConnectionStateSnapshot struct { - // Average latency in ms. - AvgLatencyInMs *int64 - - // The connection state. - ConnectionState *ConnectionState - - // The end time of the connection snapshot. - EndTime *time.Time - - // Connectivity analysis evaluation state. - EvaluationState *EvaluationState - - // Maximum latency in ms. - MaxLatencyInMs *int64 - - // Minimum latency in ms. - MinLatencyInMs *int64 - - // The number of failed probes. - ProbesFailed *int64 - - // The number of sent probes. - ProbesSent *int64 - // The start time of the connection snapshot. - StartTime *time.Time - - // READ-ONLY; List of hops between the source and the destination. - Hops []*ConnectivityHop + // The link to the next page of items + NextLink *string } // ConnectivityConfiguration - The network manager connectivity configuration resource @@ -3972,14 +3910,13 @@ type ConnectivityConfiguration struct { Type *string } -// ConnectivityConfigurationListResult - Result of the request to list network manager connectivity configurations. It contains -// a list of configurations and a link to get the next set of results. +// ConnectivityConfigurationListResult - The response of a ConnectivityConfiguration list operation. type ConnectivityConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of Connectivity Configurations + // REQUIRED; The ConnectivityConfiguration items on this page Value []*ConnectivityConfiguration + + // The link to the next page of items + NextLink *string } // ConnectivityConfigurationProperties - Properties of network manager connectivity configuration @@ -4291,7 +4228,7 @@ type CustomIPPrefix struct { // Resource tags. Tags map[string]*string - // A list of availability zones denoting the IP allocated for the resource needs to come from. + // A list of availability zones denoting where the resource needs to come from. Zones []*string // READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -4304,13 +4241,13 @@ type CustomIPPrefix struct { Type *string } -// CustomIPPrefixListResult - Response for ListCustomIpPrefixes API service call. +// CustomIPPrefixListResult - The response of a CustomIpPrefix list operation. type CustomIPPrefixListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of Custom IP prefixes that exists in a resource group. + // REQUIRED; The CustomIpPrefix items on this page Value []*CustomIPPrefix + + // The link to the next page of items + NextLink *string } // CustomIPPrefixPropertiesFormat - Custom IP prefix properties. @@ -4403,6 +4340,15 @@ type DdosCustomPolicy struct { Type *string } +// DdosCustomPolicyListResult - The response of a DdosCustomPolicy list operation. +type DdosCustomPolicyListResult struct { + // REQUIRED; The DdosCustomPolicy items on this page + Value []*DdosCustomPolicy + + // The link to the next page of items + NextLink *string +} + // DdosCustomPolicyPropertiesFormat - DDoS custom policy properties. type DdosCustomPolicyPropertiesFormat struct { // The list of DDoS detection rules associated with the custom policy. @@ -4414,6 +4360,9 @@ type DdosCustomPolicyPropertiesFormat struct { // READ-ONLY; The provisioning state of the DDoS custom policy resource. ProvisioningState *ProvisioningState + // READ-ONLY; The list of public IP addresses associated with the custom policy. This list is read-only. + PublicIPAddresses []*SubResource + // READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if // the user changes its name or migrate the resource across subscriptions or resource groups. ResourceGUID *string @@ -4421,9 +4370,6 @@ type DdosCustomPolicyPropertiesFormat struct { // DdosDetectionRule - A DDoS detection rule resource. type DdosDetectionRule struct { - // Resource ID. - ID *string - // The name of the DDoS detection rule. Name *string @@ -4433,6 +4379,9 @@ type DdosDetectionRule struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + // READ-ONLY; The resource ID of the DDoS detection rule. + ID *string + // READ-ONLY; The resource type. Type *string } @@ -4449,6 +4398,12 @@ type DdosDetectionRulePropertiesFormat struct { ProvisioningState *ProvisioningState } +// DdosFrontendIPConfigurationSettings - DDoS protection settings for a frontend IP configuration. +type DdosFrontendIPConfigurationSettings struct { + // The reference to the DDoS Custom Policy resource. + DdosCustomPolicy *SubResource +} + // DdosProtectionPlan - A DDoS protection plan in a resource group. type DdosProtectionPlan struct { // Resource location. @@ -4473,12 +4428,12 @@ type DdosProtectionPlan struct { Type *string } -// DdosProtectionPlanListResult - A list of DDoS protection plans. +// DdosProtectionPlanListResult - The response of a DdosProtectionPlan list operation. type DdosProtectionPlanListResult struct { - // A list of DDoS protection plans. + // REQUIRED; The DdosProtectionPlan items on this page Value []*DdosProtectionPlan - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -4500,6 +4455,9 @@ type DdosProtectionPlanPropertiesFormat struct { // DdosSettings - Contains the DDoS protection settings of the public IP. type DdosSettings struct { + // The DDoS custom policy associated with the public IP. + DdosCustomPolicy *SubResource + // The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled DdosProtectionPlan *SubResource @@ -4549,7 +4507,8 @@ type DefaultAdminPropertiesFormat struct { // DefaultAdminRule - Network default admin rule. type DefaultAdminRule struct { - // REQUIRED; Whether the rule is custom or default. + // CONSTANT; Whether the rule is custom or default. + // Field has constant value AdminRuleKindDefault, any specified value is ignored. Kind *AdminRuleKind // Indicates the properties of the security admin rule @@ -4652,8 +4611,7 @@ type Dimension struct { // DisassociateCloudServicePublicIPRequest - The request for DisassociateCloudServicePublicIpOperation. type DisassociateCloudServicePublicIPRequest struct { - // REQUIRED; ARM ID of the Standalone Public IP to associate. This is of the form : - // /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} + // REQUIRED; ARM ID of the Standalone Public IP to associate. This is of the form : /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} PublicIPArmID *string } @@ -4681,12 +4639,12 @@ type DscpConfiguration struct { Type *string } -// DscpConfigurationListResult - Response for the DscpConfigurationList API service call. +// DscpConfigurationListResult - The response of a DscpConfiguration list operation. type DscpConfigurationListResult struct { - // A list of dscp configurations in a resource group. + // REQUIRED; The DscpConfiguration items on this page Value []*DscpConfiguration - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -4812,7 +4770,7 @@ type EffectiveNetworkSecurityGroup struct { NetworkSecurityGroup *SubResource // Mapping of tags to list of IP Addresses included within the tag. - TagMap *string + TagMap map[string][]*string } // EffectiveNetworkSecurityGroupAssociation - The effective network security group association. @@ -4829,10 +4787,10 @@ type EffectiveNetworkSecurityGroupAssociation struct { // EffectiveNetworkSecurityGroupListResult - Response for list effective network security groups API service call. type EffectiveNetworkSecurityGroupListResult struct { - // A list of effective network security groups. + // REQUIRED; The EffectiveNetworkSecurityGroup items on this page Value []*EffectiveNetworkSecurityGroup - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } @@ -4914,10 +4872,10 @@ type EffectiveRoute struct { // EffectiveRouteListResult - Response for list effective route API service call. type EffectiveRouteListResult struct { - // A list of effective routes. + // REQUIRED; The EffectiveRoute items on this page Value []*EffectiveRoute - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } @@ -4997,31 +4955,13 @@ type EndpointServiceResult struct { Type *string } -// EndpointServicesListResult - Response for the ListAvailableEndpointServices API service call. +// EndpointServicesListResult - Paged collection of EndpointServiceResult items type EndpointServicesListResult struct { - // The URL to get the next set of results. - NextLink *string - - // List of available endpoint services in a region. + // REQUIRED; The EndpointServiceResult items on this page Value []*EndpointServiceResult -} - -// Error - Common error representation. -type Error struct { - // Error code. - Code *string - - // Error details. - Details []*ErrorDetails - // Inner error message. - InnerError *string - - // Error message. - Message *string - - // Error target. - Target *string + // The link to the next page of items + NextLink *string } // ErrorAdditionalInfo - The resource management error additional info. @@ -5051,24 +4991,6 @@ type ErrorDetail struct { Target *string } -// ErrorDetails - Common error details representation. -type ErrorDetails struct { - // Error code. - Code *string - - // Error message. - Message *string - - // Error target. - Target *string -} - -// ErrorResponse - The error object. -type ErrorResponse struct { - // The error details object. - Error *ErrorDetails -} - // EvaluatedNetworkSecurityGroup - Results of network security group evaluation. type EvaluatedNetworkSecurityGroup struct { // Resource ID of nic or subnet to which network security group is applied. @@ -5200,7 +5122,7 @@ type ExpressRouteCircuitAuthorization struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the express route circuit authorization. @@ -5209,7 +5131,7 @@ type ExpressRouteCircuitAuthorization struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -5218,7 +5140,7 @@ type ExpressRouteCircuitConnection struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the express route circuit connection. @@ -5227,18 +5149,17 @@ type ExpressRouteCircuitConnection struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } -// ExpressRouteCircuitConnectionListResult - Response for ListConnections API service call retrieves all global reach connections -// that belongs to a Private Peering for an ExpressRouteCircuit. +// ExpressRouteCircuitConnectionListResult - The response of a ExpressRouteCircuitConnection list operation. type ExpressRouteCircuitConnectionListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The global reach connection associated with Private Peering in an ExpressRoute Circuit. + // REQUIRED; The ExpressRouteCircuitConnection items on this page Value []*ExpressRouteCircuitConnection + + // The link to the next page of items + NextLink *string } // ExpressRouteCircuitConnectionPropertiesFormat - Properties of the express route circuit connection. @@ -5265,13 +5186,13 @@ type ExpressRouteCircuitConnectionPropertiesFormat struct { ProvisioningState *ProvisioningState } -// ExpressRouteCircuitListResult - Response for ListExpressRouteCircuit API service call. +// ExpressRouteCircuitListResult - The response of a ExpressRouteCircuit list operation. type ExpressRouteCircuitListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of ExpressRouteCircuits in a resource group. + // REQUIRED; The ExpressRouteCircuit items on this page Value []*ExpressRouteCircuit + + // The link to the next page of items + NextLink *string } // ExpressRouteCircuitPeering - Peering in an ExpressRouteCircuit resource. @@ -5279,7 +5200,7 @@ type ExpressRouteCircuitPeering struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the express route circuit peering. @@ -5288,7 +5209,7 @@ type ExpressRouteCircuitPeering struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -5322,14 +5243,13 @@ type ExpressRouteCircuitPeeringID struct { ID *string } -// ExpressRouteCircuitPeeringListResult - Response for ListPeering API service call retrieves all peerings that belong to -// an ExpressRouteCircuit. +// ExpressRouteCircuitPeeringListResult - The response of a ExpressRouteCircuitPeering list operation. type ExpressRouteCircuitPeeringListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The peerings in an express route circuit. + // REQUIRED; The ExpressRouteCircuitPeering items on this page Value []*ExpressRouteCircuitPeering + + // The link to the next page of items + NextLink *string } // ExpressRouteCircuitPeeringPropertiesFormat - Properties of the express route circuit peering. @@ -5533,30 +5453,30 @@ type ExpressRouteCircuitStats struct { // ExpressRouteCircuitsArpTableListResult - Response for ListArpTable associated with the Express Route Circuits API. type ExpressRouteCircuitsArpTableListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of the ARP tables. + // REQUIRED; The ExpressRouteCircuitArpTable items on this page Value []*ExpressRouteCircuitArpTable + + // The link to the next page of items + NextLink *string } // ExpressRouteCircuitsRoutesTableListResult - Response for ListRoutesTable associated with the Express Route Circuits API. type ExpressRouteCircuitsRoutesTableListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The list of routes table. + // REQUIRED; The ExpressRouteCircuitRoutesTable items on this page Value []*ExpressRouteCircuitRoutesTable + + // The link to the next page of items + NextLink *string } // ExpressRouteCircuitsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route Circuits // API. type ExpressRouteCircuitsRoutesTableSummaryListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of the routes table. + // REQUIRED; The ExpressRouteCircuitRoutesTableSummary items on this page Value []*ExpressRouteCircuitRoutesTableSummary + + // The link to the next page of items + NextLink *string } // ExpressRouteConnection resource. @@ -5635,12 +5555,12 @@ type ExpressRouteCrossConnection struct { Type *string } -// ExpressRouteCrossConnectionListResult - Response for ListExpressRouteCrossConnection API service call. +// ExpressRouteCrossConnectionListResult - The response of a ExpressRouteCrossConnection list operation. type ExpressRouteCrossConnectionListResult struct { - // A list of ExpressRouteCrossConnection resources. + // REQUIRED; The ExpressRouteCrossConnection items on this page Value []*ExpressRouteCrossConnection - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -5662,10 +5582,10 @@ type ExpressRouteCrossConnectionPeering struct { // ExpressRouteCrossConnectionPeeringList - Response for ListPeering API service call retrieves all peerings that belong to // an ExpressRouteCrossConnection. type ExpressRouteCrossConnectionPeeringList struct { - // The peerings in an express route cross connection. + // REQUIRED; The ExpressRouteCrossConnectionPeering items on this page Value []*ExpressRouteCrossConnectionPeering - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -5769,10 +5689,10 @@ type ExpressRouteCrossConnectionRoutesTableSummary struct { // ExpressRouteCrossConnectionsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route // Cross Connections. type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { - // A list of the routes table. + // REQUIRED; The ExpressRouteCrossConnectionRoutesTableSummary items on this page Value []*ExpressRouteCrossConnectionRoutesTableSummary - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } @@ -5941,6 +5861,8 @@ type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { Min *int32 } +// ExpressRouteLink +// // ExpressRouteLink child resource definition. type ExpressRouteLink struct { // Resource ID. @@ -5956,16 +5878,140 @@ type ExpressRouteLink struct { Etag *string } -// ExpressRouteLinkListResult - Response for ListExpressRouteLinks API service call. -type ExpressRouteLinkListResult struct { - // The URL to get the next set of results. - NextLink *string +// ExpressRouteLinkFailoverAllTestsDetails - ExpressRoute circuit link failover test details for all tests. +type ExpressRouteLinkFailoverAllTestsDetails struct { + // The BGP status details. + BgpStatus []*ExpressRouteLinkFailoverTestBgpStatus + + // The maintenance test category. + CircuitTestCategory *MaintenanceTestCategory + + // Time when the test was completed. + EndTime *string + + // A list of all issues with the test. + Issues []*string + + // The link type. + LinkType *ExpressRouteFailoverLinkType + + // Time when the test was started. + StartTime *string - // The list of ExpressRouteLink sub-resources. + // The current status of the test. + Status *FailoverTestStatus + + // The unique GUID associated with the test. + TestGUID *string + + // The type of failover test. + TestType *FailoverTestType + + // Whether the failover simulation was successful or not. + WasSimulationSuccessful *bool +} + +// ExpressRouteLinkFailoverRoute - Represents a failover route for an ExpressRoute link. +type ExpressRouteLinkFailoverRoute struct { + // The next hop. + NextHop *string + + // The AS path for primary link. + PrimaryASPath *string + + // The route. + Route *string + + // The AS path for secondary link. + SecondaryASPath *string +} + +// ExpressRouteLinkFailoverRouteList - Represents a list of failover routes for an ExpressRoute link. +type ExpressRouteLinkFailoverRouteList struct { + // The routes before the simulation. + BeforeSimulation []*ExpressRouteLinkFailoverRoute + + // The routes during the simulation. + DuringSimulation []*ExpressRouteLinkFailoverRoute +} + +// ExpressRouteLinkFailoverSingleTestDetails - ExpressRoute circuit link failover single test details. +type ExpressRouteLinkFailoverSingleTestDetails struct { + // The BGP status details. + BgpStatus []*ExpressRouteLinkFailoverTestBgpStatus + + // The circuit test category. + CircuitTestCategory *MaintenanceTestCategory + + // Time when the test was completed in UTC. + EndTimeUTC *string + + // Whether the simulation was verified. + IsSimulationVerified *bool + + // The link type. + LinkType *ExpressRouteFailoverLinkType + + // The non-redundant routes for link failover tests. + NonRedundantRoutes *ExpressRouteLinkFailoverRouteList + + // The redundant routes for link failover tests. + RedundantRoutes *ExpressRouteLinkFailoverRouteList + + // Time when the test was started in UTC. + StartTimeUTC *string + + // The current status of the test. + Status *FailoverTestStatus + + // Whether the failover simulation was successful or not. + WasSimulationSuccessful *bool +} + +// ExpressRouteLinkFailoverStopAPIParameters - Parameters for stopping an ExpressRoute circuit link failover test. +type ExpressRouteLinkFailoverStopAPIParameters struct { + // The category of the circuit test. + CircuitTestCategory *string + + // Whether the link is verified. + IsVerified *bool + + // The type of the link. + LinkType *string + + // Whether the simulation was successful. + WasSimulationSuccessful *bool +} + +// ExpressRouteLinkFailoverTestBgpStatus - Represents the BGP status of an ExpressRoute link failover test. +type ExpressRouteLinkFailoverTestBgpStatus struct { + // The check time in UTC. + CheckTimeUTC *string + + // The link type. + Link *ExpressRouteFailoverLinkType + + // The BGP status. + Status *ExpressRouteLinkFailoverBgpStatus + + // The address family type. + Type *ExpressRouteFailoverBgpStatusAddressFamily +} + +// ExpressRouteLinkListResult - ExpressRouteLink List Result +// +// Response for ListExpressRouteLinks API service call. +type ExpressRouteLinkListResult struct { + // REQUIRED; The ExpressRouteLink items on this page Value []*ExpressRouteLink + + // The link to the next page of items + NextLink *string } -// ExpressRouteLinkMacSecConfig - ExpressRouteLink Mac Security Configuration. +// ExpressRouteLinkMacSecConfig - Definition of ExpressRouteLink Mac Security configuration. +// +// ExpressRouteLink Mac Security Configuration. type ExpressRouteLinkMacSecConfig struct { // Keyvault Secret Identifier URL containing Mac security CAK key. CakSecretIdentifier *string @@ -5980,7 +6026,9 @@ type ExpressRouteLinkMacSecConfig struct { SciState *ExpressRouteLinkMacSecSciState } -// ExpressRouteLinkPropertiesFormat - Properties specific to ExpressRouteLink resources. +// ExpressRouteLinkPropertiesFormat - ExpressRouteLink Resource Properties +// +// Properties specific to ExpressRouteLink resources. type ExpressRouteLinkPropertiesFormat struct { // Administrative state of the physical port. AdminState *ExpressRouteLinkAdminState @@ -6010,6 +6058,8 @@ type ExpressRouteLinkPropertiesFormat struct { RouterName *string } +// ExpressRoutePort - ExpressRoute Port +// // ExpressRoutePort resource definition. type ExpressRoutePort struct { // Resource ID. @@ -6037,12 +6087,14 @@ type ExpressRoutePort struct { Type *string } -// ExpressRoutePortAuthorization - ExpressRoutePort Authorization resource definition. +// ExpressRoutePortAuthorization - ExpressRoute Port Authorization +// +// ExpressRoutePort Authorization resource definition. type ExpressRoutePortAuthorization struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // ExpressRoutePort properties. @@ -6051,20 +6103,24 @@ type ExpressRoutePortAuthorization struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } -// ExpressRoutePortAuthorizationListResult - Response for ListExpressRoutePortAuthorizations API service call. +// ExpressRoutePortAuthorizationListResult - ExpressRoute Port Authorization List Result +// +// Paged collection of ExpressRoutePortAuthorization items type ExpressRoutePortAuthorizationListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The authorizations in an ExpressRoute Port. + // REQUIRED; The ExpressRoutePortAuthorization items on this page Value []*ExpressRoutePortAuthorization + + // The link to the next page of items + NextLink *string } -// ExpressRoutePortAuthorizationPropertiesFormat - Properties of ExpressRoutePort Authorization. +// ExpressRoutePortAuthorizationPropertiesFormat - ExpressRoute Port Authorization Properties +// +// Properties of ExpressRoutePort Authorization. type ExpressRoutePortAuthorizationPropertiesFormat struct { // READ-ONLY; The authorization key. AuthorizationKey *string @@ -6079,16 +6135,20 @@ type ExpressRoutePortAuthorizationPropertiesFormat struct { ProvisioningState *ProvisioningState } -// ExpressRoutePortListResult - Response for ListExpressRoutePorts API service call. +// ExpressRoutePortListResult - ExpressRoute Port List Result +// +// Paged collection of ExpressRoutePort items type ExpressRoutePortListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of ExpressRoutePort resources. + // REQUIRED; The ExpressRoutePort items on this page Value []*ExpressRoutePort + + // The link to the next page of items + NextLink *string } -// ExpressRoutePortPropertiesFormat - Properties specific to ExpressRoutePort resources. +// ExpressRoutePortPropertiesFormat - ExpressRoutePort Properties +// +// Properties specific to ExpressRoutePort resources. type ExpressRoutePortPropertiesFormat struct { // Bandwidth of procured ports in Gbps. BandwidthInGbps *int32 @@ -6099,6 +6159,8 @@ type ExpressRoutePortPropertiesFormat struct { // Encapsulation method on physical ports. Encapsulation *ExpressRoutePortsEncapsulation + // ExpressRouteLink Sub-Resources + // // The set of physical links of the ExpressRoutePort resource. Links []*ExpressRouteLink @@ -6127,7 +6189,9 @@ type ExpressRoutePortPropertiesFormat struct { ResourceGUID *string } -// ExpressRoutePortsLocation - Definition of the ExpressRoutePorts peering location resource. +// ExpressRoutePortsLocation - ExpressRoutePorts Peering Location +// +// Definition of the ExpressRoutePorts peering location resource. type ExpressRoutePortsLocation struct { // Resource ID. ID *string @@ -6148,7 +6212,9 @@ type ExpressRoutePortsLocation struct { Type *string } -// ExpressRoutePortsLocationBandwidths - Real-time inventory of available ExpressRoute port bandwidths. +// ExpressRoutePortsLocationBandwidths - ExpressRoutePorts Location Bandwidths +// +// Real-time inventory of available ExpressRoute port bandwidths. type ExpressRoutePortsLocationBandwidths struct { // READ-ONLY; Bandwidth descriptive name. OfferName *string @@ -6157,16 +6223,20 @@ type ExpressRoutePortsLocationBandwidths struct { ValueInGbps *int32 } -// ExpressRoutePortsLocationListResult - Response for ListExpressRoutePortsLocations API service call. +// ExpressRoutePortsLocationListResult - ExpressRoutePorts Location List Result +// +// Paged collection of ExpressRoutePortsLocation items type ExpressRoutePortsLocationListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The list of all ExpressRoutePort peering locations. + // REQUIRED; The ExpressRoutePortsLocation items on this page Value []*ExpressRoutePortsLocation + + // The link to the next page of items + NextLink *string } -// ExpressRoutePortsLocationPropertiesFormat - Properties specific to ExpressRoutePorts peering location resources. +// ExpressRoutePortsLocationPropertiesFormat - ExpressRoutePorts Location Properties +// +// Properties specific to ExpressRoutePorts peering location resources. type ExpressRoutePortsLocationPropertiesFormat struct { // The inventory of available ExpressRoutePort bandwidths. AvailableBandwidths []*ExpressRoutePortsLocationBandwidths @@ -6183,9 +6253,6 @@ type ExpressRoutePortsLocationPropertiesFormat struct { // ExpressRouteProviderPort resource. type ExpressRouteProviderPort struct { - // Resource ID. - ID *string - // Resource location. Location *string @@ -6198,6 +6265,9 @@ type ExpressRouteProviderPort struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + // READ-ONLY; Resource ID. + ID *string + // READ-ONLY; Resource name. Name *string @@ -6207,10 +6277,10 @@ type ExpressRouteProviderPort struct { // ExpressRouteProviderPortListResult - Response for ListExpressRouteProviderPort API service call. type ExpressRouteProviderPortListResult struct { - // A list of ExpressRouteProviderPort resources. + // REQUIRED; The ExpressRouteProviderPort items on this page Value []*ExpressRouteProviderPort - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } @@ -6271,13 +6341,13 @@ type ExpressRouteServiceProviderBandwidthsOffered struct { ValueInMbps *int32 } -// ExpressRouteServiceProviderListResult - Response for the ListExpressRouteServiceProvider API service call. +// ExpressRouteServiceProviderListResult - The response of a ExpressRouteServiceProvider list operation. type ExpressRouteServiceProviderListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of ExpressRouteResourceProvider resources. + // REQUIRED; The ExpressRouteServiceProvider items on this page Value []*ExpressRouteServiceProvider + + // The link to the next page of items + NextLink *string } // ExpressRouteServiceProviderPropertiesFormat - Properties of ExpressRouteServiceProvider. @@ -6338,7 +6408,10 @@ type FirewallPacketCaptureParameters struct { // Number of packets to be captured. If the field is not provided, the default value is 1000. NumberOfPacketsToCapture *int32 - // The Azure Firewall packet capture operation to perform + // The packet capture operation to perform. If the Start operation is selected, please provide all the fields in the firewallPacketCaptureParameters + // to successfully initiate the packet capture. If the Status or Stop operation is selected, only the operation field is required; + // all other fields in the firewallPacketCaptureParameters can be omitted to successfully retrieve the capture status or stop + // the capture. Operation *AzureFirewallPacketCaptureOperationType // The protocol of packets to capture @@ -6436,7 +6509,8 @@ type FirewallPolicyDraftProperties struct { // FirewallPolicyFilterRuleCollection - Firewall Policy Filter Rule Collection. type FirewallPolicyFilterRuleCollection struct { - // REQUIRED; The type of the rule collection. + // CONSTANT; The type of the rule collection. + // Field has constant value FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection, any specified value is ignored. RuleCollectionType *FirewallPolicyRuleCollectionType // The action type of a Filter rule collection. @@ -6535,8 +6609,8 @@ type FirewallPolicyIntrusionDetectionConfiguration struct { BypassTrafficSettings []*FirewallPolicyIntrusionDetectionBypassTrafficSpecifications // IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only - // ranges defined by IANA RFC 1918 are considered private IP addresses. To modify - // default ranges, specify your Private IP address ranges with this property + // ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your Private IP + // address ranges with this property PrivateRanges []*string // List of specific signatures states. @@ -6552,13 +6626,13 @@ type FirewallPolicyIntrusionDetectionSignatureSpecification struct { Mode *FirewallPolicyIntrusionDetectionStateType } -// FirewallPolicyListResult - Response for ListFirewallPolicies API service call. +// FirewallPolicyListResult - The response of a FirewallPolicy list operation. type FirewallPolicyListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Firewall Policies in a resource group. + // REQUIRED; The FirewallPolicy items on this page Value []*FirewallPolicy + + // The link to the next page of items + NextLink *string } // FirewallPolicyLogAnalyticsResources - Log Analytics Resources for Firewall Policy Insights. @@ -6581,7 +6655,8 @@ type FirewallPolicyLogAnalyticsWorkspace struct { // FirewallPolicyNatRuleCollection - Firewall Policy NAT Rule Collection. type FirewallPolicyNatRuleCollection struct { - // REQUIRED; The type of the rule collection. + // CONSTANT; The type of the rule collection. + // Field has constant value FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection, any specified value is ignored. RuleCollectionType *FirewallPolicyRuleCollectionType // The action type of a Nat rule collection. @@ -6709,7 +6784,7 @@ type FirewallPolicyRuleCollectionGroup struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // The properties of the firewall policy rule collection group. @@ -6718,7 +6793,7 @@ type FirewallPolicyRuleCollectionGroup struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Rule Group type. + // READ-ONLY; Resource type. Type *string } @@ -6727,13 +6802,13 @@ type FirewallPolicyRuleCollectionGroupDraft struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // The properties of the firewall policy rule collection group. Properties *FirewallPolicyRuleCollectionGroupDraftProperties - // READ-ONLY; Rule Group type. + // READ-ONLY; Resource type. Type *string } @@ -6749,13 +6824,13 @@ type FirewallPolicyRuleCollectionGroupDraftProperties struct { Size *string } -// FirewallPolicyRuleCollectionGroupListResult - Response for ListFirewallPolicyRuleCollectionGroups API service call. +// FirewallPolicyRuleCollectionGroupListResult - The response of a FirewallPolicyRuleCollectionGroup list operation. type FirewallPolicyRuleCollectionGroupListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + // REQUIRED; The FirewallPolicyRuleCollectionGroup items on this page Value []*FirewallPolicyRuleCollectionGroup + + // The link to the next page of items + NextLink *string } // FirewallPolicyRuleCollectionGroupProperties - Properties of the rule collection group. @@ -6860,12 +6935,12 @@ type FlowLogInformation struct { Identity *ManagedServiceIdentity } -// FlowLogListResult - List of flow logs. +// FlowLogListResult - The response of a FlowLog list operation. type FlowLogListResult struct { - // Information about flow log resource. + // REQUIRED; The FlowLog items on this page Value []*FlowLog - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -6885,10 +6960,9 @@ type FlowLogProperties struct { Format *FlowLogFormatParameters // Optional field to filter network traffic logs based on flow states. Value of this field could be any comma separated combination - // string of letters B,C,E or D. B represents Begin, when a flow is - // created. C represents Continue for an ongoing flow generated at every five-minute interval. E represents End, when a flow - // is terminated. D represents Deny, when a flow is denied. If not specified, all - // network traffic will be logged. + // string of letters B,C,E or D. B represents Begin, when a flow is created. C represents Continue for an ongoing flow generated + // at every five-minute interval. E represents End, when a flow is terminated. D represents Deny, when a flow is denied. If + // not specified, all network traffic will be logged. RecordTypes *string // Parameters that define the retention policy for flow log. @@ -6917,10 +6991,9 @@ type FlowLogPropertiesFormat struct { Format *FlowLogFormatParameters // Optional field to filter network traffic logs based on flow states. Value of this field could be any comma separated combination - // string of letters B,C,E or D. B represents Begin, when a flow is - // created. C represents Continue for an ongoing flow generated at every five-minute interval. E represents End, when a flow - // is terminated. D represents Deny, when a flow is denied. If not specified, all - // network traffic will be logged. + // string of letters B,C,E or D. B represents Begin, when a flow is created. C represents Continue for an ongoing flow generated + // at every five-minute interval. E represents End, when a flow is terminated. D represents Deny, when a flow is denied. If + // not specified, all network traffic will be logged. RecordTypes *string // Parameters that define the retention policy for flow log. @@ -6944,8 +7017,7 @@ type FrontendIPConfiguration struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name - // can be used to access the resource. + // Name of the resource. Name *string // Properties of the load balancer probe. @@ -6957,12 +7029,15 @@ type FrontendIPConfiguration struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } // FrontendIPConfigurationPropertiesFormat - Properties of Frontend IP Configuration of the load balancer. type FrontendIPConfigurationPropertiesFormat struct { + // The DDoS protection settings associated with the frontend IP configuration. + DdosSettings *DdosFrontendIPConfigurationSettings + // The reference to gateway load balancer frontend IP. GatewayLoadBalancer *SubResource @@ -7162,19 +7237,19 @@ type GetOutboundRoutesParameters struct { // GetServiceGatewayAddressLocationsResult - Response for get service gateway address locations. type GetServiceGatewayAddressLocationsResult struct { - // A list of address locations of service gateway. + // REQUIRED; The ServiceGatewayAddressLocationResponse items on this page Value []*ServiceGatewayAddressLocationResponse - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } // GetServiceGatewayServicesResult - Response for get service gateway services. type GetServiceGatewayServicesResult struct { - // A list of services of service gateway. + // REQUIRED; The ServiceGatewayService items on this page Value []*ServiceGatewayService - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -7220,14 +7295,13 @@ type GroupByVariable struct { VariableName *ApplicationGatewayFirewallUserSessionVariable } -// GroupListResult - Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get the next -// set of results. +// GroupListResult - The response of a NetworkGroup list operation. type GroupListResult struct { - // Gets the URL to get the next set of results. - NextLink *string - - // Gets a page of NetworkGroup + // REQUIRED; The NetworkGroup items on this page Value []*Group + + // The link to the next page of items + NextLink *string } // GroupProperties - Properties of network group @@ -7267,8 +7341,8 @@ type HTTPHeader struct { } // HeaderValueMatcher - An optional field under "Rewrite Action". It lets you capture and modify the value(s) of a specific -// header when multiple headers with the same name exist. Currently supported for Set-Cookie Response -// header only. For more details, visit https://aka.ms/appgwheadercrud +// header when multiple headers with the same name exist. Currently supported for Set-Cookie Response header only. For more +// details, visit https://aka.ms/appgwheadercrud type HeaderValueMatcher struct { // Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. IgnoreCase *bool @@ -7336,7 +7410,7 @@ type HubIPConfiguration struct { // Resource ID. ID *string - // Name of the Ip Configuration. + // Name of the resource. Name *string // The properties of the Virtual Hub IPConfigurations. @@ -7345,7 +7419,7 @@ type HubIPConfiguration struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Ipconfiguration type. + // READ-ONLY; Resource type. Type *string } @@ -7399,7 +7473,7 @@ type HubRouteTable struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the RouteTable resource. @@ -7453,6 +7527,9 @@ type HubVirtualNetworkConnectionProperties struct { // Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. AllowRemoteVnetToUseHubVnetGateways *bool + // The resource id of the ConnectionPolicy associated with this HubVirtualNetworkConnection. + ConnectionPolicy *SubResource + // Enable internet security. EnableInternetSecurity *bool @@ -7520,13 +7597,13 @@ type IPAllocation struct { Type *string } -// IPAllocationListResult - Response for the ListIpAllocations API service call. +// IPAllocationListResult - The response of a IpAllocation list operation. type IPAllocationListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of IpAllocation resources. + // REQUIRED; The IpAllocation items on this page Value []*IPAllocation + + // The link to the next page of items + NextLink *string } // IPAllocationPropertiesFormat - Properties of the IpAllocation. @@ -7655,13 +7732,13 @@ type IPGroup struct { Type *string } -// IPGroupListResult - Response for the ListIpGroups API service call. +// IPGroupListResult - The response of a IpGroup list operation. type IPGroupListResult struct { - // URL to get the next set of results. - NextLink *string - - // The list of IpGroups information resources. + // REQUIRED; The IpGroup items on this page Value []*IPGroup + + // The link to the next page of items + NextLink *string } // IPGroupPropertiesFormat - The IpGroups property information. @@ -7809,8 +7886,8 @@ type InboundNatPoolPropertiesFormat struct { Protocol *TransportProtocol // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. + // Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + // after you create the endpoint. EnableFloatingIP *bool // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used @@ -7833,8 +7910,7 @@ type InboundNatRule struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be - // used to access the resource. + // Name of the resource. Name *string // Properties of load balancer inbound NAT rule. @@ -7843,16 +7919,16 @@ type InboundNatRule struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } -// InboundNatRuleListResult - Response for ListInboundNatRule API service call. +// InboundNatRuleListResult - The response of a InboundNatRule list operation. type InboundNatRuleListResult struct { - // A list of inbound NAT rules in a load balancer. + // REQUIRED; The InboundNatRule items on this page Value []*InboundNatRule - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -7880,8 +7956,8 @@ type InboundNatRulePropertiesFormat struct { BackendPort *int32 // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. + // Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + // after you create the endpoint. EnableFloatingIP *bool // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used @@ -7896,13 +7972,13 @@ type InboundNatRulePropertiesFormat struct { FrontendPort *int32 // The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. - // Individual inbound NAT rule port mappings will be created for each - // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + // Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable + // values range from 1 to 65534. FrontendPortRangeEnd *int32 // The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. - // Individual inbound NAT rule port mappings will be created for each - // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + // Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable + // values range from 1 to 65534. FrontendPortRangeStart *int32 // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. @@ -7925,7 +8001,7 @@ type InboundSecurityRule struct { // Resource ID. ID *string - // Name of security rule collection. + // Name of the resource. Name *string // The properties of the Inbound Security Rules. @@ -7934,7 +8010,7 @@ type InboundSecurityRule struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; NVA inbound security rule type. + // READ-ONLY; Resource type. Type *string } @@ -8015,6 +8091,63 @@ type IntentPolicyConfiguration struct { SourceNetworkIntentPolicy *IntentPolicy } +// InterconnectGroup - An interconnect group resource. +type InterconnectGroup struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the interconnect group. + Properties *InterconnectGroupPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// InterconnectGroupListResult - The response of a InterconnectGroup list operation. +type InterconnectGroupListResult struct { + // REQUIRED; The InterconnectGroup items on this page + Value []*InterconnectGroup + + // The link to the next page of items + NextLink *string +} + +// InterconnectGroupNodeAvailability - Represents node availability information for subgroups within an interconnect group. +type InterconnectGroupNodeAvailability struct { + // The list of subgroup node availability entries. + SubgroupsNodeAvailability []*SubgroupNodeAvailabilityEntry +} + +// InterconnectGroupPropertiesFormat - Interconnect group properties. +type InterconnectGroupPropertiesFormat struct { + // REQUIRED; The subgroup profile of the interconnect group resource. + SubgroupProfile *SubgroupProfile + + // Scope of interconnect group resource. + Scope *InterconnectGroupScope + + // READ-ONLY; The provisioning state of the interconnect group resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the interconnect group resource. + ResourceGUID *string + + // READ-ONLY; A list of subgroups of the interconnect group. + Subgroups []*Subgroup +} + // Interface - A network interface in a resource group. type Interface struct { // The extended location of the network interface. @@ -8054,21 +8187,18 @@ type InterfaceAssociation struct { // InterfaceDNSSettings - DNS settings of a network interface. type InterfaceDNSSettings struct { // List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' - // value cannot be combined with other IPs, it must be the only value in dnsServers - // collection. + // value cannot be combined with other IPs, it must be the only value in dnsServers collection. DNSServers []*string // Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. InternalDNSNameLabel *string // READ-ONLY; If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers - // from all NICs that are part of the Availability Set. This property is what is - // configured on each of those VMs. + // from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. AppliedDNSServers []*string // READ-ONLY; Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS - // name can be constructed by concatenating the VM name with the value of - // internalDomainNameSuffix. + // name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. InternalDomainNameSuffix *string // READ-ONLY; Fully qualified DNS name supporting internal communications between VMs in the same virtual network. @@ -8080,25 +8210,25 @@ type InterfaceIPConfiguration struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Network interface IP configuration properties. Properties *InterfaceIPConfigurationPropertiesFormat - // Resource type. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } -// InterfaceIPConfigurationListResult - Response for list ip configurations API service call. +// InterfaceIPConfigurationListResult - The response of a NetworkInterfaceIPConfiguration list operation. type InterfaceIPConfigurationListResult struct { - // A list of ip configurations. + // REQUIRED; The NetworkInterfaceIPConfiguration items on this page Value []*InterfaceIPConfiguration - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8134,7 +8264,7 @@ type InterfaceIPConfigurationPropertiesFormat struct { // Whether this is a primary customer address on the network interface. Primary *bool - // Private IP address of the IP configuration. It can be a single IP address or a CIDR block in the format /. + // Private IP address of the IP configuration. It can be a single IP address or a CIDR block in the format
/. PrivateIPAddress *string // The private IP address prefix length. If specified and the allocation method is dynamic, the service will allocate a CIDR @@ -8163,21 +8293,21 @@ type InterfaceIPConfigurationPropertiesFormat struct { ProvisioningState *ProvisioningState } -// InterfaceListResult - Response for the ListNetworkInterface API service call. +// InterfaceListResult - The response of a NetworkInterface list operation. type InterfaceListResult struct { - // A list of network interfaces in a resource group. + // REQUIRED; The NetworkInterface items on this page Value []*Interface - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// InterfaceLoadBalancerListResult - Response for list ip configurations API service call. +// InterfaceLoadBalancerListResult - Paged collection of LoadBalancer items type InterfaceLoadBalancerListResult struct { - // A list of load balancers. + // REQUIRED; The LoadBalancer items on this page Value []*LoadBalancer - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8259,7 +8389,7 @@ type InterfaceTapConfiguration struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the Virtual Network Tap configuration. @@ -8268,16 +8398,16 @@ type InterfaceTapConfiguration struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Sub Resource type. + // READ-ONLY; Resource type. Type *string } -// InterfaceTapConfigurationListResult - Response for list tap configurations API service call. +// InterfaceTapConfigurationListResult - The response of a NetworkInterfaceTapConfiguration list operation. type InterfaceTapConfigurationListResult struct { - // A list of tap configurations. + // REQUIRED; The NetworkInterfaceTapConfiguration items on this page Value []*InterfaceTapConfiguration - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8290,7 +8420,9 @@ type InterfaceTapConfigurationPropertiesFormat struct { ProvisioningState *ProvisioningState } -// InternetIngressPublicIPsProperties - Resource Uri of Public Ip for Standard Load Balancer Frontend End. +// InternetIngressPublicIPsProperties - Internet Ingress Public Ip Properties +// +// Resource Uri of Public Ip for Standard Load Balancer Frontend End. type InternetIngressPublicIPsProperties struct { // Resource Uri of Public Ip ID *string @@ -8307,7 +8439,7 @@ type IpamPool struct { // Resource tags. Tags map[string]*string - // READ-ONLY; String representing unique etag for the resource document. + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -8325,9 +8457,11 @@ type IpamPool struct { // IpamPoolList - List of IpamPool type IpamPoolList struct { - // The link used to get the next page of operations. + // REQUIRED; The IpamPool items on this page + Value []*IpamPool + + // The link to the next page of items NextLink *string - Value []*IpamPool } // IpamPoolPrefixAllocation - IpamPool prefix allocation reference. @@ -8357,11 +8491,11 @@ type IpamPoolProperties struct { // String representing parent IpamPool resource name. If empty the IpamPool will be a root pool. ParentPoolName *string - // Provisioning states of a resource. - ProvisioningState *ProvisioningState - // READ-ONLY; List of IP address type for the IpamPool. IPAddressType []*IPType + + // READ-ONLY; Provisioning states of a resource. + ProvisioningState *ProvisioningState } // IpamPoolUpdate - Represents the IpamPool update API request interface. @@ -8369,7 +8503,7 @@ type IpamPoolUpdate struct { // Represents the IpamPool update properties. Properties *IpamPoolUpdateProperties - // Dictionary of + // Dictionary of Tags map[string]*string } @@ -8381,188 +8515,197 @@ type IpamPoolUpdateProperties struct { DisplayName *string } -// ListHubRouteTablesResult - List of RouteTables and a URL nextLink to get the next set of results. -type ListHubRouteTablesResult struct { - // URL to get the next set of operation list results if there are any. +// ListConnectionPoliciesResult - List of ConnectionPolicies and a URL nextLink to get the next set of results. +type ListConnectionPoliciesResult struct { + // REQUIRED; The ConnectionPolicy items on this page + Value []*ConnectionPolicy + + // The link to the next page of items NextLink *string +} - // List of RouteTables. +// ListHubRouteTablesResult - List of RouteTables and a URL nextLink to get the next set of results. +type ListHubRouteTablesResult struct { + // REQUIRED; The HubRouteTable items on this page Value []*HubRouteTable + + // The link to the next page of items + NextLink *string } // ListHubVirtualNetworkConnectionsResult - List of HubVirtualNetworkConnections and a URL nextLink to get the next set of // results. type ListHubVirtualNetworkConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of HubVirtualNetworkConnections. + // REQUIRED; The HubVirtualNetworkConnection items on this page Value []*HubVirtualNetworkConnection + + // The link to the next page of items + NextLink *string } // ListP2SVPNGatewaysResult - Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL // nextLink to get the next set of results. type ListP2SVPNGatewaysResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of P2SVpnGateways. + // REQUIRED; The P2SVpnGateway items on this page Value []*P2SVPNGateway + + // The link to the next page of items + NextLink *string } // ListRouteMapsResult - List of RouteMaps and a URL nextLink to get the next set of results. type ListRouteMapsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of RouteMaps. + // REQUIRED; The RouteMap items on this page Value []*RouteMap + + // The link to the next page of items + NextLink *string } // ListRoutingIntentResult - List of the routing intent result and a URL nextLink to get the next set of results. type ListRoutingIntentResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of RoutingIntent resource. + // REQUIRED; The RoutingIntent items on this page Value []*RoutingIntent + + // The link to the next page of items + NextLink *string } // ListVPNConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains // a list of Vpn Connections and a URL nextLink to get the next set of results. type ListVPNConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of Vpn Connections. + // REQUIRED; The VpnConnection items on this page Value []*VPNConnection + + // The link to the next page of items + NextLink *string } // ListVPNGatewayNatRulesResult - Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a // list of Nat rules and a URL nextLink to get the next set of results. type ListVPNGatewayNatRulesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of Nat Rules. + // REQUIRED; The VpnGatewayNatRule items on this page Value []*VPNGatewayNatRule + + // The link to the next page of items + NextLink *string } // ListVPNGatewaysResult - Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink // to get the next set of results. type ListVPNGatewaysResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnGateways. + // REQUIRED; The VpnGateway items on this page Value []*VPNGateway + + // The link to the next page of items + NextLink *string } // ListVPNServerConfigurationPolicyGroupsResult - Result of the request to list VpnServerConfigurationPolicyGroups. It contains // a list of VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. type ListVPNServerConfigurationPolicyGroupsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnServerConfigurationPolicyGroups. + // REQUIRED; The VpnServerConfigurationPolicyGroup items on this page Value []*VPNServerConfigurationPolicyGroup + + // The link to the next page of items + NextLink *string } // ListVPNServerConfigurationsResult - Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations // and a URL nextLink to get the next set of results. type ListVPNServerConfigurationsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnServerConfigurations. + // REQUIRED; The VpnServerConfiguration items on this page Value []*VPNServerConfiguration + + // The link to the next page of items + NextLink *string } // ListVPNSiteLinkConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains // a list of Vpn Connections and a URL nextLink to get the next set of results. type ListVPNSiteLinkConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnSiteLinkConnections. + // REQUIRED; The VpnSiteLinkConnection items on this page Value []*VPNSiteLinkConnection + + // The link to the next page of items + NextLink *string } // ListVPNSiteLinksResult - Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink // to get the next set of results. type ListVPNSiteLinksResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnSitesLinks. + // REQUIRED; The VpnSiteLink items on this page Value []*VPNSiteLink + + // The link to the next page of items + NextLink *string } // ListVPNSitesResult - Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the // next set of results. type ListVPNSitesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VpnSites. + // REQUIRED; The VpnSite items on this page Value []*VPNSite + + // The link to the next page of items + NextLink *string } // ListVirtualHubBgpConnectionResults - VirtualHubBgpConnections list. type ListVirtualHubBgpConnectionResults struct { - // URL to get the next set of results. - NextLink *string - - // The list of VirtualHubBgpConnections. + // REQUIRED; The BgpConnection items on this page Value []*BgpConnection + + // The link to the next page of items + NextLink *string } // ListVirtualHubIPConfigurationResults - VirtualHubIpConfigurations list. type ListVirtualHubIPConfigurationResults struct { - // URL to get the next set of results. - NextLink *string - - // The list of VirtualHubIpConfigurations. + // REQUIRED; The HubIpConfiguration items on this page Value []*HubIPConfiguration + + // The link to the next page of items + NextLink *string } // ListVirtualHubRouteTableV2SResult - List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. type ListVirtualHubRouteTableV2SResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VirtualHubRouteTableV2s. + // REQUIRED; The VirtualHubRouteTableV2 items on this page Value []*VirtualHubRouteTableV2 + + // The link to the next page of items + NextLink *string } // ListVirtualHubsResult - Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink // to get the next set of results. type ListVirtualHubsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VirtualHubs. + // REQUIRED; The VirtualHub items on this page Value []*VirtualHub + + // The link to the next page of items + NextLink *string } // ListVirtualNetworkGatewayNatRulesResult - Result of the request to list all nat rules to a virtual network gateway. It // contains a list of Nat rules and a URL nextLink to get the next set of results. type ListVirtualNetworkGatewayNatRulesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of Nat Rules. + // REQUIRED; The VirtualNetworkGatewayNatRule items on this page Value []*VirtualNetworkGatewayNatRule + + // The link to the next page of items + NextLink *string } // ListVirtualWANsResult - Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink // to get the next set of results. type ListVirtualWANsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of VirtualWANs. + // REQUIRED; The VirtualWAN items on this page Value []*VirtualWAN + + // The link to the next page of items + NextLink *string } // LoadBalancer resource. @@ -8604,12 +8747,12 @@ type LoadBalancerBackendAddress struct { Properties *LoadBalancerBackendAddressPropertiesFormat } -// LoadBalancerBackendAddressPoolListResult - Response for ListBackendAddressPool API service call. +// LoadBalancerBackendAddressPoolListResult - Paged collection of BackendAddressPool items type LoadBalancerBackendAddressPoolListResult struct { - // A list of backend address pools in a load balancer. + // REQUIRED; The BackendAddressPool items on this page Value []*BackendAddressPool - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8638,12 +8781,12 @@ type LoadBalancerBackendAddressPropertiesFormat struct { NetworkInterfaceIPConfiguration *SubResource } -// LoadBalancerFrontendIPConfigurationListResult - Response for ListFrontendIPConfiguration API service call. +// LoadBalancerFrontendIPConfigurationListResult - Paged collection of FrontendIPConfiguration items type LoadBalancerFrontendIPConfigurationListResult struct { - // A list of frontend IP configurations in a load balancer. + // REQUIRED; The FrontendIPConfiguration items on this page Value []*FrontendIPConfiguration - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8674,39 +8817,39 @@ type LoadBalancerHealthPerRulePerBackendAddress struct { State *string } -// LoadBalancerListResult - Response for ListLoadBalancers API service call. +// LoadBalancerListResult - The response of a LoadBalancer list operation. type LoadBalancerListResult struct { - // A list of load balancers in a resource group. + // REQUIRED; The LoadBalancer items on this page Value []*LoadBalancer - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// LoadBalancerLoadBalancingRuleListResult - Response for ListLoadBalancingRule API service call. +// LoadBalancerLoadBalancingRuleListResult - Paged collection of LoadBalancingRule items type LoadBalancerLoadBalancingRuleListResult struct { - // A list of load balancing rules in a load balancer. + // REQUIRED; The LoadBalancingRule items on this page Value []*LoadBalancingRule - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// LoadBalancerOutboundRuleListResult - Response for ListOutboundRule API service call. +// LoadBalancerOutboundRuleListResult - Paged collection of OutboundRule items type LoadBalancerOutboundRuleListResult struct { - // A list of outbound rules in a load balancer. + // REQUIRED; The OutboundRule items on this page Value []*OutboundRule - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// LoadBalancerProbeListResult - Response for ListProbe API service call. +// LoadBalancerProbeListResult - Paged collection of Probe items type LoadBalancerProbeListResult struct { - // A list of probes in a load balancer. + // REQUIRED; The Probe items on this page Value []*Probe - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8719,17 +8862,15 @@ type LoadBalancerPropertiesFormat struct { FrontendIPConfigurations []*FrontendIPConfiguration // Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound - // NAT rules are created automatically for each NIC associated with the Load - // Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - // with defining inbound NAT rules. Inbound NAT pools are referenced from virtual - // machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They - // have to reference individual inbound NAT rules. + // NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. + // Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools + // are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference + // an inbound NAT pool. They have to reference individual inbound NAT rules. InboundNatPools []*InboundNatPool // Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive - // with defining an inbound NAT pool. Inbound NAT pools are referenced from - // virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. - // They have to reference individual inbound NAT rules. + // with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated + // with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. InboundNatRules []*InboundNatRule // Object collection representing the load balancing rules Gets the provisioning. @@ -8787,8 +8928,7 @@ type LoadBalancingRule struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can - // be used to access the resource. + // Name of the resource. Name *string // Properties of load balancer load balancing rule. @@ -8797,7 +8937,7 @@ type LoadBalancingRule struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -8829,8 +8969,8 @@ type LoadBalancingRulePropertiesFormat struct { EnableConnectionTracking *bool // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. + // Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + // after you create the endpoint. EnableFloatingIP *bool // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used @@ -8878,12 +9018,12 @@ type LocalNetworkGateway struct { Type *string } -// LocalNetworkGatewayListResult - Response for ListLocalNetworkGateways API service call. +// LocalNetworkGatewayListResult - The response of a LocalNetworkGateway list operation. type LocalNetworkGatewayListResult struct { - // A list of local network gateways that exists in a resource group. + // REQUIRED; The LocalNetworkGateway items on this page Value []*LocalNetworkGateway - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -8983,14 +9123,12 @@ type ManagedRulesDefinition struct { // ManagedServiceIdentity - Identity for the resource. type ManagedServiceIdentity struct { // The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created - // identity and a set of user assigned identities. The type 'None' will remove any - // identities from the virtual machine. + // identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Type *ResourceIdentityType // The list of user identities associated with resource. The user identity dictionary key references will be ARM resource - // ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + // ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentities // READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned // identity. @@ -9000,6 +9138,14 @@ type ManagedServiceIdentity struct { TenantID *string } +type ManagedServiceIdentityUserAssignedIdentities struct { + // READ-ONLY; The client id of user assigned identity. + ClientID *string + + // READ-ONLY; The principal id of user assigned identity. + PrincipalID *string +} + // Manager - The Managed Network resource type Manager struct { // Resource ID. @@ -9063,13 +9209,13 @@ type ManagerConnection struct { Type *string } -// ManagerConnectionListResult - List of network manager connections. +// ManagerConnectionListResult - The response of a NetworkManagerConnection list operation. type ManagerConnectionListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // List of network manager connections. + // REQUIRED; The NetworkManagerConnection items on this page Value []*ManagerConnection + + // The link to the next page of items + NextLink *string } // ManagerConnectionProperties - Information about the network manager connection. @@ -9149,14 +9295,13 @@ type ManagerEffectiveSecurityAdminRulesListResult struct { Value []EffectiveBaseSecurityAdminRuleClassification } -// ManagerListResult - Result of the request to list NetworkManager. It contains a list of network managers and a URL link -// to get the next set of results. +// ManagerListResult - The response of a NetworkManager list operation. type ManagerListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NetworkManager + // REQUIRED; The NetworkManager items on this page Value []*Manager + + // The link to the next page of items + NextLink *string } // ManagerProperties - Properties of Managed Network @@ -9210,13 +9355,13 @@ type ManagerRoutingConfiguration struct { Type *string } -// ManagerRoutingConfigurationListResult - A list of network manager routing configurations +// ManagerRoutingConfigurationListResult - The response of a NetworkManagerRoutingConfiguration list operation. type ManagerRoutingConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of routing configurations + // REQUIRED; The NetworkManagerRoutingConfiguration items on this page Value []*ManagerRoutingConfiguration + + // The link to the next page of items + NextLink *string } // ManagerRoutingConfigurationPropertiesFormat - Defines the routing configuration properties. @@ -9370,13 +9515,13 @@ type NatGateway struct { Type *string } -// NatGatewayListResult - Response for ListNatGateways API service call. +// NatGatewayListResult - The response of a NatGateway list operation. type NatGatewayListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of Nat Gateways that exists in a resource group. + // REQUIRED; The NatGateway items on this page Value []*NatGateway + + // The link to the next page of items + NextLink *string } // NatGatewayPropertiesFormat - Nat Gateway properties. @@ -9384,6 +9529,9 @@ type NatGatewayPropertiesFormat struct { // The idle timeout of the nat gateway. IdleTimeoutInMinutes *int32 + // Whether Nat64 is enabled for the NAT gateway resource. + Nat64 *Nat64State + // An array of public ip addresses V4 associated with the nat gateway resource. PublicIPAddresses []*SubResource @@ -9420,7 +9568,8 @@ type NatGatewaySKU struct { // NatRule - Rule of type nat. type NatRule struct { - // REQUIRED; Rule Type. + // CONSTANT; Rule Type. + // Field has constant value FirewallPolicyRuleTypeNatRule, any specified value is ignored. RuleType *FirewallPolicyRuleType // Description of the rule. @@ -9500,8 +9649,7 @@ type NextHopResult struct { NextHopType *NextHopType // The resource identifier for the route table associated with the route being returned. If the route being returned does - // not correspond to any user created routes then this field will be the string - // 'System Route'. + // not correspond to any user created routes then this field will be the string 'System Route'. RouteTableID *string } @@ -9523,14 +9671,13 @@ type NspAccessRule struct { Type *string } -// NspAccessRuleListResult - Result of the request to list NSP access rules. Contains a list of NSP access rules and a URL -// link to get the next set of results. +// NspAccessRuleListResult - The response of a NspAccessRule list operation. type NspAccessRuleListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP access rule + // REQUIRED; The NspAccessRule items on this page Value []*NspAccessRule + + // The link to the next page of items + NextLink *string } // NspAccessRuleProperties - Properties of NSP access rule. @@ -9598,14 +9745,13 @@ type NspAssociationProperties struct { ProvisioningState *NspProvisioningState } -// NspAssociationsListResult - Result of the request to list NSP resource associations. Contains a list of NSP resource associations -// and a URL link to get the next set of results. +// NspAssociationsListResult - Paged collection of NspAssociation items type NspAssociationsListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP resource associations + // REQUIRED; The NspAssociation items on this page Value []*NspAssociation + + // The link to the next page of items + NextLink *string } // NspLink - The network security perimeter link resource @@ -9626,21 +9772,19 @@ type NspLink struct { Type *string } -// NspLinkListResult - Result of the request to list NSP link resources. Contains a list of NSP link resources and a URL link -// to get the next set of results. +// NspLinkListResult - The response of a NspLink list operation. type NspLinkListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP Link resources. + // REQUIRED; The NspLink items on this page Value []*NspLink + + // The link to the next page of items + NextLink *string } // NspLinkProperties - Properties of NSP Link resource. type NspLinkProperties struct { // Perimeter ARM Id for the remote NSP with which the link gets created in Auto-approval mode. It should be used when the - // NSP admin have Microsoft.Network/networkSecurityPerimeters/linkPerimeter/action - // permission on the remote NSP resource. + // NSP admin have Microsoft.Network/networkSecurityPerimeters/linkPerimeter/action permission on the remote NSP resource. AutoApprovedRemotePerimeterResourceID *string // A message passed to the owner of the remote NSP link resource with this connection request. In case of Auto-approved flow, @@ -9655,16 +9799,14 @@ type NspLinkProperties struct { RemoteInboundProfiles []*string // READ-ONLY; Local Outbound profile names from which Outbound is allowed. In current version, it is readonly property and - // it's value is set to ['*'] to allow outbound from all profiles. In later version, user will - // be able to modify it. + // it's value is set to ['*'] to allow outbound from all profiles. In later version, user will be able to modify it. LocalOutboundProfiles []*string // READ-ONLY; The provisioning state of the NSP Link resource. ProvisioningState *NspLinkProvisioningState // READ-ONLY; Remote Outbound profile names from which Outbound is allowed. In current version, it is readonly property and - // it's value is set to ['*'] to allow outbound from all profiles. In later version, user - // will be able to modify it. + // it's value is set to ['*'] to allow outbound from all profiles. In later version, user will be able to modify it. RemoteOutboundProfiles []*string // READ-ONLY; Remote NSP Guid with which the link gets created. @@ -9695,14 +9837,13 @@ type NspLinkReference struct { Type *string } -// NspLinkReferenceListResult - Result of the request to list NSP linkReference resources. Contains a list of NSP linkReference -// resources and a URL link to get the next set of results. +// NspLinkReferenceListResult - The response of a NspLinkReference list operation. type NspLinkReferenceListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP LinkReference resources. + // REQUIRED; The NspLinkReference items on this page Value []*NspLinkReference + + // The link to the next page of items + NextLink *string } // NspLinkReferenceProperties - Properties of NSP LinkReference resource. @@ -9718,21 +9859,18 @@ type NspLinkReferenceProperties struct { Description *string // READ-ONLY; Local Outbound profile names from which Outbound is allowed. In current version, it is readonly property and - // it's value is set to ['*'] to allow outbound from all profiles. In later version, user will - // be able to modify it. + // it's value is set to ['*'] to allow outbound from all profiles. In later version, user will be able to modify it. LocalOutboundProfiles []*string // READ-ONLY; The provisioning state of the NSP LinkReference resource. ProvisioningState *NspLinkProvisioningState // READ-ONLY; Remote Inbound profile names to which Inbound is allowed. ['*'] value implies inbound is allowed to all profiles - // at remote perimeter. This property can only be updated from corresponding link resource - // present in remote perimeter. + // at remote perimeter. This property can only be updated from corresponding link resource present in remote perimeter. RemoteInboundProfiles []*string // READ-ONLY; Remote Outbound profile names from which Outbound is allowed. ['*'] value implies outbound is allowed from all - // profiles at remote perimeter. This property can only be updated from corresponding link - // resource present in remote perimeter. + // profiles at remote perimeter. This property can only be updated from corresponding link resource present in remote perimeter. RemoteOutboundProfiles []*string // READ-ONLY; Remote NSP Guid with which the link is created. @@ -9763,14 +9901,13 @@ type NspLoggingConfiguration struct { Type *string } -// NspLoggingConfigurationListResult - Result of the request to list NSP logging configuration. Contains a list of NSP logging -// configurations and a URL link to get the next set of results. +// NspLoggingConfigurationListResult - The response of a NspLoggingConfiguration list operation. type NspLoggingConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP logging configuration + // REQUIRED; The NspLoggingConfiguration items on this page Value []*NspLoggingConfiguration + + // The link to the next page of items + NextLink *string } // NspLoggingConfigurationProperties - The NSP logging configuration properties. @@ -9800,14 +9937,13 @@ type NspProfile struct { Type *string } -// NspProfileListResult - Result of the request to list NSP profiles. Contains a list of NSP profiles and a URL link to get -// the next set of results. +// NspProfileListResult - The response of a NspProfile list operation. type NspProfileListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NSP profile + // REQUIRED; The NspProfile items on this page Value []*NspProfile + + // The link to the next page of items + NextLink *string } // NspProfileProperties - Properties of NSP profile. @@ -9821,11 +9957,11 @@ type NspProfileProperties struct { // NspServiceTagsListResult - Result of the request to list NSP service tags. type NspServiceTagsListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets paged list of NSP service tags. + // REQUIRED; The NspServiceTagsResource items on this page Value []*NspServiceTagsResource + + // The link to the next page of items + NextLink *string } // NspServiceTagsResource - Resource containing list of NSP service tags. @@ -9834,7 +9970,9 @@ type NspServiceTagsResource struct { ServiceTags []*string } -// NvaInVnetSubnetReferenceProperties - The resource URI of the subnets where the NVA NICS will be deployed +// NvaInVnetSubnetReferenceProperties - Subnet references where the NVA NICS will be deployed +// +// The resource URI of the subnets where the NVA NICS will be deployed type NvaInVnetSubnetReferenceProperties struct { // Resource Uri of Subnet ID *string @@ -9849,8 +9987,7 @@ type NvaInterfaceConfigurationsProperties struct { Subnet *NvaInVnetSubnetReferenceProperties // Specifies the NIC types for the NVA interface configuration. Allowed values: PrivateNic, PublicNic, AdditionalPrivateNic, - // AdditionalPublicNic. Only the combination of PrivateNic and PublicNic is - // currently supported. + // AdditionalPublicNic. Only the combination of PrivateNic and PublicNic is currently supported. Type []*NvaNicType } @@ -9908,14 +10045,13 @@ type OperationDisplay struct { Resource *string } -// OperationListResult - Result of the request to list Network operations. It contains a list of operations and a URL link -// to get the next set of results. +// OperationListResult - Paged collection of Operation items type OperationListResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of Network operations supported by the Network resource provider. + // REQUIRED; The Operation items on this page Value []*Operation + + // The link to the next page of items + NextLink *string } // OperationPropertiesFormat - Description of operation properties format. @@ -9954,7 +10090,7 @@ type OperationStatusResult struct { Operations []*OperationStatusResult // Percent of the operation that is complete. - PercentComplete *float32 + PercentComplete *float64 // The start time of the operation. StartTime *time.Time @@ -9977,8 +10113,7 @@ type OutboundRule struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used - // to access the resource. + // Name of the resource. Name *string // Properties of load balancer outbound rule. @@ -9987,7 +10122,7 @@ type OutboundRule struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -10156,31 +10291,32 @@ type PacketCapture struct { // PacketCaptureFilter - Filter that is applied to packet capture request. Multiple filters can be applied. type PacketCaptureFilter struct { // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. - // "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently - // supported. Mixing ranges with multiple entries not currently supported. Default = null. + // "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries + // not currently supported. Default = null. LocalIPAddress *string // Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple - // ranges not currently supported. Mixing ranges with multiple entries not - // currently supported. Default = null. + // ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. LocalPort *string // Protocol to be filtered on. Protocol *PcProtocol // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. - // "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently - // supported. Mixing ranges with multiple entries not currently supported. Default = null. + // "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries + // not currently supported. Default = null. RemoteIPAddress *string // Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. - // Multiple ranges not currently supported. Mixing ranges with multiple entries not - // currently supported. Default = null. + // Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. RemotePort *string } // PacketCaptureListResult - List of packet capture sessions. type PacketCaptureListResult struct { + // URL to get the next set of results. + NextLink *string + // Information about packet capture sessions. Value []*PacketCaptureResult } @@ -10319,13 +10455,12 @@ type PacketCaptureSettings struct { // PacketCaptureStorageLocation - The storage location for a packet capture session. type PacketCaptureStorageLocation struct { // This path is invalid if 'Continuous Capture' is provided with 'true' or 'false'. A valid local path on the targeting VM. - // Must include the name of the capture file (*.cap). For linux virtual machine it - // must start with /var/captures. Required if no storage ID is provided, otherwise optional. + // Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required + // if no storage ID is provided, otherwise optional. FilePath *string // This path is valid if 'Continuous Capture' is provided with 'true' or 'false' and required if no storage ID is provided, - // otherwise optional. Must include the name of the capture file (*.cap). For - // linux virtual machine it must start with /var/captures. + // otherwise optional. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. LocalPath *string // The ID of the storage account to save the packet capture session. Required if no localPath or filePath is provided. @@ -10366,48 +10501,12 @@ type PatchObject struct { Tags map[string]*string } -// PatchRouteFilter - Route Filter Resource. -type PatchRouteFilter struct { - // Resource ID. - ID *string - - // Properties of the route filter. - Properties *RouteFilterPropertiesFormat - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string - - // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// PatchRouteFilterRule - Route Filter Rule Resource. -type PatchRouteFilterRule struct { - // Resource ID. - ID *string - - // Properties of the route filter rule. - Properties *RouteFilterRulePropertiesFormat - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string - - // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string -} - // PeerExpressRouteCircuitConnection - Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. type PeerExpressRouteCircuitConnection struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the peer express route circuit connection. @@ -10416,18 +10515,17 @@ type PeerExpressRouteCircuitConnection struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } -// PeerExpressRouteCircuitConnectionListResult - Response for ListPeeredConnections API service call retrieves all global -// reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. +// PeerExpressRouteCircuitConnectionListResult - The response of a PeerExpressRouteCircuitConnection list operation. type PeerExpressRouteCircuitConnectionListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. + // REQUIRED; The PeerExpressRouteCircuitConnection items on this page Value []*PeerExpressRouteCircuitConnection + + // The link to the next page of items + NextLink *string } // PeerExpressRouteCircuitConnectionPropertiesFormat - Properties of the peer express route circuit connection. @@ -10496,23 +10594,35 @@ type PerimeterAssociableResource struct { // PerimeterAssociableResourceProperties - Properties of the perimeter associable resources. type PerimeterAssociableResourceProperties struct { + // READ-ONLY; Description of the PaaS resource type. + Description *string + // READ-ONLY; A friendly name for the properties of perimeter associable resources. DisplayName *string + // READ-ONLY; Indicates whether the resource type supports outbound scenario. + OutboundSupported *bool + // READ-ONLY; Public DNS zone names of the resources. PublicDNSZones []*string + // READ-ONLY; The readiness state of the resource type for NSP support. + ReadinessState *NspReadinessState + // READ-ONLY; Resource type/provider name. ResourceType *string + + // READ-ONLY; Service tags associated with the resource provider. + ServiceTags []*string } -// PerimeterAssociableResourcesListResult - Paged list of perimeter associable resources. +// PerimeterAssociableResourcesListResult - Paged collection of PerimeterAssociableResource items type PerimeterAssociableResourcesListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets paged list of perimeter associable resources. + // REQUIRED; The PerimeterAssociableResource items on this page Value []*PerimeterAssociableResource + + // The link to the next page of items + NextLink *string } type PerimeterBasedAccessRule struct { @@ -10529,7 +10639,7 @@ type PerimeterBasedAccessRule struct { // PolicySettings - Defines contents of a web application firewall global configuration. type PolicySettings struct { // Web Application Firewall CAPTCHA Cookie Expiration time in minutes. - CaptchaCookieExpirationInMins *int32 + CaptchaExpirationInMins *int32 // If the action type is block, customer can override the response body. The body must be specified in base64 encoding. CustomBlockResponseBody *string @@ -10607,9 +10717,11 @@ type PoolAssociation struct { // PoolAssociationList - List of PoolAssociation type PoolAssociationList struct { - // The link used to get the next page of operations. + // REQUIRED; The PoolAssociation items on this page + Value []*PoolAssociation + + // The link to the next page of items NextLink *string - Value []*PoolAssociation } // PoolUsage - IpamPool usage information. @@ -10677,10 +10789,10 @@ type PrivateDNSZoneGroup struct { // PrivateDNSZoneGroupListResult - Response for the ListPrivateDnsZoneGroups API service call. type PrivateDNSZoneGroupListResult struct { - // A list of private dns zone group resources in a private endpoint. + // REQUIRED; The PrivateDnsZoneGroup items on this page Value []*PrivateDNSZoneGroup - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -10734,7 +10846,7 @@ type PrivateEndpointConnection struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the private end point connection. @@ -10743,16 +10855,16 @@ type PrivateEndpointConnection struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; The resource type. + // READ-ONLY; Resource type. Type *string } -// PrivateEndpointConnectionListResult - Response for the ListPrivateEndpointConnection API service call. +// PrivateEndpointConnectionListResult - The response of a PrivateEndpointConnection list operation. type PrivateEndpointConnectionListResult struct { - // A list of PrivateEndpointConnection resources for a specific private link service. + // REQUIRED; The PrivateEndpointConnection items on this page Value []*PrivateEndpointConnection - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -10801,12 +10913,12 @@ type PrivateEndpointIPConfigurationProperties struct { PrivateIPAddress *string } -// PrivateEndpointListResult - Response for the ListPrivateEndpoints API service call. +// PrivateEndpointListResult - The response of a PrivateEndpoint list operation. type PrivateEndpointListResult struct { - // A list of private endpoint resources in a resource group. + // REQUIRED; The PrivateEndpoint items on this page Value []*PrivateEndpoint - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -10815,6 +10927,9 @@ type PrivateEndpointProperties struct { // Application security groups in which the private endpoint IP configuration is included. ApplicationSecurityGroups []*ApplicationSecurityGroup + // The billing sku of the private endpoint. + BillingSKU *PrivateEndpointBillingSKU + // An array of custom dns configurations. CustomDNSConfigs []*CustomDNSConfigPropertiesFormat @@ -10959,12 +11074,12 @@ type PrivateLinkServiceIPConfigurationProperties struct { ProvisioningState *ProvisioningState } -// PrivateLinkServiceListResult - Response for the ListPrivateLinkService API service call. +// PrivateLinkServiceListResult - The response of a PrivateLinkService list operation. type PrivateLinkServiceListResult struct { - // A list of PrivateLinkService resources in a resource group. + // REQUIRED; The PrivateLinkService items on this page Value []*PrivateLinkService - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -11030,8 +11145,7 @@ type Probe struct { // Resource ID. ID *string - // The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access - // the resource. + // Name of the resource. Name *string // Properties of load balancer probe. @@ -11040,7 +11154,7 @@ type Probe struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Type of the resource. + // READ-ONLY; Resource type. Type *string } @@ -11050,27 +11164,24 @@ type ProbePropertiesFormat struct { Port *int32 // REQUIRED; The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. - // If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required - // for the probe to be successful. + // If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Protocol *ProbeProtocol // The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly - // less than half the allocated timeout period (in seconds) which allows two full - // probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + // less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of + // rotation. The default value is 15, the minimum value is 5. IntervalInSeconds *int32 // Determines how new connections are handled by the load balancer when all backend instances are probed down. NoHealthyBackendsBehavior *ProbeNoHealthyBackendsBehavior // The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. - // This values allows endpoints to be taken out of rotation faster or slower than - // the typical times used in Azure. + // This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. NumberOfProbes *int32 // The number of consecutive successful or failed probes in order to allow or deny traffic from being delivered to this endpoint. - // After failing the number of consecutive probes equal to this value, the - // endpoint will be taken out of rotation and require the same number of successful consecutive probes to be placed back in - // rotation. + // After failing the number of consecutive probes equal to this value, the endpoint will be taken out of rotation and require + // the same number of successful consecutive probes to be placed back in rotation. ProbeThreshold *int32 // The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is @@ -11108,13 +11219,13 @@ type Profile struct { Type *string } -// ProfileListResult - Response for ListNetworkProfiles API service call. +// ProfileListResult - The response of a NetworkProfile list operation. type ProfileListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of network profiles that exist in a resource group. + // REQUIRED; The NetworkProfile items on this page Value []*Profile + + // The link to the next page of items + NextLink *string } // ProfilePropertiesFormat - Network profile properties. @@ -11147,21 +11258,6 @@ type ProtocolConfiguration struct { HTTPConfiguration *HTTPConfiguration } -// ProxyResource - Proxy resource representation. -type ProxyResource struct { - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - // PublicIPAddress - Public IP address resource. type PublicIPAddress struct { // The extended location of the public ip address. @@ -11198,13 +11294,12 @@ type PublicIPAddress struct { // PublicIPAddressDNSSettings - Contains FQDN of the DNS record associated with the public IP address. type PublicIPAddressDNSSettings struct { // The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified - // domain name associated with the public IP address. If a domain name label is - // specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + // domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for + // the public IP in the Microsoft Azure DNS system. DomainNameLabel *string // The domain name label scope. If a domain name label and a domain name label scope are specified, an A DNS record is created - // for the public IP in the Microsoft Azure DNS system with a hashed value - // includes in FQDN. + // for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN. DomainNameLabelScope *PublicIPAddressDNSSettingsDomainNameLabelScope // The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel @@ -11212,18 +11307,17 @@ type PublicIPAddressDNSSettings struct { Fqdn *string // The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn - // is specified, then a PTR DNS record is created pointing from the IP address in - // the in-addr.arpa domain to the reverse FQDN. + // is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ReverseFqdn *string } -// PublicIPAddressListResult - Response for ListPublicIpAddresses API service call. +// PublicIPAddressListResult - The response of a PublicIPAddress list operation. type PublicIPAddressListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of public IP addresses that exists in a resource group. + // REQUIRED; The PublicIPAddress items on this page Value []*PublicIPAddress + + // The link to the next page of items + NextLink *string } // PublicIPAddressPropertiesFormat - Public IP address properties. @@ -11334,13 +11428,13 @@ type PublicIPPrefix struct { Type *string } -// PublicIPPrefixListResult - Response for ListPublicIpPrefixes API service call. +// PublicIPPrefixListResult - The response of a PublicIPPrefix list operation. type PublicIPPrefixListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of public IP prefixes that exists in a resource group. + // REQUIRED; The PublicIPPrefix items on this page Value []*PublicIPPrefix + + // The link to the next page of items + NextLink *string } // PublicIPPrefixPropertiesFormat - Public IP prefix properties. @@ -11467,11 +11561,11 @@ type RadiusAuthServer struct { // RadiusAuthServerListResult - List of Radius servers with respective radius secrets. type RadiusAuthServerListResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string - - // List of Radius servers with respective radius secrets. + // REQUIRED; The RadiusAuthServer items on this page Value []*RadiusAuthServer + + // The link to the next page of items + NextLink *string } // RadiusServer - Radius Server Settings. @@ -11483,8 +11577,7 @@ type RadiusServer struct { RadiusServerScore *int64 // The secret used for this radius server. We will no longer return radiusServerSecret in VirtualNetworkGateway Create/Update/Get/List/UpdateTags - // APIs response. Please use VirtualNetworkGateway - // ListRadiusSecrets API to fetch radius server secrets. + // APIs response. Please use VirtualNetworkGateway ListRadiusSecrets API to fetch radius server secrets. RadiusServerSecret *string } @@ -11499,20 +11592,20 @@ type ReachabilityAnalysisIntent struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ReachabilityAnalysisIntentListResult - A list of Reachability Analysis Intents. +// ReachabilityAnalysisIntentListResult - The response of a ReachabilityAnalysisIntent list operation. type ReachabilityAnalysisIntentListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of Reachability Analysis Intents + // REQUIRED; The ReachabilityAnalysisIntent items on this page Value []*ReachabilityAnalysisIntent + + // The link to the next page of items + NextLink *string } // ReachabilityAnalysisIntentProperties - Represents the Reachability Analysis Intent properties. @@ -11527,7 +11620,7 @@ type ReachabilityAnalysisIntentProperties struct { SourceResourceID *string Description *string - // Provisioning states of a resource. + // READ-ONLY; Provisioning states of a resource. ProvisioningState *ProvisioningState } @@ -11542,20 +11635,20 @@ type ReachabilityAnalysisRun struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ReachabilityAnalysisRunListResult - A list of Reachability Analysis Run +// ReachabilityAnalysisRunListResult - The response of a ReachabilityAnalysisRun list operation. type ReachabilityAnalysisRunListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of Reachability Analysis Runs. + // REQUIRED; The ReachabilityAnalysisRun items on this page Value []*ReachabilityAnalysisRun + + // The link to the next page of items + NextLink *string } // ReachabilityAnalysisRunProperties - Represents the Reachability Analysis Run properties. @@ -11564,9 +11657,6 @@ type ReachabilityAnalysisRunProperties struct { IntentID *string Description *string - // Provisioning states of a resource. - ProvisioningState *ProvisioningState - // READ-ONLY AnalysisResult *string @@ -11575,6 +11665,9 @@ type ReachabilityAnalysisRunProperties struct { // READ-ONLY; Intent information. IntentContent *IntentContent + + // READ-ONLY; Provisioning states of a resource. + ProvisioningState *ProvisioningState } // RecordSet - A collective group of information about the record set information. @@ -11625,24 +11718,6 @@ type ResiliencyRecommendationComponents struct { Recommendations []*GatewayResiliencyRecommendation } -// Resource - Common resource representation. -type Resource struct { - // Resource ID. - ID *string - - // Resource location. - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - // ResourceBasics - Representation of basic resource information. type ResourceBasics struct { // List of IP address prefixes of the resource. @@ -11654,9 +11729,6 @@ type ResourceBasics struct { // ResourceNavigationLink resource. type ResourceNavigationLink struct { - // Resource ID. - ID *string - // Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string @@ -11666,6 +11738,9 @@ type ResourceNavigationLink struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + // READ-ONLY; Resource navigation link identifier. + ID *string + // READ-ONLY; Resource type. Type *string } @@ -11682,21 +11757,15 @@ type ResourceNavigationLinkFormat struct { ProvisioningState *ProvisioningState } -// ResourceNavigationLinksListResult - Response for ResourceNavigationLinks_List operation. +// ResourceNavigationLinksListResult - Paged collection of ResourceNavigationLink items type ResourceNavigationLinksListResult struct { - // The resource navigation links in a subnet. + // REQUIRED; The ResourceNavigationLink items on this page Value []*ResourceNavigationLink - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } -// ResourceSet - The base resource set for visibility and auto-approval. -type ResourceSet struct { - // The list of subscriptions. - Subscriptions []*string -} - // RetentionPolicyParameters - Parameters that define the retention policy for flow log. type RetentionPolicyParameters struct { // Number of days to retain flow log records. @@ -11711,17 +11780,17 @@ type Route struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the route. Properties *RoutePropertiesFormat - // The type of the resource. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } // RouteFilter - Route Filter Resource. @@ -11748,13 +11817,13 @@ type RouteFilter struct { Type *string } -// RouteFilterListResult - Response for the ListRouteFilters API service call. +// RouteFilterListResult - The response of a RouteFilter list operation. type RouteFilterListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of route filters in a resource group. + // REQUIRED; The RouteFilter items on this page Value []*RouteFilter + + // The link to the next page of items + NextLink *string } // RouteFilterPropertiesFormat - Route Filter Resource. @@ -11792,11 +11861,11 @@ type RouteFilterRule struct { // RouteFilterRuleListResult - Response for the ListRouteFilterRules API service call. type RouteFilterRuleListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of RouteFilterRules in a resource group. + // REQUIRED; The RouteFilterRule items on this page Value []*RouteFilterRule + + // The link to the next page of items + NextLink *string } // RouteFilterRulePropertiesFormat - Route Filter Rule Resource. @@ -11814,30 +11883,30 @@ type RouteFilterRulePropertiesFormat struct { ProvisioningState *ProvisioningState } -// RouteListResult - Response for the ListRoute API service call. +// RouteListResult - The response of a Route list operation. type RouteListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of routes in a resource group. + // REQUIRED; The Route items on this page Value []*Route + + // The link to the next page of items + NextLink *string } // RouteMap - The RouteMap child resource of a Virtual hub. type RouteMap struct { - // Resource ID. - ID *string - // Properties of the RouteMap resource. Properties *RouteMapProperties // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Name of the resource. Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Type of the resource. Type *string } @@ -11871,6 +11940,12 @@ type RouteMapRule struct { NextStepIfMatched *NextStep } +// RouteNextHopEcmp - The next hop definition for ECMP routes containing multiple next hop IP addresses. +type RouteNextHopEcmp struct { + // REQUIRED; List of next hop IP addresses for ECMP routing. Must contain between 2 and 64 IP addresses. + NextHopIPAddresses []*string +} + // RoutePropertiesFormat - Route resource. type RoutePropertiesFormat struct { // REQUIRED; The type of Azure hop the packet should be sent to. @@ -11879,6 +11954,9 @@ type RoutePropertiesFormat struct { // The destination CIDR to which the route applies. AddressPrefix *string + // The next hop definition containing ECMP next hop IP addresses. Only allowed when nextHopType is VirtualApplianceEcmp. + NextHop *RouteNextHopEcmp + // The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. NextHopIPAddress *string @@ -11924,13 +12002,13 @@ type RouteTable struct { Type *string } -// RouteTableListResult - Response for the ListRouteTable API service call. +// RouteTableListResult - The response of a RouteTable list operation. type RouteTableListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of route tables in a resource group. + // REQUIRED; The RouteTable items on this page Value []*RouteTable + + // The link to the next page of items + NextLink *string } // RouteTablePropertiesFormat - Route Table resource. @@ -11938,6 +12016,10 @@ type RouteTablePropertiesFormat struct { // Whether to disable the routes learned by BGP on that route table. True means disable. DisableBgpRoutePropagation *bool + // Whether to disable the routes learned by peering on the route table. 'None' means peering routes are enabled, 'All' means + // all peering routes are disabled. + DisablePeeringRoute *DisablePeeringRoute + // Collection of routes contained within a route table. Routes []*Route @@ -11986,7 +12068,7 @@ type RoutingIntent struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the RoutingIntent resource. @@ -12062,13 +12144,13 @@ type RoutingRuleCollection struct { Type *string } -// RoutingRuleCollectionListResult - Routing configuration rule collection list result. +// RoutingRuleCollectionListResult - The response of a RoutingRuleCollection list operation. type RoutingRuleCollectionListResult struct { - // Gets the URL to get the next set of results. - NextLink *string - - // A list of network manager routing configuration rule collections + // REQUIRED; The RoutingRuleCollection items on this page Value []*RoutingRuleCollection + + // The link to the next page of items + NextLink *string } // RoutingRuleCollectionPropertiesFormat - Defines the routing rule collection properties. @@ -12089,13 +12171,13 @@ type RoutingRuleCollectionPropertiesFormat struct { ResourceGUID *string } -// RoutingRuleListResult - Routing configuration rule list result. +// RoutingRuleListResult - The response of a RoutingRule list operation. type RoutingRuleListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of routing rules. + // REQUIRED; The RoutingRule items on this page Value []*RoutingRule + + // The link to the next page of items + NextLink *string } // RoutingRuleNextHop - Next hop. @@ -12136,7 +12218,8 @@ type RoutingRuleRouteDestination struct { // Rule of type network. type Rule struct { - // REQUIRED; Rule Type. + // CONSTANT; Rule Type. + // Field has constant value FirewallPolicyRuleTypeNetworkRule, any specified value is ignored. RuleType *FirewallPolicyRuleType // Description of the rule. @@ -12203,13 +12286,13 @@ type ScopeConnection struct { Type *string } -// ScopeConnectionListResult - List of scope connections. +// ScopeConnectionListResult - The response of a ScopeConnection list operation. type ScopeConnectionListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // List of scope connections. + // REQUIRED; The ScopeConnection items on this page Value []*ScopeConnection + + // The link to the next page of items + NextLink *string } // ScopeConnectionProperties - Scope connection. @@ -12248,13 +12331,13 @@ type SecurityAdminConfiguration struct { Type *string } -// SecurityAdminConfigurationListResult - A list of network manager security admin configurations +// SecurityAdminConfigurationListResult - The response of a SecurityAdminConfiguration list operation. type SecurityAdminConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of security admin configurations + // REQUIRED; The SecurityAdminConfiguration items on this page Value []*SecurityAdminConfiguration + + // The link to the next page of items + NextLink *string } // SecurityAdminConfigurationPropertiesFormat - Defines the security admin configuration properties. @@ -12299,13 +12382,13 @@ type SecurityGroup struct { Type *string } -// SecurityGroupListResult - Response for ListNetworkSecurityGroups API service call. +// SecurityGroupListResult - The response of a NetworkSecurityGroup list operation. type SecurityGroupListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of NetworkSecurityGroup resources. + // REQUIRED; The NetworkSecurityGroup items on this page Value []*SecurityGroup + + // The link to the next page of items + NextLink *string } // SecurityGroupNetworkInterface - Network interface and all its associated security rules. @@ -12388,15 +12471,15 @@ type SecurityPartnerProvider struct { // READ-ONLY; Resource type. Type *string -} - -// SecurityPartnerProviderListResult - Response for ListSecurityPartnerProviders API service call. -type SecurityPartnerProviderListResult struct { - // URL to get the next set of results. - NextLink *string +} - // List of Security Partner Providers in a resource group. +// SecurityPartnerProviderListResult - The response of a SecurityPartnerProvider list operation. +type SecurityPartnerProviderListResult struct { + // REQUIRED; The SecurityPartnerProvider items on this page Value []*SecurityPartnerProvider + + // The link to the next page of items + NextLink *string } // SecurityPartnerProviderPropertiesFormat - Properties of the Security Partner Provider. @@ -12438,14 +12521,13 @@ type SecurityPerimeter struct { Type *string } -// SecurityPerimeterListResult - Result of the request to list NetworkSecurityPerimeter. It contains a list of network security -// perimeters and a URL link to get the next set of results. +// SecurityPerimeterListResult - The response of a NetworkSecurityPerimeter list operation. type SecurityPerimeterListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of NetworkSecurityPerimeter + // REQUIRED; The NetworkSecurityPerimeter items on this page Value []*SecurityPerimeter + + // The link to the next page of items + NextLink *string } // SecurityPerimeterProperties - Properties of network security perimeter. @@ -12457,37 +12539,6 @@ type SecurityPerimeterProperties struct { ProvisioningState *NspProvisioningState } -// SecurityPerimeterProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type SecurityPerimeterProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SecurityPerimeterSystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// SecurityPerimeterResource - Common fields that are returned in the response for all Azure Resource Manager resources -type SecurityPerimeterResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SecurityPerimeterSystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // SecurityPerimeterSystemData - Metadata pertaining to creation and last modification of the resource. type SecurityPerimeterSystemData struct { // The timestamp of resource creation (UTC). @@ -12514,17 +12565,17 @@ type SecurityRule struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the security rule. Properties *SecurityRulePropertiesFormat - // The type of the resource. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } // SecurityRuleAssociations - All security rules associated with the network interface. @@ -12542,14 +12593,13 @@ type SecurityRuleAssociations struct { SubnetAssociation *SubnetAssociation } -// SecurityRuleListResult - Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a -// network security group. +// SecurityRuleListResult - The response of a SecurityRule list operation. type SecurityRuleListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The security rules in a network security group. + // REQUIRED; The SecurityRule items on this page Value []*SecurityRule + + // The link to the next page of items + NextLink *string } // SecurityRulePropertiesFormat - Security rule resource. @@ -12571,8 +12621,7 @@ type SecurityRulePropertiesFormat struct { Description *string // The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default - // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also - // be used. + // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. DestinationAddressPrefix *string // The destination address prefixes. CIDR or destination IP ranges. @@ -12588,8 +12637,8 @@ type SecurityRulePropertiesFormat struct { DestinationPortRanges []*string // The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress - // rule, specifies where network traffic originates from. + // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates + // from. SourceAddressPrefix *string // The CIDR or source IP ranges. @@ -12650,13 +12699,13 @@ type SecurityUserConfiguration struct { Type *string } -// SecurityUserConfigurationListResult - A list of network manager security user configurations +// SecurityUserConfigurationListResult - The response of a SecurityUserConfiguration list operation. type SecurityUserConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of security user configurations + // REQUIRED; The SecurityUserConfiguration items on this page Value []*SecurityUserConfiguration + + // The link to the next page of items + NextLink *string } // SecurityUserConfigurationPropertiesFormat - Defines the security user configuration properties. @@ -12719,13 +12768,13 @@ type SecurityUserRuleCollection struct { Type *string } -// SecurityUserRuleCollectionListResult - Security user configuration rule collection list result. +// SecurityUserRuleCollectionListResult - The response of a SecurityUserRuleCollection list operation. type SecurityUserRuleCollectionListResult struct { - // Gets the URL to get the next set of results. - NextLink *string - - // A list of network manager security user configuration rule collections + // REQUIRED; The SecurityUserRuleCollection items on this page Value []*SecurityUserRuleCollection + + // The link to the next page of items + NextLink *string } // SecurityUserRuleCollectionPropertiesFormat - Defines the security user rule collection properties. @@ -12743,13 +12792,13 @@ type SecurityUserRuleCollectionPropertiesFormat struct { ResourceGUID *string } -// SecurityUserRuleListResult - security user rule list result. +// SecurityUserRuleListResult - The response of a SecurityUserRule list operation. type SecurityUserRuleListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of security user rules + // REQUIRED; The SecurityUserRule items on this page Value []*SecurityUserRule + + // The link to the next page of items + NextLink *string } // SecurityUserRulePropertiesFormat - Security rule resource. @@ -12818,12 +12867,12 @@ type ServiceAssociationLinkPropertiesFormat struct { ProvisioningState *ProvisioningState } -// ServiceAssociationLinksListResult - Response for ServiceAssociationLinks_List operation. +// ServiceAssociationLinksListResult - Paged collection of ServiceAssociationLink items type ServiceAssociationLinksListResult struct { - // The service association links in a subnet. + // REQUIRED; The ServiceAssociationLink items on this page Value []*ServiceAssociationLink - // READ-ONLY; The URL to get the next set of results. + // READ-ONLY; The link to the next page of items NextLink *string } @@ -12871,27 +12920,26 @@ type ServiceEndpointPolicyDefinition struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the service endpoint policy definition. Properties *ServiceEndpointPolicyDefinitionPropertiesFormat - // The type of the resource. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } -// ServiceEndpointPolicyDefinitionListResult - Response for ListServiceEndpointPolicyDefinition API service call. Retrieves -// all service endpoint policy definition that belongs to a service endpoint policy. +// ServiceEndpointPolicyDefinitionListResult - The response of a ServiceEndpointPolicyDefinition list operation. type ServiceEndpointPolicyDefinitionListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The service endpoint policy definition in a service endpoint policy. + // REQUIRED; The ServiceEndpointPolicyDefinition items on this page Value []*ServiceEndpointPolicyDefinition + + // The link to the next page of items + NextLink *string } // ServiceEndpointPolicyDefinitionPropertiesFormat - Service Endpoint policy definition resource. @@ -12909,12 +12957,12 @@ type ServiceEndpointPolicyDefinitionPropertiesFormat struct { ProvisioningState *ProvisioningState } -// ServiceEndpointPolicyListResult - Response for ListServiceEndpointPolicies API service call. +// ServiceEndpointPolicyListResult - The response of a ServiceEndpointPolicy list operation. type ServiceEndpointPolicyListResult struct { - // A list of ServiceEndpointPolicy resources. + // REQUIRED; The ServiceEndpointPolicy items on this page Value []*ServiceEndpointPolicy - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -12969,7 +13017,7 @@ type ServiceGateway struct { Tags map[string]*string // A list of availability zones denoting the zone in which service gateway should be deployed. - // * The zone values must be provided as strings representing numeric identifiers like "1", "2", "3" etc. + // - The zone values must be provided as strings representing numeric identifiers like "1", "2", "3" etc. Zones []*string // READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -13003,9 +13051,9 @@ type ServiceGatewayAddressLocation struct { AddressLocation *string // Specifies the type of update operation to perform on addresses within the address location of service gateway. - // * FullUpdate: Replaces all existing address data with the new list provided in the request. Any previously defined addresses + // - FullUpdate: Replaces all existing address data with the new list provided in the request. Any previously defined addresses // not included will be removed. - // * PartialUpdate: Updates only the specified addresses. + // - PartialUpdate: Updates only the specified addresses. AddressUpdateAction *AddressUpdateAction // An array of addresses to create or update in locations. @@ -13021,12 +13069,12 @@ type ServiceGatewayAddressLocationResponse struct { Addresses []*ServiceGatewayAddress } -// ServiceGatewayListResult - Response for ListServiceGateways API service call. +// ServiceGatewayListResult - The response of a ServiceGateway list operation. type ServiceGatewayListResult struct { - // A list of service gateway in a resource group. + // REQUIRED; The ServiceGateway items on this page Value []*ServiceGateway - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -13093,9 +13141,9 @@ type ServiceGatewayServiceRequest struct { // ServiceGatewayUpdateAddressLocationsRequest - Properties of the service gateway update address locations request. type ServiceGatewayUpdateAddressLocationsRequest struct { // Specifies the type of update operation to perform on address locations within the service gateway. - // * FullUpdate: Replaces all existing address location data with the new list provided in the request. Any previously defined + // - FullUpdate: Replaces all existing address location data with the new list provided in the request. Any previously defined // locations not included will be removed. - // * PartialUpdate: Updates only the specified address locations. + // - PartialUpdate: Updates only the specified address locations. Action *UpdateAction // An array of address locations to create or update. @@ -13105,9 +13153,9 @@ type ServiceGatewayUpdateAddressLocationsRequest struct { // ServiceGatewayUpdateServicesRequest - Properties of the service gateway update services request. type ServiceGatewayUpdateServicesRequest struct { // Specifies the type of update operation to perform on services within the service gateway. - // * FullUpdate: Replaces all existing services with the new list provided in the request. Any previously defined services + // - FullUpdate: Replaces all existing services with the new list provided in the request. Any previously defined services // not included will be removed. - // * PartialUpdate: Updates only the specified services. + // - PartialUpdate: Updates only the specified services. Action *ServiceUpdateAction // Collection of service updates. @@ -13132,10 +13180,10 @@ type ServiceTagInformation struct { // ServiceTagInformationListResult - Response for Get ServiceTagInformation API service call. Retrieves the list of service // tag information resources. type ServiceTagInformationListResult struct { - // The list of service tag information resources. + // REQUIRED; The ServiceTagInformation items on this page Value []*ServiceTagInformation - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -13213,16 +13261,16 @@ type SignatureOverridesFilterValuesResponse struct { // SignaturesOverrides - Contains all specific policy signatures overrides for the IDPS type SignaturesOverrides struct { - // Will contain the resource id of the signature override resource + // Resource ID. ID *string - // Contains the name of the resource (default) + // Resource name. Name *string // Will contain the properties of the resource (the actual signature overrides) Properties *SignaturesOverridesProperties - // Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + // Resource type. Type *string } @@ -13234,7 +13282,7 @@ type SignaturesOverridesList struct { // SignaturesOverridesProperties - Will contain the properties of the resource (the actual signature overrides) type SignaturesOverridesProperties struct { - // Dictionary of + // Dictionary of Signatures map[string]*string } @@ -13294,9 +13342,11 @@ type StaticCidr struct { // StaticCidrList - List of StaticCidr type StaticCidrList struct { - // The link used to get the next page of operations. + // REQUIRED; The StaticCidr items on this page + Value []*StaticCidr + + // The link to the next page of items NextLink *string - Value []*StaticCidr } // StaticCidrProperties - Properties of static CIDR resource. @@ -13309,7 +13359,7 @@ type StaticCidrProperties struct { // space. NumberOfIPAddressesToAllocate *string - // Provisioning states of a resource. + // READ-ONLY; Provisioning states of a resource. ProvisioningState *ProvisioningState // READ-ONLY; Total number of IP addresses allocated for the static CIDR resource. @@ -13337,14 +13387,13 @@ type StaticMember struct { Type *string } -// StaticMemberListResult - Result of the request to list StaticMember. It contains a list of groups and a URL link to get -// the next set of results. +// StaticMemberListResult - The response of a StaticMember list operation. type StaticMemberListResult struct { - // Gets the URL to get the next set of results. - NextLink *string - - // Gets a page of StaticMember + // REQUIRED; The StaticMember items on this page Value []*StaticMember + + // The link to the next page of items + NextLink *string } // StaticMemberProperties - Properties of static member. @@ -13373,12 +13422,22 @@ type StaticRoute struct { // StaticRoutesConfig - Configuration for static routes on this HubVnetConnectionConfiguration for static routes on this HubVnetConnection. type StaticRoutesConfig struct { + // Boolean indicating whether static routes on this connection are automatically propagate to route tables which this connection + // propagates to. + PropagateStaticRoutes *bool + // Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria +} - // READ-ONLY; Boolean indicating whether static routes on this connection are automatically propagate to route tables which - // this connection propagates to. - PropagateStaticRoutes *bool +type StopCircuitLinkFailoverTestParameterBody struct { + // REQUIRED; Parameters supplied to stop the link failover simulation on the express route circuit. + StopParameters *ExpressRouteLinkFailoverStopAPIParameters +} + +type StopSiteFailoverTestParameterBody struct { + // REQUIRED; Parameters supplied to stop the failover simulation on the express route gateway. + StopParameters *ExpressRouteFailoverStopAPIParameters } // SubResource - Reference to another subresource. @@ -13387,22 +13446,91 @@ type SubResource struct { ID *string } +// Subgroup - A subgroup in an interconnect group. +type Subgroup struct { + // Resource ID. + ID *string + + // Name of the resource. + Name *string + + // Properties of the subgroup. + Properties *SubgroupProperties + + // READ-ONLY; Resource type. + Type *string +} + +// SubgroupListResult - The response of a Subgroup list operation. +type SubgroupListResult struct { + // REQUIRED; The Subgroup items on this page + Value []*Subgroup + + // The link to the next page of items + NextLink *string +} + +// SubgroupNodeAvailabilityEntry - Represents the node availability information for a single subgroup. +type SubgroupNodeAvailabilityEntry struct { + // The total node count for the subgroup. + Count *int32 + + // The number of nodes that are in service. + InServiceNodeCount *int32 + + // The number of nodes that are currently in use. + InUseNodeCount *int32 + + // The unique identifier of the subgroup. + InternalSubgroupID *string + + // The subgroup name. + Name *string +} + +// SubgroupProfile - Subgroup profile of the interconnect group resource. +type SubgroupProfile struct { + // REQUIRED; VM size of the subgroup profile. + VMSize *string + + // Scope of the subgroup profile. + Scope *SubgroupProfileScope + + // Size of the subgroup profile. + Size *int32 +} + +// SubgroupProperties - Properties of subgroup. +type SubgroupProperties struct { + // READ-ONLY; The reference to an interconnect block resource. + InterconnectBlock *SubResource + + // READ-ONLY; The unique identifier of the subgroup. + InternalSubgroupID *string + + // READ-ONLY; The provisioning state of the subgroup. + ProvisioningState *ProvisioningState + + // READ-ONLY; A list of virtual machine references. + VirtualMachines []*SubResource +} + // Subnet in a virtual network resource. type Subnet struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the subnet. Properties *SubnetPropertiesFormat - // Resource type. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } // SubnetAssociation - Subnet and it's custom security rules. @@ -13414,13 +13542,13 @@ type SubnetAssociation struct { ID *string } -// SubnetListResult - Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. +// SubnetListResult - The response of a Subnet list operation. type SubnetListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The subnets in a virtual network. + // REQUIRED; The Subnet items on this page Value []*Subnet + + // The link to the next page of items + NextLink *string } // SubnetPropertiesFormat - Properties of the subnet. @@ -13471,8 +13599,7 @@ type SubnetPropertiesFormat struct { ServiceGateway *SubResource // Set this property to Tenant to allow sharing subnet with other subscriptions in your AAD tenant. This property can only - // be set if defaultOutboundAccess is set to false, both properties can only be set - // if subnet is empty. + // be set if defaultOutboundAccess is set to false, both properties can only be set if subnet is empty. SharingScope *SharingScope // READ-ONLY; Array of IP configuration profiles which reference this subnet. @@ -13508,7 +13635,7 @@ type SwapResource struct { // Swap resource properties Properties *SwapResourceProperties - // READ-ONLY; Resource Id. + // READ-ONLY; Resource ID. ID *string // READ-ONLY; Resource name. @@ -13540,7 +13667,7 @@ type SystemData struct { // The type of identity that created the resource. CreatedByType *CreatedByType - // The type of identity that last modified the resource. + // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. @@ -13610,28 +13737,6 @@ type TopologyResource struct { Name *string } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SecurityPerimeterSystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // TrafficAnalyticsConfigurationProperties - Parameters that define the configuration of traffic analytics. type TrafficAnalyticsConfigurationProperties struct { // Flag to enable/disable traffic analytics. @@ -13802,11 +13907,11 @@ type UsageName struct { // UsagesListResult - The list usages operation response. type UsagesListResult struct { - // URL to get the next set of results. - NextLink *string - - // The list network resource usages. + // REQUIRED; The Usage items on this page Value []*Usage + + // The link to the next page of items + NextLink *string } // VM - Describes a Virtual Machine. @@ -13842,8 +13947,8 @@ type VPNClientConfiguration struct { RadiusServerAddress *string // The radius secret property of the VirtualNetworkGateway resource for vpn client connection. We will no longer return radiusServerSecret - // in VirtualNetworkGateway Create/Update/Get/List/UpdateTags APIs - // response. Please use VirtualNetworkGateway ListRadiusSecrets API to fetch radius server secrets. + // in VirtualNetworkGateway Create/Update/Get/List/UpdateTags APIs response. Please use VirtualNetworkGateway ListRadiusSecrets + // API to fetch radius server secrets. RadiusServerSecret *string // The radiusServers property for multiple radius server configuration. @@ -13971,8 +14076,7 @@ type VPNClientParameters struct { ProcessorArchitecture *ProcessorArchitecture // The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only - // if external radius authentication has been configured with EAPTLS - // authentication. + // if external radius authentication has been configured with EAPTLS authentication. RadiusServerAuthCertificate *string } @@ -14172,7 +14276,7 @@ type VPNGatewayNatRule struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the VpnGateway NAT rule. @@ -14343,6 +14447,9 @@ type VPNServerConfiguration struct { // Resource location. Location *string + // Resource name. + Name *string + // Properties of the P2SVpnServer configuration. Properties *VPNServerConfigurationProperties @@ -14352,9 +14459,6 @@ type VPNServerConfiguration struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Resource name. - Name *string - // READ-ONLY; Resource type. Type *string } @@ -14364,7 +14468,7 @@ type VPNServerConfigurationPolicyGroup struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the VpnServerConfigurationPolicyGroup. @@ -14428,9 +14532,8 @@ type VPNServerConfigurationProperties struct { RadiusServerRootCertificates []*VPNServerConfigRadiusServerRootCertificate // The radius secret property of the VpnServerConfiguration resource for point to site client connection. We will no longer - // return radiusServerSecret in VpnServerConfiguration - // Create/Update/Get/List/UpdateTags APIs response. Please use VpnServerConfiguration ListRadiusSecrets API to fetch radius - // server secrets. + // return radiusServerSecret in VpnServerConfiguration Create/Update/Get/List/UpdateTags APIs response. Please use VpnServerConfiguration + // ListRadiusSecrets API to fetch radius server secrets. RadiusServerSecret *string // Multiple Radius Server configuration for VpnServerConfiguration. @@ -14492,18 +14595,12 @@ type VPNSite struct { Type *string } -// VPNSiteID - VpnSite Resource. -type VPNSiteID struct { - // READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. - VPNSite *string -} - // VPNSiteLink - VpnSiteLink Resource. type VPNSiteLink struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the VPN site link. @@ -14521,7 +14618,7 @@ type VPNSiteLinkConnection struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the VPN site link connection. @@ -14561,8 +14658,7 @@ type VPNSiteLinkConnectionProperties struct { RoutingWeight *int32 // SharedKey for the vpn link connection. We will no longer return sharedKey in any Create/Update/Get/List/UpdateTags VpnGateway/VpnConnection/VpnLinkConnection - // APIs response. Please use 'Vpn Link - // Connections - List Default Shared Key' API to fetch Vpn link connection sharedKey. + // APIs response. Please use 'Vpn Link Connections - List Default Shared Key' API to fetch Vpn link connection sharedKey. SharedKey *string // Use local azure ip to initiate connection. @@ -14706,27 +14802,27 @@ type VerifierWorkspace struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// VerifierWorkspaceListResult - A list of Verifier Workspace +// VerifierWorkspaceListResult - The response of a VerifierWorkspace list operation. type VerifierWorkspaceListResult struct { - // Gets the URL to get the next page of results. - NextLink *string - - // Gets a page of Verifier Workspaces. + // REQUIRED; The VerifierWorkspace items on this page Value []*VerifierWorkspace + + // The link to the next page of items + NextLink *string } // VerifierWorkspaceProperties - Properties of Verifier Workspace resource. type VerifierWorkspaceProperties struct { Description *string - // Provisioning states of a resource. + // READ-ONLY; Provisioning states of a resource. ProvisioningState *ProvisioningState } @@ -14735,7 +14831,7 @@ type VerifierWorkspaceUpdate struct { // Represents the VerifierWorkspace update properties. Properties *VerifierWorkspaceUpdateProperties - // Dictionary of + // Dictionary of Tags map[string]*string } @@ -14771,7 +14867,9 @@ type VirtualAppliance struct { Type *string } -// VirtualApplianceAdditionalNicProperties - Network Virtual Appliance Additional NIC properties. +// VirtualApplianceAdditionalNicProperties - Network Virtual Appliance Additional Nic Properties +// +// Network Virtual Appliance Additional NIC properties. type VirtualApplianceAdditionalNicProperties struct { // Flag (true or false) for Intent for Public Ip on additional nic HasPublicIP *bool @@ -14807,11 +14905,11 @@ type VirtualApplianceConnection struct { // VirtualApplianceConnectionList - NetworkVirtualApplianceConnection list. type VirtualApplianceConnectionList struct { - // URL to get the next set of results. - NextLink *string - - // The list of NetworkVirtualAppliance connections. + // REQUIRED; The NetworkVirtualApplianceConnection items on this page Value []*VirtualApplianceConnection + + // The link to the next page of items + NextLink *string } // VirtualApplianceConnectionProperties - Properties of the NetworkVirtualApplianceConnection subresource. @@ -14841,8 +14939,7 @@ type VirtualApplianceConnectionProperties struct { // VirtualApplianceIPConfiguration - Represents a single IP configuration. type VirtualApplianceIPConfiguration struct { // For hub NVAs, primary IP configs must be named 'privatenicipconfig' and 'publicnicipconfig', with non-primary configs using - // these prefixes; no naming restrictions apply for NVAs in VNets. Maximum 80 - // character are allowed. + // these prefixes; no naming restrictions apply for NVAs in VNets. Maximum 80 character are allowed. Name *string // Represents a single IP configuration properties. @@ -14863,18 +14960,17 @@ type VirtualApplianceInstanceID struct { // VirtualApplianceInstanceIDs - Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. type VirtualApplianceInstanceIDs struct { // The network virtual appliance instance ids. Omitting the network virtual appliance instance ids will result in the operation - // being performed on all virtual machines belonging to the network virtual - // appliance. + // being performed on all virtual machines belonging to the network virtual appliance. InstanceIDs []*string } -// VirtualApplianceListResult - Response for ListNetworkVirtualAppliances API service call. +// VirtualApplianceListResult - The response of a NetworkVirtualAppliance list operation. type VirtualApplianceListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Network Virtual Appliances. + // REQUIRED; The NetworkVirtualAppliance items on this page Value []*VirtualAppliance + + // The link to the next page of items + NextLink *string } // VirtualApplianceNetworkInterfaceConfiguration - Represents a single NIC configuration. @@ -14982,7 +15078,9 @@ type VirtualAppliancePropertiesFormatNetworkProfile struct { NetworkInterfaceConfigurations []*VirtualApplianceNetworkInterfaceConfiguration } -// VirtualApplianceSKU - Definition of the NetworkVirtualApplianceSkus resource. +// VirtualApplianceSKU - Available NetworkVirtualApplianceSkus +// +// Definition of the NetworkVirtualApplianceSkus resource. type VirtualApplianceSKU struct { // Resource ID. ID *string @@ -15006,7 +15104,9 @@ type VirtualApplianceSKU struct { Type *string } -// VirtualApplianceSKUInstances - List of available Sku and instances. +// VirtualApplianceSKUInstances - Network Virtual Appliance Sku Instances +// +// List of available Sku and instances. type VirtualApplianceSKUInstances struct { // READ-ONLY; Instance Count. InstanceCount *int32 @@ -15015,13 +15115,13 @@ type VirtualApplianceSKUInstances struct { ScaleUnit *string } -// VirtualApplianceSKUListResult - Response for ListNetworkVirtualApplianceSkus API service call. +// VirtualApplianceSKUListResult - The response of a NetworkVirtualApplianceSku list operation. type VirtualApplianceSKUListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Network Virtual Appliance Skus that are available. + // REQUIRED; The NetworkVirtualApplianceSku items on this page Value []*VirtualApplianceSKU + + // The link to the next page of items + NextLink *string } // VirtualApplianceSKUProperties - Network Virtual Appliance Sku Properties. @@ -15036,7 +15136,9 @@ type VirtualApplianceSKUProperties struct { Vendor *string } -// VirtualApplianceSKUPropertiesFormat - Properties specific to NetworkVirtualApplianceSkus. +// VirtualApplianceSKUPropertiesFormat - Network Virtual Appliance Sku Properties +// +// Properties specific to NetworkVirtualApplianceSkus. type VirtualApplianceSKUPropertiesFormat struct { // The list of scale units available. AvailableScaleUnits []*VirtualApplianceSKUInstances @@ -15053,7 +15155,7 @@ type VirtualApplianceSite struct { // Resource ID. ID *string - // Name of the virtual appliance site. + // Name of the resource. Name *string // The properties of the Virtual Appliance Sites. @@ -15062,17 +15164,17 @@ type VirtualApplianceSite struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Site type. + // READ-ONLY; Resource type. Type *string } -// VirtualApplianceSiteListResult - Response for ListNetworkVirtualApplianceSites API service call. +// VirtualApplianceSiteListResult - Paged collection of VirtualApplianceSite items type VirtualApplianceSiteListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Network Virtual Appliance sites. + // REQUIRED; The VirtualApplianceSite items on this page Value []*VirtualApplianceSite + + // The link to the next page of items + NextLink *string } // VirtualApplianceSiteProperties - Properties of the rule group. @@ -15358,19 +15460,22 @@ type VirtualNetworkApplianceIPConfigurationProperties struct { ProvisioningState *ProvisioningState } -// VirtualNetworkApplianceListResult - Response for the ListVirtualNetworkAppliance API service call. +// VirtualNetworkApplianceListResult - The response of a VirtualNetworkAppliance list operation. type VirtualNetworkApplianceListResult struct { - // A list of virtual network appliances in a resource group. + // REQUIRED; The VirtualNetworkAppliance items on this page Value []*VirtualNetworkAppliance - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } // VirtualNetworkAppliancePropertiesFormat - VirtualNetworkAppliance properties. type VirtualNetworkAppliancePropertiesFormat struct { // Bandwidth of the VirtualNetworkAppliance resource in Gbps. - BandwidthInGbps *string + BandwidthInGbps *float64 + + // Whether the specific virtual network appliance is IPv4 or Dual Stack. Default is IPv4. + PrivateIPAddressVersion *VirtualNetworkApplianceIPVersionType // The reference to the subnet resource. Subnet *Subnet @@ -15403,11 +15508,11 @@ type VirtualNetworkConnectionGatewayReference struct { // VirtualNetworkDdosProtectionStatusResult - Response for GetVirtualNetworkDdosProtectionStatusOperation. type VirtualNetworkDdosProtectionStatusResult struct { - // The URL to get the next set of results. - NextLink *string - - // The Ddos Protection Status Result for each public ip under a virtual network. + // REQUIRED; The PublicIpDdosProtectionStatusResult items on this page Value []*PublicIPDdosProtectionStatusResult + + // The link to the next page of items + NextLink *string } // VirtualNetworkEncryption - Indicates if encryption is enabled on virtual network and if VM without encryption is allowed @@ -15552,12 +15657,14 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { // The reference to peerings resource. Peer *SubResource + // The routing configuration indicating the associated and propagated route tables for this connection. + RoutingConfiguration *RoutingConfiguration + // The routing weight. RoutingWeight *int32 // The IPSec shared key. We will no longer return sharedKey in VirtualNetworkGatewayConnection Create/Update/Get/List/UpdateTags - // APIs response. Please use VirtualNetworkGatewayConnection GetSharedKey API - // to fetch connection sharedKey. + // APIs response. Please use VirtualNetworkGatewayConnection GetSharedKey API to fetch connection sharedKey. SharedKey *string // The Traffic Selector Policies to be considered by this connection. @@ -15588,12 +15695,12 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { TunnelConnectionStatus []*TunnelConnectionHealth } -// VirtualNetworkGatewayConnectionListResult - Response for the ListVirtualNetworkGatewayConnections API service call. +// VirtualNetworkGatewayConnectionListResult - The response of a VirtualNetworkGatewayConnection list operation. type VirtualNetworkGatewayConnectionListResult struct { - // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + // REQUIRED; The VirtualNetworkGatewayConnection items on this page Value []*VirtualNetworkGatewayConnection - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -15651,6 +15758,9 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { // The reference to peerings resource. Peer *SubResource + // The routing configuration indicating the associated and propagated route tables for this connection. + RoutingConfiguration *RoutingConfiguration + // The routing weight. RoutingWeight *int32 @@ -15734,19 +15844,19 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { // VirtualNetworkGatewayListConnectionsResult - Response for the VirtualNetworkGatewayListConnections API service call. type VirtualNetworkGatewayListConnectionsResult struct { - // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + // REQUIRED; The VirtualNetworkGatewayConnectionListEntity items on this page Value []*VirtualNetworkGatewayConnectionListEntity - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } -// VirtualNetworkGatewayListResult - Response for the ListVirtualNetworkGateways API service call. +// VirtualNetworkGatewayListResult - The response of a VirtualNetworkGateway list operation. type VirtualNetworkGatewayListResult struct { - // A list of VirtualNetworkGateway resources that exists in a resource group. + // REQUIRED; The VirtualNetworkGateway items on this page Value []*VirtualNetworkGateway - // READ-ONLY; The URL to get the next set of results. + // The link to the next page of items NextLink *string } @@ -15776,7 +15886,7 @@ type VirtualNetworkGatewayNatRule struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the Virtual Network Gateway NAT rule. @@ -15959,22 +16069,22 @@ type VirtualNetworkGatewaySKU struct { Capacity *int32 } -// VirtualNetworkListResult - Response for the ListVirtualNetworks API service call. +// VirtualNetworkListResult - The response of a VirtualNetwork list operation. type VirtualNetworkListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of VirtualNetwork resources in a resource group. + // REQUIRED; The VirtualNetwork items on this page Value []*VirtualNetwork + + // The link to the next page of items + NextLink *string } // VirtualNetworkListUsageResult - Response for the virtual networks GetUsage API service call. type VirtualNetworkListUsageResult struct { - // The URL to get the next set of results. - NextLink *string - - // READ-ONLY; VirtualNetwork usage stats. + // READ-ONLY; The VirtualNetworkUsage items on this page Value []*VirtualNetworkUsage + + // The link to the next page of items + NextLink *string } // VirtualNetworkPeering - Peerings in a virtual network resource. @@ -15982,27 +16092,26 @@ type VirtualNetworkPeering struct { // Resource ID. ID *string - // The name of the resource that is unique within a resource group. This name can be used to access the resource. + // Name of the resource. Name *string // Properties of the virtual network peering. Properties *VirtualNetworkPeeringPropertiesFormat - // Resource type. - Type *string - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string + + // READ-ONLY; Resource type. + Type *string } -// VirtualNetworkPeeringListResult - Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual -// network. +// VirtualNetworkPeeringListResult - The response of a VirtualNetworkPeering list operation. type VirtualNetworkPeeringListResult struct { - // The URL to get the next set of results. - NextLink *string - - // The peerings in a virtual network. + // REQUIRED; The VirtualNetworkPeering items on this page Value []*VirtualNetworkPeering + + // The link to the next page of items + NextLink *string } // VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. @@ -16050,17 +16159,15 @@ type VirtualNetworkPeeringPropertiesFormat struct { RemoteSubnetNames []*string // The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). - // See here to register for the preview and learn more - // (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + // See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). RemoteVirtualNetwork *SubResource // The reference to the current address space of the remote virtual network. RemoteVirtualNetworkAddressSpace *AddressSpace // If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering - // is also true, virtual network will use gateways of remote virtual network - // for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a - // gateway. + // is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag + // set to true. This flag cannot be set if virtual network already has a gateway. UseRemoteGateways *bool // READ-ONLY; The provisioning state of the virtual network peering resource. @@ -16109,6 +16216,9 @@ type VirtualNetworkPropertiesFormat struct { // A list of subnets in a Virtual Network. Subnets []*Subnet + // A configurable list of summarized gateway prefixes advertised for the virtual network. + SummarizedGatewayPrefixes *AddressSpace + // A list of peerings in a Virtual Network. VirtualNetworkPeerings []*VirtualNetworkPeering @@ -16149,13 +16259,13 @@ type VirtualNetworkTap struct { Type *string } -// VirtualNetworkTapListResult - Response for ListVirtualNetworkTap API service call. +// VirtualNetworkTapListResult - The response of a VirtualNetworkTap list operation. type VirtualNetworkTapListResult struct { - // The URL to get the next set of results. - NextLink *string - - // A list of VirtualNetworkTaps in a resource group. + // REQUIRED; The VirtualNetworkTap items on this page Value []*VirtualNetworkTap + + // The link to the next page of items + NextLink *string } // VirtualNetworkTapPropertiesFormat - Virtual Network Tap properties. @@ -16236,13 +16346,13 @@ type VirtualRouterAutoScaleConfiguration struct { MinCapacity *int32 } -// VirtualRouterListResult - Response for ListVirtualRouters API service call. +// VirtualRouterListResult - The response of a VirtualRouter list operation. type VirtualRouterListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of Virtual Routers. + // REQUIRED; The VirtualRouter items on this page Value []*VirtualRouter + + // The link to the next page of items + NextLink *string } // VirtualRouterPeering - Virtual Router Peering resource. @@ -16250,7 +16360,7 @@ type VirtualRouterPeering struct { // Resource ID. ID *string - // Name of the virtual router peering that is unique within a virtual router. + // Name of the resource. Name *string // The properties of the Virtual Router Peering. @@ -16259,17 +16369,17 @@ type VirtualRouterPeering struct { // READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string - // READ-ONLY; Peering type. + // READ-ONLY; Resource type. Type *string } -// VirtualRouterPeeringListResult - Response for ListVirtualRouterPeerings API service call. +// VirtualRouterPeeringListResult - The response of a VirtualRouterPeering list operation. type VirtualRouterPeeringListResult struct { - // URL to get the next set of results. - NextLink *string - - // List of VirtualRouterPeerings in a VirtualRouter. + // REQUIRED; The VirtualRouterPeering items on this page Value []*VirtualRouterPeering + + // The link to the next page of items + NextLink *string } // VirtualRouterPeeringProperties - Properties of the rule group. @@ -16448,6 +16558,9 @@ type Watcher struct { // WatcherListResult - Response for ListNetworkWatchers API service call. type WatcherListResult struct { + // URL to get the next set of results. + NextLink *string + // List of network watcher resources. Value []*Watcher } @@ -16515,14 +16628,13 @@ type WebApplicationFirewallPolicy struct { Type *string } -// WebApplicationFirewallPolicyListResult - Result of the request to list WebApplicationFirewallPolicies. It contains a list -// of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +// WebApplicationFirewallPolicyListResult - Paged collection of WebApplicationFirewallPolicy items type WebApplicationFirewallPolicyListResult struct { - // READ-ONLY; URL to get the next set of WebApplicationFirewallPolicy objects if there are any. - NextLink *string - - // READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. + // READ-ONLY; The WebApplicationFirewallPolicy items on this page Value []*WebApplicationFirewallPolicy + + // The link to the next page of items + NextLink *string } // WebApplicationFirewallPolicyPropertiesFormat - Defines web application firewall policy properties. @@ -16551,6 +16663,8 @@ type WebApplicationFirewallPolicyPropertiesFormat struct { // READ-ONLY; The provisioning state of the web application firewall policy resource. ProvisioningState *ProvisioningState + // Resource status of the policy. + // // READ-ONLY; Resource status of the policy. ResourceState *WebApplicationFirewallPolicyResourceState } diff --git a/sdk/resourcemanager/network/armnetwork/models_serde.go b/sdk/resourcemanager/network/armnetwork/models_serde.go index c78632e4d4c4..5e5fa239bc92 100644 --- a/sdk/resourcemanager/network/armnetwork/models_serde.go +++ b/sdk/resourcemanager/network/armnetwork/models_serde.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -9,7 +8,9 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/datetime" "reflect" + "time" ) // MarshalJSON implements the json.Marshaller interface for type AADAuthenticationParameters. @@ -81,10 +82,10 @@ func (a *Action) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ActiveBaseSecurityAdminRule. func (a ActiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populateTime[datetime.RFC3339](objectMap, "commitTime", a.CommitTime) populate(objectMap, "configurationDescription", a.ConfigurationDescription) populate(objectMap, "id", a.ID) - objectMap["kind"] = a.Kind + populate(objectMap, "kind", a.Kind) populate(objectMap, "region", a.Region) populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) @@ -102,7 +103,7 @@ func (a *ActiveBaseSecurityAdminRule) UnmarshalJSON(data []byte) error { var err error switch key { case "commitTime": - err = unpopulateDateTimeRFC3339(val, "CommitTime", &a.CommitTime) + err = unpopulateTime[datetime.RFC3339](val, "CommitTime", &a.CommitTime) delete(rawMsg, key) case "configurationDescription": err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) @@ -167,7 +168,7 @@ func (a *ActiveConfigurationParameter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ActiveConnectivityConfiguration. func (a ActiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populateTime[datetime.RFC3339](objectMap, "commitTime", a.CommitTime) populate(objectMap, "configurationGroups", a.ConfigurationGroups) populate(objectMap, "id", a.ID) populate(objectMap, "properties", a.Properties) @@ -185,7 +186,7 @@ func (a *ActiveConnectivityConfiguration) UnmarshalJSON(data []byte) error { var err error switch key { case "commitTime": - err = unpopulateDateTimeRFC3339(val, "CommitTime", &a.CommitTime) + err = unpopulateTime[datetime.RFC3339](val, "CommitTime", &a.CommitTime) delete(rawMsg, key) case "configurationGroups": err = unpopulate(val, "ConfigurationGroups", &a.ConfigurationGroups) @@ -241,7 +242,7 @@ func (a *ActiveConnectivityConfigurationsListResult) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ActiveDefaultSecurityAdminRule. func (a ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populateTime[datetime.RFC3339](objectMap, "commitTime", a.CommitTime) populate(objectMap, "configurationDescription", a.ConfigurationDescription) populate(objectMap, "id", a.ID) objectMap["kind"] = EffectiveAdminRuleKindDefault @@ -263,7 +264,7 @@ func (a *ActiveDefaultSecurityAdminRule) UnmarshalJSON(data []byte) error { var err error switch key { case "commitTime": - err = unpopulateDateTimeRFC3339(val, "CommitTime", &a.CommitTime) + err = unpopulateTime[datetime.RFC3339](val, "CommitTime", &a.CommitTime) delete(rawMsg, key) case "configurationDescription": err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) @@ -300,7 +301,7 @@ func (a *ActiveDefaultSecurityAdminRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ActiveSecurityAdminRule. func (a ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populateTime[datetime.RFC3339](objectMap, "commitTime", a.CommitTime) populate(objectMap, "configurationDescription", a.ConfigurationDescription) populate(objectMap, "id", a.ID) objectMap["kind"] = EffectiveAdminRuleKindCustom @@ -322,7 +323,7 @@ func (a *ActiveSecurityAdminRule) UnmarshalJSON(data []byte) error { var err error switch key { case "commitTime": - err = unpopulateDateTimeRFC3339(val, "CommitTime", &a.CommitTime) + err = unpopulateTime[datetime.RFC3339](val, "CommitTime", &a.CommitTime) delete(rawMsg, key) case "configurationDescription": err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) @@ -754,6 +755,33 @@ func (a *AdvertisedPublicPrefixProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AfcConfiguration. +func (a AfcConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceEndpoint", a.ServiceEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AfcConfiguration. +func (a *AfcConfiguration) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceEndpoint": + err = unpopulate(val, "ServiceEndpoint", &a.ServiceEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ApplicationGateway. func (a ApplicationGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2748,6 +2776,37 @@ func (a *ApplicationGatewayLoadDistributionTargetPropertiesFormat) UnmarshalJSON return nil } +// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayManagedHsm. +func (a ApplicationGatewayManagedHsm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyId", a.KeyID) + populate(objectMap, "publicCertData", a.PublicCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayManagedHsm. +func (a *ApplicationGatewayManagedHsm) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyId": + err = unpopulate(val, "KeyID", &a.KeyID) + delete(rawMsg, key) + case "publicCertData": + err = unpopulate(val, "PublicCertData", &a.PublicCertData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayOnDemandProbe. func (a ApplicationGatewayOnDemandProbe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4174,6 +4233,7 @@ func (a *ApplicationGatewaySSLCertificate) UnmarshalJSON(data []byte) error { func (a ApplicationGatewaySSLCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "data", a.Data) + populate(objectMap, "hsm", a.Hsm) populate(objectMap, "keyVaultSecretId", a.KeyVaultSecretID) populate(objectMap, "password", a.Password) populate(objectMap, "provisioningState", a.ProvisioningState) @@ -4193,6 +4253,9 @@ func (a *ApplicationGatewaySSLCertificatePropertiesFormat) UnmarshalJSON(data [] case "data": err = unpopulate(val, "Data", &a.Data) delete(rawMsg, key) + case "hsm": + err = unpopulate(val, "Hsm", &a.Hsm) + delete(rawMsg, key) case "keyVaultSecretId": err = unpopulate(val, "KeyVaultSecretID", &a.KeyVaultSecretID) delete(rawMsg, key) @@ -5593,37 +5656,6 @@ func (a *AvailableServiceAliasesResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureAsyncOperationResult. -func (a AzureAsyncOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", a.Error) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureAsyncOperationResult. -func (a *AzureAsyncOperationResult) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &a.Error) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AzureFirewall. func (a AzureFirewall) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6533,6 +6565,7 @@ func (a *AzureFirewallPacketCaptureRule) UnmarshalJSON(data []byte) error { func (a AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalProperties", a.AdditionalProperties) + populate(objectMap, "afcConfiguration", a.AfcConfiguration) populate(objectMap, "applicationRuleCollections", a.ApplicationRuleCollections) populate(objectMap, "autoscaleConfiguration", a.AutoscaleConfiguration) populate(objectMap, "firewallPolicy", a.FirewallPolicy) @@ -6561,6 +6594,9 @@ func (a *AzureFirewallPropertiesFormat) UnmarshalJSON(data []byte) error { case "additionalProperties": err = unpopulate(val, "AdditionalProperties", &a.AdditionalProperties) delete(rawMsg, key) + case "afcConfiguration": + err = unpopulate(val, "AfcConfiguration", &a.AfcConfiguration) + delete(rawMsg, key) case "applicationRuleCollections": err = unpopulate(val, "ApplicationRuleCollections", &a.ApplicationRuleCollections) delete(rawMsg, key) @@ -6767,7 +6803,7 @@ func (a *AzureReachabilityReportItem) UnmarshalJSON(data []byte) error { func (a AzureReachabilityReportLatencyInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "score", a.Score) - populateDateTimeRFC3339(objectMap, "timeStamp", a.TimeStamp) + populateTime[datetime.RFC3339](objectMap, "timeStamp", a.TimeStamp) return json.Marshal(objectMap) } @@ -6784,7 +6820,7 @@ func (a *AzureReachabilityReportLatencyInfo) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Score", &a.Score) delete(rawMsg, key) case "timeStamp": - err = unpopulateDateTimeRFC3339(val, "TimeStamp", &a.TimeStamp) + err = unpopulateTime[datetime.RFC3339](val, "TimeStamp", &a.TimeStamp) delete(rawMsg, key) } if err != nil { @@ -6833,10 +6869,10 @@ func (a *AzureReachabilityReportLocation) UnmarshalJSON(data []byte) error { func (a AzureReachabilityReportParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "azureLocations", a.AzureLocations) - populateDateTimeRFC3339(objectMap, "endTime", a.EndTime) + populateTime[datetime.RFC3339](objectMap, "endTime", a.EndTime) populate(objectMap, "providerLocation", a.ProviderLocation) populate(objectMap, "providers", a.Providers) - populateDateTimeRFC3339(objectMap, "startTime", a.StartTime) + populateTime[datetime.RFC3339](objectMap, "startTime", a.StartTime) return json.Marshal(objectMap) } @@ -6853,7 +6889,7 @@ func (a *AzureReachabilityReportParameters) UnmarshalJSON(data []byte) error { err = unpopulate(val, "AzureLocations", &a.AzureLocations) delete(rawMsg, key) case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &a.EndTime) + err = unpopulateTime[datetime.RFC3339](val, "EndTime", &a.EndTime) delete(rawMsg, key) case "providerLocation": err = unpopulate(val, "ProviderLocation", &a.ProviderLocation) @@ -6862,7 +6898,7 @@ func (a *AzureReachabilityReportParameters) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Providers", &a.Providers) delete(rawMsg, key) case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime) + err = unpopulateTime[datetime.RFC3339](val, "StartTime", &a.StartTime) delete(rawMsg, key) } if err != nil { @@ -7166,7 +7202,7 @@ func (b BaseAdminRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", b.Etag) populate(objectMap, "id", b.ID) - objectMap["kind"] = b.Kind + populate(objectMap, "kind", b.Kind) populate(objectMap, "name", b.Name) populate(objectMap, "systemData", b.SystemData) populate(objectMap, "type", b.Type) @@ -7825,6 +7861,7 @@ func (b BgpConnectionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "peerAsn", b.PeerAsn) populate(objectMap, "peerIp", b.PeerIP) populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "routingConfiguration", b.RoutingConfiguration) return json.Marshal(objectMap) } @@ -7852,6 +7889,9 @@ func (b *BgpConnectionProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &b.RoutingConfiguration) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -8187,45 +8227,6 @@ func (c *CheckPrivateLinkServiceVisibilityRequest) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ChildResource. -func (c ChildResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ChildResource. -func (c *ChildResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type CircuitMetadataMap. func (c CircuitMetadataMap) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8261,119 +8262,20 @@ func (c *CircuitMetadataMap) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CommonErrorAdditionalInfo. -func (c CommonErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "info", c.Info) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonErrorAdditionalInfo. -func (c *CommonErrorAdditionalInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "info": - err = unpopulate(val, "Info", &c.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommonErrorDetail. -func (c CommonErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", c.AdditionalInfo) - populate(objectMap, "code", c.Code) - populate(objectMap, "details", c.Details) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonErrorDetail. -func (c *CommonErrorDetail) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &c.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &c.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &c.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommonErrorResponse. -func (c CommonErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", c.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonErrorResponse. -func (c *CommonErrorResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommonProxyResource. -func (c CommonProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Commit. +func (c Commit) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonProxyResource. -func (c *CommonProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Commit. +func (c *Commit) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -8381,12 +8283,18 @@ func (c *CommonProxyResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) @@ -8401,18 +8309,16 @@ func (c *CommonProxyResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CommonResource. -func (c CommonResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommitListResult. +func (c CommitListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonResource. -func (c *CommonResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitListResult. +func (c *CommitListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -8420,17 +8326,11 @@ func (c *CommonResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -8440,20 +8340,22 @@ func (c *CommonResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CommonTrackedResource. -func (c CommonTrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommitProperties. +func (c CommitProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "activeLocations", c.ActiveLocations) + populate(objectMap, "commitType", c.CommitType) + populate(objectMap, "configurationIds", c.ConfigurationIDs) + populate(objectMap, "description", c.Description) + populate(objectMap, "forceUpdateTag", c.ForceUpdateTag) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceGuid", c.ResourceGUID) + populate(objectMap, "targetLocations", c.TargetLocations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonTrackedResource. -func (c *CommonTrackedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitProperties. +func (c *CommitProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -8461,54 +8363,29 @@ func (c *CommonTrackedResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "activeLocations": + err = unpopulate(val, "ActiveLocations", &c.ActiveLocations) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + case "commitType": + err = unpopulate(val, "CommitType", &c.CommitType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "configurationIds": + err = unpopulate(val, "ConfigurationIDs", &c.ConfigurationIDs) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "forceUpdateTag": + err = unpopulate(val, "ForceUpdateTag", &c.ForceUpdateTag) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", c.ClientID) - populate(objectMap, "principalId", c.PrincipalID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &c.ResourceGUID) delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &c.PrincipalID) + case "targetLocations": + err = unpopulate(val, "TargetLocations", &c.TargetLocations) delete(rawMsg, key) } if err != nil { @@ -9038,6 +8915,7 @@ func (c *ConnectionMonitorIcmpConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorListResult. func (c ConnectionMonitorListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } @@ -9051,6 +8929,9 @@ func (c *ConnectionMonitorListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) @@ -9152,37 +9033,6 @@ func (c *ConnectionMonitorParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorQueryResult. -func (c ConnectionMonitorQueryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourceStatus", c.SourceStatus) - populate(objectMap, "states", c.States) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorQueryResult. -func (c *ConnectionMonitorQueryResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceStatus": - err = unpopulate(val, "SourceStatus", &c.SourceStatus) - delete(rawMsg, key) - case "states": - err = unpopulate(val, "States", &c.States) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorResult. func (c ConnectionMonitorResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9247,7 +9097,7 @@ func (c ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "outputs", c.Outputs) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "source", c.Source) - populateDateTimeRFC3339(objectMap, "startTime", c.StartTime) + populateTime[datetime.RFC3339](objectMap, "startTime", c.StartTime) populate(objectMap, "testConfigurations", c.TestConfigurations) populate(objectMap, "testGroups", c.TestGroups) return json.Marshal(objectMap) @@ -9293,7 +9143,7 @@ func (c *ConnectionMonitorResultProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Source", &c.Source) delete(rawMsg, key) case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &c.StartTime) + err = unpopulateTime[datetime.RFC3339](val, "StartTime", &c.StartTime) delete(rawMsg, key) case "testConfigurations": err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) @@ -9531,6 +9381,88 @@ func (c *ConnectionMonitorWorkspaceSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConnectionPolicy. +func (c ConnectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionPolicy. +func (c *ConnectionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionPolicyProperties. +func (c ConnectionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedConnections", c.AssociatedConnections) + populate(objectMap, "enableInternetSecurity", c.EnableInternetSecurity) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "routingConfiguration", c.RoutingConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionPolicyProperties. +func (c *ConnectionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "associatedConnections": + err = unpopulate(val, "AssociatedConnections", &c.AssociatedConnections) + delete(rawMsg, key) + case "enableInternetSecurity": + err = unpopulate(val, "EnableInternetSecurity", &c.EnableInternetSecurity) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &c.RoutingConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ConnectionResetSharedKey. func (c ConnectionResetSharedKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9659,69 +9591,6 @@ func (c *ConnectionSharedKeyResultList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionStateSnapshot. -func (c ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) - populate(objectMap, "connectionState", c.ConnectionState) - populateDateTimeRFC3339(objectMap, "endTime", c.EndTime) - populate(objectMap, "evaluationState", c.EvaluationState) - populate(objectMap, "hops", c.Hops) - populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) - populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) - populate(objectMap, "probesFailed", c.ProbesFailed) - populate(objectMap, "probesSent", c.ProbesSent) - populateDateTimeRFC3339(objectMap, "startTime", c.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStateSnapshot. -func (c *ConnectionStateSnapshot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "avgLatencyInMs": - err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) - delete(rawMsg, key) - case "connectionState": - err = unpopulate(val, "ConnectionState", &c.ConnectionState) - delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &c.EndTime) - delete(rawMsg, key) - case "evaluationState": - err = unpopulate(val, "EvaluationState", &c.EvaluationState) - delete(rawMsg, key) - case "hops": - err = unpopulate(val, "Hops", &c.Hops) - delete(rawMsg, key) - case "maxLatencyInMs": - err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) - delete(rawMsg, key) - case "minLatencyInMs": - err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) - delete(rawMsg, key) - case "probesFailed": - err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) - delete(rawMsg, key) - case "probesSent": - err = unpopulate(val, "ProbesSent", &c.ProbesSent) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ConnectivityConfiguration. func (c ConnectivityConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -10835,12 +10704,44 @@ func (d *DdosCustomPolicy) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DdosCustomPolicyListResult. +func (d DdosCustomPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosCustomPolicyListResult. +func (d *DdosCustomPolicyListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DdosCustomPolicyPropertiesFormat. func (d DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "detectionRules", d.DetectionRules) populate(objectMap, "frontEndIpConfiguration", d.FrontEndIPConfiguration) populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "publicIPAddresses", d.PublicIPAddresses) populate(objectMap, "resourceGuid", d.ResourceGUID) return json.Marshal(objectMap) } @@ -10863,6 +10764,9 @@ func (d *DdosCustomPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &d.PublicIPAddresses) + delete(rawMsg, key) case "resourceGuid": err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) delete(rawMsg, key) @@ -10952,6 +10856,33 @@ func (d *DdosDetectionRulePropertiesFormat) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DdosFrontendIPConfigurationSettings. +func (d DdosFrontendIPConfigurationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ddosCustomPolicy", d.DdosCustomPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosFrontendIPConfigurationSettings. +func (d *DdosFrontendIPConfigurationSettings) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ddosCustomPolicy": + err = unpopulate(val, "DdosCustomPolicy", &d.DdosCustomPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DdosProtectionPlan. func (d DdosProtectionPlan) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11076,6 +11007,7 @@ func (d *DdosProtectionPlanPropertiesFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DdosSettings. func (d DdosSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "ddosCustomPolicy", d.DdosCustomPolicy) populate(objectMap, "ddosProtectionPlan", d.DdosProtectionPlan) populate(objectMap, "protectionMode", d.ProtectionMode) return json.Marshal(objectMap) @@ -11090,6 +11022,9 @@ func (d *DdosSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "ddosCustomPolicy": + err = unpopulate(val, "DdosCustomPolicy", &d.DdosCustomPolicy) + delete(rawMsg, key) case "ddosProtectionPlan": err = unpopulate(val, "DdosProtectionPlan", &d.DdosProtectionPlan) delete(rawMsg, key) @@ -11609,7 +11544,7 @@ func (e EffectiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "configurationDescription", e.ConfigurationDescription) populate(objectMap, "id", e.ID) - objectMap["kind"] = e.Kind + populate(objectMap, "kind", e.Kind) populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) populate(objectMap, "ruleGroups", e.RuleGroups) @@ -12217,49 +12152,6 @@ func (e *EndpointServicesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "innerError", e.InnerError) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &e.InnerError) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12334,68 +12226,6 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetails. -func (e ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. -func (e *ErrorDetails) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type EvaluatedNetworkSecurityGroup. func (e EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14560,6 +14390,280 @@ func (e *ExpressRouteLink) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverAllTestsDetails. +func (e ExpressRouteLinkFailoverAllTestsDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpStatus", e.BgpStatus) + populate(objectMap, "circuitTestCategory", e.CircuitTestCategory) + populate(objectMap, "endTime", e.EndTime) + populate(objectMap, "issues", e.Issues) + populate(objectMap, "linkType", e.LinkType) + populate(objectMap, "startTime", e.StartTime) + populate(objectMap, "status", e.Status) + populate(objectMap, "testGuid", e.TestGUID) + populate(objectMap, "testType", e.TestType) + populate(objectMap, "wasSimulationSuccessful", e.WasSimulationSuccessful) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverAllTestsDetails. +func (e *ExpressRouteLinkFailoverAllTestsDetails) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bgpStatus": + err = unpopulate(val, "BgpStatus", &e.BgpStatus) + delete(rawMsg, key) + case "circuitTestCategory": + err = unpopulate(val, "CircuitTestCategory", &e.CircuitTestCategory) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "issues": + err = unpopulate(val, "Issues", &e.Issues) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &e.LinkType) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "testGuid": + err = unpopulate(val, "TestGUID", &e.TestGUID) + delete(rawMsg, key) + case "testType": + err = unpopulate(val, "TestType", &e.TestType) + delete(rawMsg, key) + case "wasSimulationSuccessful": + err = unpopulate(val, "WasSimulationSuccessful", &e.WasSimulationSuccessful) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverRoute. +func (e ExpressRouteLinkFailoverRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextHop", e.NextHop) + populate(objectMap, "primaryASPath", e.PrimaryASPath) + populate(objectMap, "route", e.Route) + populate(objectMap, "secondaryASPath", e.SecondaryASPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverRoute. +func (e *ExpressRouteLinkFailoverRoute) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextHop": + err = unpopulate(val, "NextHop", &e.NextHop) + delete(rawMsg, key) + case "primaryASPath": + err = unpopulate(val, "PrimaryASPath", &e.PrimaryASPath) + delete(rawMsg, key) + case "route": + err = unpopulate(val, "Route", &e.Route) + delete(rawMsg, key) + case "secondaryASPath": + err = unpopulate(val, "SecondaryASPath", &e.SecondaryASPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverRouteList. +func (e ExpressRouteLinkFailoverRouteList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "beforeSimulation", e.BeforeSimulation) + populate(objectMap, "duringSimulation", e.DuringSimulation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverRouteList. +func (e *ExpressRouteLinkFailoverRouteList) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "beforeSimulation": + err = unpopulate(val, "BeforeSimulation", &e.BeforeSimulation) + delete(rawMsg, key) + case "duringSimulation": + err = unpopulate(val, "DuringSimulation", &e.DuringSimulation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverSingleTestDetails. +func (e ExpressRouteLinkFailoverSingleTestDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpStatus", e.BgpStatus) + populate(objectMap, "circuitTestCategory", e.CircuitTestCategory) + populate(objectMap, "endTimeUtc", e.EndTimeUTC) + populate(objectMap, "isSimulationVerified", e.IsSimulationVerified) + populate(objectMap, "linkType", e.LinkType) + populate(objectMap, "nonRedundantRoutes", e.NonRedundantRoutes) + populate(objectMap, "redundantRoutes", e.RedundantRoutes) + populate(objectMap, "startTimeUtc", e.StartTimeUTC) + populate(objectMap, "status", e.Status) + populate(objectMap, "wasSimulationSuccessful", e.WasSimulationSuccessful) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverSingleTestDetails. +func (e *ExpressRouteLinkFailoverSingleTestDetails) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bgpStatus": + err = unpopulate(val, "BgpStatus", &e.BgpStatus) + delete(rawMsg, key) + case "circuitTestCategory": + err = unpopulate(val, "CircuitTestCategory", &e.CircuitTestCategory) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulate(val, "EndTimeUTC", &e.EndTimeUTC) + delete(rawMsg, key) + case "isSimulationVerified": + err = unpopulate(val, "IsSimulationVerified", &e.IsSimulationVerified) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &e.LinkType) + delete(rawMsg, key) + case "nonRedundantRoutes": + err = unpopulate(val, "NonRedundantRoutes", &e.NonRedundantRoutes) + delete(rawMsg, key) + case "redundantRoutes": + err = unpopulate(val, "RedundantRoutes", &e.RedundantRoutes) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulate(val, "StartTimeUTC", &e.StartTimeUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "wasSimulationSuccessful": + err = unpopulate(val, "WasSimulationSuccessful", &e.WasSimulationSuccessful) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverStopAPIParameters. +func (e ExpressRouteLinkFailoverStopAPIParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "circuitTestCategory", e.CircuitTestCategory) + populate(objectMap, "isVerified", e.IsVerified) + populate(objectMap, "linkType", e.LinkType) + populate(objectMap, "wasSimulationSuccessful", e.WasSimulationSuccessful) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverStopAPIParameters. +func (e *ExpressRouteLinkFailoverStopAPIParameters) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "circuitTestCategory": + err = unpopulate(val, "CircuitTestCategory", &e.CircuitTestCategory) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, "IsVerified", &e.IsVerified) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &e.LinkType) + delete(rawMsg, key) + case "wasSimulationSuccessful": + err = unpopulate(val, "WasSimulationSuccessful", &e.WasSimulationSuccessful) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkFailoverTestBgpStatus. +func (e ExpressRouteLinkFailoverTestBgpStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "checkTimeUtc", e.CheckTimeUTC) + populate(objectMap, "link", e.Link) + populate(objectMap, "status", e.Status) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkFailoverTestBgpStatus. +func (e *ExpressRouteLinkFailoverTestBgpStatus) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "checkTimeUtc": + err = unpopulate(val, "CheckTimeUTC", &e.CheckTimeUTC) + delete(rawMsg, key) + case "link": + err = unpopulate(val, "Link", &e.Link) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkListResult. func (e ExpressRouteLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -16193,7 +16297,7 @@ func (f FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "basePolicy", f.BasePolicy) populate(objectMap, "childPolicies", f.ChildPolicies) populate(objectMap, "dnsSettings", f.DNSSettings) - populate(objectMap, "explicitProxySettings", f.ExplicitProxySettings) + populate(objectMap, "explicitProxy", f.ExplicitProxySettings) populate(objectMap, "firewalls", f.Firewalls) populate(objectMap, "insights", f.Insights) populate(objectMap, "intrusionDetection", f.IntrusionDetection) @@ -16227,7 +16331,7 @@ func (f *FirewallPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { case "dnsSettings": err = unpopulate(val, "DNSSettings", &f.DNSSettings) delete(rawMsg, key) - case "explicitProxySettings": + case "explicitProxy": err = unpopulate(val, "ExplicitProxySettings", &f.ExplicitProxySettings) delete(rawMsg, key) case "firewalls": @@ -16279,7 +16383,7 @@ func (f FirewallPolicyRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", f.Description) populate(objectMap, "name", f.Name) - objectMap["ruleType"] = f.RuleType + populate(objectMap, "ruleType", f.RuleType) return json.Marshal(objectMap) } @@ -16345,7 +16449,7 @@ func (f FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", f.Name) populate(objectMap, "priority", f.Priority) - objectMap["ruleCollectionType"] = f.RuleCollectionType + populate(objectMap, "ruleCollectionType", f.RuleCollectionType) return json.Marshal(objectMap) } @@ -17048,6 +17152,7 @@ func (f *FrontendIPConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FrontendIPConfigurationPropertiesFormat. func (f FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "ddosSettings", f.DdosSettings) populate(objectMap, "gatewayLoadBalancer", f.GatewayLoadBalancer) populate(objectMap, "inboundNatPools", f.InboundNatPools) populate(objectMap, "inboundNatRules", f.InboundNatRules) @@ -17072,6 +17177,9 @@ func (f *FrontendIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { + case "ddosSettings": + err = unpopulate(val, "DdosSettings", &f.DdosSettings) + delete(rawMsg, key) case "gatewayLoadBalancer": err = unpopulate(val, "GatewayLoadBalancer", &f.GatewayLoadBalancer) delete(rawMsg, key) @@ -17190,10 +17298,10 @@ func (g *GatewayLoadBalancerTunnelInterface) UnmarshalJSON(data []byte) error { func (g GatewayResiliencyInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "components", g.Components) - populateDateTimeRFC3339(objectMap, "lastComputedTime", g.LastComputedTime) + populateTime[datetime.RFC3339](objectMap, "lastComputedTime", g.LastComputedTime) populate(objectMap, "maxScoreFromRecommendations", g.MaxScoreFromRecommendations) populate(objectMap, "minScoreFromRecommendations", g.MinScoreFromRecommendations) - populateDateTimeRFC3339(objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) + populateTime[datetime.RFC3339](objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) populate(objectMap, "overallScore", g.OverallScore) populate(objectMap, "scoreChange", g.ScoreChange) return json.Marshal(objectMap) @@ -17212,7 +17320,7 @@ func (g *GatewayResiliencyInformation) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Components", &g.Components) delete(rawMsg, key) case "lastComputedTime": - err = unpopulateDateTimeRFC3339(val, "LastComputedTime", &g.LastComputedTime) + err = unpopulateTime[datetime.RFC3339](val, "LastComputedTime", &g.LastComputedTime) delete(rawMsg, key) case "maxScoreFromRecommendations": err = unpopulate(val, "MaxScoreFromRecommendations", &g.MaxScoreFromRecommendations) @@ -17221,7 +17329,7 @@ func (g *GatewayResiliencyInformation) UnmarshalJSON(data []byte) error { err = unpopulate(val, "MinScoreFromRecommendations", &g.MinScoreFromRecommendations) delete(rawMsg, key) case "nextEligibleComputeTime": - err = unpopulateDateTimeRFC3339(val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) + err = unpopulateTime[datetime.RFC3339](val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) delete(rawMsg, key) case "overallScore": err = unpopulate(val, "OverallScore", &g.OverallScore) @@ -17401,8 +17509,8 @@ func (g *GatewayRouteSet) UnmarshalJSON(data []byte) error { func (g GatewayRouteSetsInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "circuitsMetadataMap", g.CircuitsMetadataMap) - populateDateTimeRFC3339(objectMap, "lastComputedTime", g.LastComputedTime) - populateDateTimeRFC3339(objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) + populateTime[datetime.RFC3339](objectMap, "lastComputedTime", g.LastComputedTime) + populateTime[datetime.RFC3339](objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) populate(objectMap, "routeSetVersion", g.RouteSetVersion) populate(objectMap, "routeSets", g.RouteSets) return json.Marshal(objectMap) @@ -17421,10 +17529,10 @@ func (g *GatewayRouteSetsInformation) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CircuitsMetadataMap", &g.CircuitsMetadataMap) delete(rawMsg, key) case "lastComputedTime": - err = unpopulateDateTimeRFC3339(val, "LastComputedTime", &g.LastComputedTime) + err = unpopulateTime[datetime.RFC3339](val, "LastComputedTime", &g.LastComputedTime) delete(rawMsg, key) case "nextEligibleComputeTime": - err = unpopulateDateTimeRFC3339(val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) + err = unpopulateTime[datetime.RFC3339](val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) delete(rawMsg, key) case "routeSetVersion": err = unpopulate(val, "RouteSetVersion", &g.RouteSetVersion) @@ -18355,6 +18463,7 @@ func (h HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allowHubToRemoteVnetTransit", h.AllowHubToRemoteVnetTransit) populate(objectMap, "allowRemoteVnetToUseHubVnetGateways", h.AllowRemoteVnetToUseHubVnetGateways) + populate(objectMap, "connectionPolicy", h.ConnectionPolicy) populate(objectMap, "enableInternetSecurity", h.EnableInternetSecurity) populate(objectMap, "provisioningState", h.ProvisioningState) populate(objectMap, "remoteVirtualNetwork", h.RemoteVirtualNetwork) @@ -18377,6 +18486,9 @@ func (h *HubVirtualNetworkConnectionProperties) UnmarshalJSON(data []byte) error case "allowRemoteVnetToUseHubVnetGateways": err = unpopulate(val, "AllowRemoteVnetToUseHubVnetGateways", &h.AllowRemoteVnetToUseHubVnetGateways) delete(rawMsg, key) + case "connectionPolicy": + err = unpopulate(val, "ConnectionPolicy", &h.ConnectionPolicy) + delete(rawMsg, key) case "enableInternetSecurity": err = unpopulate(val, "EnableInternetSecurity", &h.EnableInternetSecurity) delete(rawMsg, key) @@ -19713,6 +19825,158 @@ func (i *IntentPolicyConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type InterconnectGroup. +func (i InterconnectGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterconnectGroup. +func (i *InterconnectGroup) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InterconnectGroupListResult. +func (i InterconnectGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterconnectGroupListResult. +func (i *InterconnectGroupListResult) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InterconnectGroupNodeAvailability. +func (i InterconnectGroupNodeAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subgroupsNodeAvailability", i.SubgroupsNodeAvailability) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterconnectGroupNodeAvailability. +func (i *InterconnectGroupNodeAvailability) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subgroupsNodeAvailability": + err = unpopulate(val, "SubgroupsNodeAvailability", &i.SubgroupsNodeAvailability) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InterconnectGroupPropertiesFormat. +func (i InterconnectGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "resourceGuid", i.ResourceGUID) + populate(objectMap, "scope", i.Scope) + populate(objectMap, "subgroupProfile", i.SubgroupProfile) + populate(objectMap, "subgroups", i.Subgroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterconnectGroupPropertiesFormat. +func (i *InterconnectGroupPropertiesFormat) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &i.ResourceGUID) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &i.Scope) + delete(rawMsg, key) + case "subgroupProfile": + err = unpopulate(val, "SubgroupProfile", &i.SubgroupProfile) + delete(rawMsg, key) + case "subgroups": + err = unpopulate(val, "Subgroups", &i.Subgroups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Interface. func (i Interface) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -20600,6 +20864,37 @@ func (i *IpamPoolUpdateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ListConnectionPoliciesResult. +func (l ListConnectionPoliciesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListConnectionPoliciesResult. +func (l *ListConnectionPoliciesResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ListHubRouteTablesResult. func (l ListHubRouteTablesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -22269,6 +22564,37 @@ func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentityUserAssignedIdentities. +func (m ManagedServiceIdentityUserAssignedIdentities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", m.ClientID) + populate(objectMap, "principalId", m.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentityUserAssignedIdentities. +func (m *ManagedServiceIdentityUserAssignedIdentities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Manager. func (m Manager) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -22479,7 +22805,7 @@ func (m *ManagerConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagerDeploymentStatus. func (m ManagerDeploymentStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "commitTime", m.CommitTime) + populateTime[datetime.RFC3339](objectMap, "commitTime", m.CommitTime) populate(objectMap, "configurationIds", m.ConfigurationIDs) populate(objectMap, "deploymentStatus", m.DeploymentStatus) populate(objectMap, "deploymentType", m.DeploymentType) @@ -22498,7 +22824,7 @@ func (m *ManagerDeploymentStatus) UnmarshalJSON(data []byte) error { var err error switch key { case "commitTime": - err = unpopulateDateTimeRFC3339(val, "CommitTime", &m.CommitTime) + err = unpopulateTime[datetime.RFC3339](val, "CommitTime", &m.CommitTime) delete(rawMsg, key) case "configurationIds": err = unpopulate(val, "ConfigurationIDs", &m.ConfigurationIDs) @@ -23263,6 +23589,7 @@ func (n *NatGatewayListResult) UnmarshalJSON(data []byte) error { func (n NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "idleTimeoutInMinutes", n.IdleTimeoutInMinutes) + populate(objectMap, "nat64", n.Nat64) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "publicIpAddresses", n.PublicIPAddresses) populate(objectMap, "publicIpAddressesV6", n.PublicIPAddressesV6) @@ -23287,6 +23614,9 @@ func (n *NatGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { case "idleTimeoutInMinutes": err = unpopulate(val, "IdleTimeoutInMinutes", &n.IdleTimeoutInMinutes) delete(rawMsg, key) + case "nat64": + err = unpopulate(val, "Nat64", &n.Nat64) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) @@ -24638,14 +24968,14 @@ func (o *OperationPropertiesFormatServiceSpecification) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type OperationStatusResult. func (o OperationStatusResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", o.EndTime) + populateTime[datetime.RFC3339](objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "operations", o.Operations) populate(objectMap, "percentComplete", o.PercentComplete) populate(objectMap, "resourceId", o.ResourceID) - populateDateTimeRFC3339(objectMap, "startTime", o.StartTime) + populateTime[datetime.RFC3339](objectMap, "startTime", o.StartTime) populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } @@ -24660,7 +24990,7 @@ func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { var err error switch key { case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) + err = unpopulateTime[datetime.RFC3339](val, "EndTime", &o.EndTime) delete(rawMsg, key) case "error": err = unpopulate(val, "Error", &o.Error) @@ -24681,7 +25011,7 @@ func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ResourceID", &o.ResourceID) delete(rawMsg, key) case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) + err = unpopulateTime[datetime.RFC3339](val, "StartTime", &o.StartTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &o.Status) @@ -25235,6 +25565,7 @@ func (p *PacketCaptureFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PacketCaptureListResult. func (p PacketCaptureListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -25248,6 +25579,9 @@ func (p *PacketCaptureListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -25356,7 +25690,7 @@ func (p *PacketCaptureParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PacketCaptureQueryStatusResult. func (p PacketCaptureQueryStatusResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "captureStartTime", p.CaptureStartTime) + populateTime[datetime.RFC3339](objectMap, "captureStartTime", p.CaptureStartTime) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "packetCaptureError", p.PacketCaptureError) @@ -25375,7 +25709,7 @@ func (p *PacketCaptureQueryStatusResult) UnmarshalJSON(data []byte) error { var err error switch key { case "captureStartTime": - err = unpopulateDateTimeRFC3339(val, "CaptureStartTime", &p.CaptureStartTime) + err = unpopulateTime[datetime.RFC3339](val, "CaptureStartTime", &p.CaptureStartTime) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &p.ID) @@ -25677,92 +26011,6 @@ func (p *PatchObject) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchRouteFilter. -func (p PatchRouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilter. -func (p *PatchRouteFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchRouteFilterRule. -func (p PatchRouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilterRule. -func (p *PatchRouteFilterRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PeerExpressRouteCircuitConnection. func (p PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -25981,9 +26229,13 @@ func (p *PerimeterAssociableResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PerimeterAssociableResourceProperties. func (p PerimeterAssociableResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "outboundSupported", p.OutboundSupported) populate(objectMap, "publicDnsZones", p.PublicDNSZones) + populate(objectMap, "readinessState", p.ReadinessState) populate(objectMap, "resourceType", p.ResourceType) + populate(objectMap, "serviceTags", p.ServiceTags) return json.Marshal(objectMap) } @@ -25996,15 +26248,27 @@ func (p *PerimeterAssociableResourceProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) + case "outboundSupported": + err = unpopulate(val, "OutboundSupported", &p.OutboundSupported) + delete(rawMsg, key) case "publicDnsZones": err = unpopulate(val, "PublicDNSZones", &p.PublicDNSZones) delete(rawMsg, key) + case "readinessState": + err = unpopulate(val, "ReadinessState", &p.ReadinessState) + delete(rawMsg, key) case "resourceType": err = unpopulate(val, "ResourceType", &p.ResourceType) delete(rawMsg, key) + case "serviceTags": + err = unpopulate(val, "ServiceTags", &p.ServiceTags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -26082,7 +26346,7 @@ func (p *PerimeterBasedAccessRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PolicySettings. func (p PolicySettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "captchaCookieExpirationInMins", p.CaptchaCookieExpirationInMins) + populate(objectMap, "captchaExpirationInMins", p.CaptchaExpirationInMins) populate(objectMap, "customBlockResponseBody", p.CustomBlockResponseBody) populate(objectMap, "customBlockResponseStatusCode", p.CustomBlockResponseStatusCode) populate(objectMap, "fileUploadEnforcement", p.FileUploadEnforcement) @@ -26107,8 +26371,8 @@ func (p *PolicySettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "captchaCookieExpirationInMins": - err = unpopulate(val, "CaptchaCookieExpirationInMins", &p.CaptchaCookieExpirationInMins) + case "captchaExpirationInMins": + err = unpopulate(val, "CaptchaExpirationInMins", &p.CaptchaExpirationInMins) delete(rawMsg, key) case "customBlockResponseBody": err = unpopulate(val, "CustomBlockResponseBody", &p.CustomBlockResponseBody) @@ -26189,11 +26453,11 @@ func (p *PolicySettingsLogScrubbing) UnmarshalJSON(data []byte) error { func (p PoolAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "addressPrefixes", p.AddressPrefixes) - populateDateTimeRFC3339(objectMap, "createdAt", p.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", p.CreatedAt) populate(objectMap, "description", p.Description) populate(objectMap, "numberOfReservedIPAddresses", p.NumberOfReservedIPAddresses) populate(objectMap, "poolId", p.PoolID) - populateDateTimeRFC3339(objectMap, "reservationExpiresAt", p.ReservationExpiresAt) + populateTime[datetime.RFC3339](objectMap, "reservationExpiresAt", p.ReservationExpiresAt) populate(objectMap, "reservedPrefixes", p.ReservedPrefixes) populate(objectMap, "resourceId", p.ResourceID) populate(objectMap, "totalNumberOfIPAddresses", p.TotalNumberOfIPAddresses) @@ -26213,7 +26477,7 @@ func (p *PoolAssociation) UnmarshalJSON(data []byte) error { err = unpopulate(val, "AddressPrefixes", &p.AddressPrefixes) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &p.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &p.CreatedAt) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) @@ -26225,7 +26489,7 @@ func (p *PoolAssociation) UnmarshalJSON(data []byte) error { err = unpopulate(val, "PoolID", &p.PoolID) delete(rawMsg, key) case "reservationExpiresAt": - err = unpopulateDateTimeRFC3339(val, "ReservationExpiresAt", &p.ReservationExpiresAt) + err = unpopulateTime[datetime.RFC3339](val, "ReservationExpiresAt", &p.ReservationExpiresAt) delete(rawMsg, key) case "reservedPrefixes": err = unpopulate(val, "ReservedPrefixes", &p.ReservedPrefixes) @@ -26809,6 +27073,7 @@ func (p *PrivateEndpointListResult) UnmarshalJSON(data []byte) error { func (p PrivateEndpointProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "applicationSecurityGroups", p.ApplicationSecurityGroups) + populate(objectMap, "billingSku", p.BillingSKU) populate(objectMap, "customDnsConfigs", p.CustomDNSConfigs) populate(objectMap, "customNetworkInterfaceName", p.CustomNetworkInterfaceName) populate(objectMap, "ipConfigurations", p.IPConfigurations) @@ -26833,6 +27098,9 @@ func (p *PrivateEndpointProperties) UnmarshalJSON(data []byte) error { case "applicationSecurityGroups": err = unpopulate(val, "ApplicationSecurityGroups", &p.ApplicationSecurityGroups) delete(rawMsg, key) + case "billingSku": + err = unpopulate(val, "BillingSKU", &p.BillingSKU) + delete(rawMsg, key) case "customDnsConfigs": err = unpopulate(val, "CustomDNSConfigs", &p.CustomDNSConfigs) delete(rawMsg, key) @@ -27598,45 +27866,6 @@ func (p *ProtocolConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PublicIPAddress. func (p PublicIPAddress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -28815,49 +29044,6 @@ func (r *ResiliencyRecommendationComponents) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ResourceBasics. func (r ResourceBasics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -28998,33 +29184,6 @@ func (r *ResourceNavigationLinksListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceSet. -func (r ResourceSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "subscriptions", r.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSet. -func (r *ResourceSet) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptions": - err = unpopulate(val, "Subscriptions", &r.Subscriptions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type RetentionPolicyParameters. func (r RetentionPolicyParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -29485,11 +29644,39 @@ func (r *RouteMapRule) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RouteNextHopEcmp. +func (r RouteNextHopEcmp) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextHopIpAddresses", r.NextHopIPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteNextHopEcmp. +func (r *RouteNextHopEcmp) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextHopIpAddresses": + err = unpopulate(val, "NextHopIPAddresses", &r.NextHopIPAddresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RoutePropertiesFormat. func (r RoutePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "addressPrefix", r.AddressPrefix) populate(objectMap, "hasBgpOverride", r.HasBgpOverride) + populate(objectMap, "nextHop", r.NextHop) populate(objectMap, "nextHopIpAddress", r.NextHopIPAddress) populate(objectMap, "nextHopType", r.NextHopType) populate(objectMap, "provisioningState", r.ProvisioningState) @@ -29511,6 +29698,9 @@ func (r *RoutePropertiesFormat) UnmarshalJSON(data []byte) error { case "hasBgpOverride": err = unpopulate(val, "HasBgpOverride", &r.HasBgpOverride) delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &r.NextHop) + delete(rawMsg, key) case "nextHopIpAddress": err = unpopulate(val, "NextHopIPAddress", &r.NextHopIPAddress) delete(rawMsg, key) @@ -29649,6 +29839,7 @@ func (r *RouteTableListResult) UnmarshalJSON(data []byte) error { func (r RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "disableBgpRoutePropagation", r.DisableBgpRoutePropagation) + populate(objectMap, "disablePeeringRoute", r.DisablePeeringRoute) populate(objectMap, "provisioningState", r.ProvisioningState) populate(objectMap, "resourceGuid", r.ResourceGUID) populate(objectMap, "routes", r.Routes) @@ -29668,6 +29859,9 @@ func (r *RouteTablePropertiesFormat) UnmarshalJSON(data []byte) error { case "disableBgpRoutePropagation": err = unpopulate(val, "DisableBgpRoutePropagation", &r.DisableBgpRoutePropagation) delete(rawMsg, key) + case "disablePeeringRoute": + err = unpopulate(val, "DisablePeeringRoute", &r.DisablePeeringRoute) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) delete(rawMsg, key) @@ -30994,91 +31188,13 @@ func (s *SecurityPerimeterProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityPerimeterProxyResource. -func (s SecurityPerimeterProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPerimeterProxyResource. -func (s *SecurityPerimeterProxyResource) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPerimeterResource. -func (s SecurityPerimeterResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPerimeterResource. -func (s *SecurityPerimeterResource) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SecurityPerimeterSystemData. func (s SecurityPerimeterSystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -31094,7 +31210,7 @@ func (s *SecurityPerimeterSystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -31103,7 +31219,7 @@ func (s *SecurityPerimeterSystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -33361,6 +33477,60 @@ func (s *StaticRoutesConfig) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type StopCircuitLinkFailoverTestParameterBody. +func (s StopCircuitLinkFailoverTestParameterBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "stopParameters", s.StopParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StopCircuitLinkFailoverTestParameterBody. +func (s *StopCircuitLinkFailoverTestParameterBody) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "stopParameters": + err = unpopulate(val, "StopParameters", &s.StopParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StopSiteFailoverTestParameterBody. +func (s StopSiteFailoverTestParameterBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "stopParameters", s.StopParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StopSiteFailoverTestParameterBody. +func (s *StopSiteFailoverTestParameterBody) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "stopParameters": + err = unpopulate(val, "StopParameters", &s.StopParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SubResource. func (s SubResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -33388,6 +33558,193 @@ func (s *SubResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Subgroup. +func (s Subgroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Subgroup. +func (s *Subgroup) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubgroupListResult. +func (s SubgroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubgroupListResult. +func (s *SubgroupListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubgroupNodeAvailabilityEntry. +func (s SubgroupNodeAvailabilityEntry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", s.Count) + populate(objectMap, "inServiceNodeCount", s.InServiceNodeCount) + populate(objectMap, "inUseNodeCount", s.InUseNodeCount) + populate(objectMap, "internalSubgroupId", s.InternalSubgroupID) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubgroupNodeAvailabilityEntry. +func (s *SubgroupNodeAvailabilityEntry) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &s.Count) + delete(rawMsg, key) + case "inServiceNodeCount": + err = unpopulate(val, "InServiceNodeCount", &s.InServiceNodeCount) + delete(rawMsg, key) + case "inUseNodeCount": + err = unpopulate(val, "InUseNodeCount", &s.InUseNodeCount) + delete(rawMsg, key) + case "internalSubgroupId": + err = unpopulate(val, "InternalSubgroupID", &s.InternalSubgroupID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubgroupProfile. +func (s SubgroupProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scope", s.Scope) + populate(objectMap, "size", s.Size) + populate(objectMap, "vmSize", s.VMSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubgroupProfile. +func (s *SubgroupProfile) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scope": + err = unpopulate(val, "Scope", &s.Scope) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &s.VMSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubgroupProperties. +func (s SubgroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "interconnectBlock", s.InterconnectBlock) + populate(objectMap, "internalSubgroupId", s.InternalSubgroupID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "virtualMachines", s.VirtualMachines) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubgroupProperties. +func (s *SubgroupProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "interconnectBlock": + err = unpopulate(val, "InterconnectBlock", &s.InterconnectBlock) + delete(rawMsg, key) + case "internalSubgroupId": + err = unpopulate(val, "InternalSubgroupID", &s.InternalSubgroupID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "virtualMachines": + err = unpopulate(val, "VirtualMachines", &s.VirtualMachines) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Subnet. func (s Subnet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -33731,10 +34088,10 @@ func (s *SwapResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -33750,7 +34107,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -33759,7 +34116,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -33805,9 +34162,9 @@ func (t *TagsObject) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Topology. func (t Topology) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdDateTime", t.CreatedDateTime) + populateTime[datetime.RFC3339](objectMap, "createdDateTime", t.CreatedDateTime) populate(objectMap, "id", t.ID) - populateDateTimeRFC3339(objectMap, "lastModified", t.LastModified) + populateTime[datetime.RFC3339](objectMap, "lastModified", t.LastModified) populate(objectMap, "resources", t.Resources) return json.Marshal(objectMap) } @@ -33822,13 +34179,13 @@ func (t *Topology) UnmarshalJSON(data []byte) error { var err error switch key { case "createdDateTime": - err = unpopulateDateTimeRFC3339(val, "CreatedDateTime", &t.CreatedDateTime) + err = unpopulateTime[datetime.RFC3339](val, "CreatedDateTime", &t.CreatedDateTime) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "lastModified": - err = unpopulateDateTimeRFC3339(val, "LastModified", &t.LastModified) + err = unpopulateTime[datetime.RFC3339](val, "LastModified", &t.LastModified) delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &t.Resources) @@ -33950,53 +34307,6 @@ func (t *TopologyResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type TrafficAnalyticsConfigurationProperties. func (t TrafficAnalyticsConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -34277,9 +34587,9 @@ func (t *TroubleshootingRecommendedActions) UnmarshalJSON(data []byte) error { func (t TroubleshootingResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "code", t.Code) - populateDateTimeRFC3339(objectMap, "endTime", t.EndTime) + populateTime[datetime.RFC3339](objectMap, "endTime", t.EndTime) populate(objectMap, "results", t.Results) - populateDateTimeRFC3339(objectMap, "startTime", t.StartTime) + populateTime[datetime.RFC3339](objectMap, "startTime", t.StartTime) return json.Marshal(objectMap) } @@ -34296,13 +34606,13 @@ func (t *TroubleshootingResult) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Code", &t.Code) delete(rawMsg, key) case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &t.EndTime) + err = unpopulateTime[datetime.RFC3339](val, "EndTime", &t.EndTime) delete(rawMsg, key) case "results": err = unpopulate(val, "Results", &t.Results) delete(rawMsg, key) case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &t.StartTime) + err = unpopulateTime[datetime.RFC3339](val, "StartTime", &t.StartTime) delete(rawMsg, key) } if err != nil { @@ -36174,33 +36484,6 @@ func (v *VPNSite) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VPNSiteID. -func (v VPNSiteID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vpnSite", v.VPNSite) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteID. -func (v *VPNSiteID) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vpnSite": - err = unpopulate(val, "VPNSite", &v.VPNSite) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type VPNSiteLink. func (v VPNSiteLink) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -38323,6 +38606,7 @@ func (v VirtualNetworkAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "bandwidthInGbps", v.BandwidthInGbps) populate(objectMap, "ipConfigurations", v.IPConfigurations) + populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "resourceGuid", v.ResourceGUID) populate(objectMap, "subnet", v.Subnet) @@ -38344,6 +38628,9 @@ func (v *VirtualNetworkAppliancePropertiesFormat) UnmarshalJSON(data []byte) err case "ipConfigurations": err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) delete(rawMsg, key) + case "privateIPAddressVersion": + err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) @@ -38719,6 +39006,7 @@ func (v VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() populate(objectMap, "peer", v.Peer) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "routingConfiguration", v.RoutingConfiguration) populate(objectMap, "routingWeight", v.RoutingWeight) populate(objectMap, "sharedKey", v.SharedKey) populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) @@ -38786,6 +39074,9 @@ func (v *VirtualNetworkGatewayConnectionListEntityPropertiesFormat) UnmarshalJSO case "resourceGuid": err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &v.RoutingConfiguration) + delete(rawMsg, key) case "routingWeight": err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) delete(rawMsg, key) @@ -38870,6 +39161,7 @@ func (v VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, populate(objectMap, "peer", v.Peer) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "routingConfiguration", v.RoutingConfiguration) populate(objectMap, "routingWeight", v.RoutingWeight) populate(objectMap, "sharedKey", v.SharedKey) populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) @@ -38954,6 +39246,9 @@ func (v *VirtualNetworkGatewayConnectionPropertiesFormat) UnmarshalJSON(data []b case "resourceGuid": err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &v.RoutingConfiguration) + delete(rawMsg, key) case "routingWeight": err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) delete(rawMsg, key) @@ -39864,6 +40159,7 @@ func (v VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "resourceGuid", v.ResourceGUID) populate(objectMap, "subnets", v.Subnets) + populate(objectMap, "summarizedGatewayPrefixes", v.SummarizedGatewayPrefixes) populate(objectMap, "virtualNetworkPeerings", v.VirtualNetworkPeerings) return json.Marshal(objectMap) } @@ -39922,6 +40218,9 @@ func (v *VirtualNetworkPropertiesFormat) UnmarshalJSON(data []byte) error { case "subnets": err = unpopulate(val, "Subnets", &v.Subnets) delete(rawMsg, key) + case "summarizedGatewayPrefixes": + err = unpopulate(val, "SummarizedGatewayPrefixes", &v.SummarizedGatewayPrefixes) + delete(rawMsg, key) case "virtualNetworkPeerings": err = unpopulate(val, "VirtualNetworkPeerings", &v.VirtualNetworkPeerings) delete(rawMsg, key) @@ -40763,6 +41062,7 @@ func (w *Watcher) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WatcherListResult. func (w WatcherListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } @@ -40776,6 +41076,9 @@ func (w *WatcherListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) @@ -41067,6 +41370,17 @@ func populate(m map[string]any, k string, v any) { } } +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + } else if !reflect.ValueOf(t).IsNil() { + newTime := T(*t) + m[k] = (*T)(&newTime) + } +} + func populateAny(m map[string]any, k string, v any) { if v == nil { return @@ -41086,3 +41400,20 @@ func unpopulate(data json.RawMessage, fn string, v any) error { } return nil } + +func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux T + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + newTime := time.Time(aux) + *t = &newTime + return nil +} + +type dateTimeConstraints interface { + datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix +} diff --git a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go index 38011a80d50c..8b3935aab9e5 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client.go b/sdk/resourcemanager/network/armnetwork/natgateways_client.go index 05fd64d02958..2efd2d41f94f 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/natgateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // NatGatewaysClient contains the methods for the NatGateways group. // Don't use this type directly, use NewNatGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type NatGatewaysClient struct { internal *arm.Client subscriptionID string } // NewNatGatewaysClient creates a new instance of NatGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewNatGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatGatewaysClient, error) { @@ -43,9 +43,7 @@ func NewNatGatewaysClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates or updates a nat gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to the create or update nat gateway operation. // - options - NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *NatGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *NatGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates or updates a nat gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *NatGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *NatGatewaysClient) createOrUpdate(ctx context.Context, resourceGro // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, _ *NatGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, errors.New("parameter natGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes the specified nat gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*runtime.Poller[NatGatewaysClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes the specified nat gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginDelete" @@ -175,6 +166,10 @@ func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGr // deleteCreateRequest creates the Delete request. func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, _ *NatGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -183,26 +178,19 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, errors.New("parameter natGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified nat gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. func (client *NatGatewaysClient) Get(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (NatGatewaysClientGetResponse, error) { @@ -230,6 +218,10 @@ func (client *NatGatewaysClient) Get(ctx context.Context, resourceGroupName stri // getCreateRequest creates the Get request. func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,10 +230,6 @@ func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter natGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -250,8 +238,8 @@ func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -266,9 +254,7 @@ func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGate } // NewListPager - Gets all nat gateways in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.NewListPager method. func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options *NatGatewaysClientListOptions) *runtime.Pager[NatGatewaysClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListResponse]{ @@ -296,21 +282,21 @@ func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options // listCreateRequest creates the List request. func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *NatGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -325,8 +311,6 @@ func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGat } // NewListAllPager - Gets all the Nat Gateways in a subscription. -// -// Generated from API version 2025-05-01 // - options - NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.NewListAllPager method. func (client *NatGatewaysClient) NewListAllPager(options *NatGatewaysClientListAllOptions) *runtime.Pager[NatGatewaysClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListAllResponse]{ @@ -363,8 +347,8 @@ func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, _ *Na return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -380,9 +364,7 @@ func (client *NatGatewaysClient) listAllHandleResponse(resp *http.Response) (Nat // UpdateTags - Updates nat gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to update nat gateway tags. // - options - NatGatewaysClientUpdateTagsOptions contains the optional parameters for the NatGatewaysClient.UpdateTags method. @@ -411,6 +393,10 @@ func (client *NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupNa // updateTagsCreateRequest creates the UpdateTags request. func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject, _ *NatGatewaysClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -419,18 +405,15 @@ func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, errors.New("parameter natGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go index de9735e27e91..429baa91d789 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go @@ -1,194 +1,243 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayDelete.json -func ExampleNatGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NatGatewayCreateOrUpdate.json +func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNatGatewaysClient().BeginDelete(ctx, "rg1", "test-natGateway", nil) + poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ + Location: to.Ptr("westus"), + Properties: &armnetwork.NatGatewayPropertiesFormat{ + PublicIPAddresses: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + }, + }, + PublicIPPrefixes: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + }, + }, + }, + SKU: &armnetwork.NatGatewaySKU{ + Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayGet.json -func ExampleNatGatewaysClient_Get_getNatGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", &armnetwork.NatGatewaysClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // res = armnetwork.NatGatewaysClientCreateOrUpdateResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayGetStandardV2Sku.json -func ExampleNatGatewaysClient_Get_getNatGatewayWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/NatGatewayCreateOrUpdateStandardV2Sku.json +func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGatewayWithStandardV2Sku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", &armnetwork.NatGatewaysClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ + Location: to.Ptr("westus"), + Properties: &armnetwork.NatGatewayPropertiesFormat{ + PublicIPAddresses: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + }, + }, + PublicIPPrefixes: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + }, + }, + }, + SKU: &armnetwork.NatGatewaySKU{ + Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + }, + }, 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 poll 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPAddressesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // PublicIPPrefixesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), - // }}, - // SourceVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // res = armnetwork.NatGatewaysClientCreateOrUpdateResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // SourceVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), // }, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayWithServiceGatewayGet.json -func ExampleNatGatewaysClient_Get_getNatGatewayWithServiceGateway() { +// Generated from example definition: 2025-07-01/NatGatewayWithNat64CreateOrUpdate.json +func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGatewayWithNat64() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", &armnetwork.NatGatewaysClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ + Location: to.Ptr("westus"), + Properties: &armnetwork.NatGatewayPropertiesFormat{ + Nat64: to.Ptr(armnetwork.Nat64StateEnabled), + PublicIPAddresses: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + }, + }, + PublicIPPrefixes: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + }, + }, + }, + SKU: &armnetwork.NatGatewaySKU{ + Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + }, + }, 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 poll 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // ServiceGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // res = armnetwork.NatGatewaysClientCreateOrUpdateResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // Nat64: to.Ptr(armnetwork.Nat64StateEnabled), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayCreateOrUpdate.json -func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGateway() { +// Generated from example definition: 2025-07-01/NatGatewayWithServiceGatewayCreateOrUpdate.json +func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGatewayWithServiceGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -197,12 +246,17 @@ func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGateway() { Properties: &armnetwork.NatGatewayPropertiesFormat{ PublicIPAddresses: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + }, + }, PublicIPPrefixes: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + }, + }, + ServiceGateway: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + }, }, SKU: &armnetwork.NatGatewaySKU{ Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), @@ -213,302 +267,291 @@ func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGateway() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // res = armnetwork.NatGatewaysClientCreateOrUpdateResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // ServiceGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayCreateOrUpdateStandardV2Sku.json -func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGatewayWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/NatGatewayDelete.json +func ExampleNatGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ - Location: to.Ptr("westus"), - Properties: &armnetwork.NatGatewayPropertiesFormat{ - PublicIPAddresses: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - }}, - PublicIPPrefixes: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - }}, - }, - SKU: &armnetwork.NatGatewaySKU{ - Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), - }, - }, nil) + poller, err := clientFactory.NewNatGatewaysClient().BeginDelete(ctx, "rg1", "test-natGateway", 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) + log.Fatalf("failed to poll 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // SourceVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), - // }, + // res = armnetwork.NatGatewaysClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayWithServiceGatewayCreateOrUpdate.json -func ExampleNatGatewaysClient_BeginCreateOrUpdate_createNatGatewayWithServiceGateway() { +// Generated from example definition: 2025-07-01/NatGatewayGet.json +func ExampleNatGatewaysClient_Get_getNatGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ - Location: to.Ptr("westus"), - Properties: &armnetwork.NatGatewayPropertiesFormat{ - PublicIPAddresses: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - }}, - PublicIPPrefixes: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - }}, - ServiceGateway: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), - }, - }, - SKU: &armnetwork.NatGatewaySKU{ - Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - }, - }, nil) + res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + // 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 = armnetwork.NatGatewaysClientGetResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NatGatewayGetStandardV2Sku.json +func ExampleNatGatewaysClient_Get_getNatGatewayWithStandardV2Sku() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // ServiceGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // res = armnetwork.NatGatewaysClientGetResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPAddressesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // PublicIPPrefixesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), + // }, + // }, + // SourceVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), // }, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayUpdateTags.json -func ExampleNatGatewaysClient_UpdateTags_updateNatGatewayTags() { +// Generated from example definition: 2025-07-01/NatGatewayWithNat64Get.json +func ExampleNatGatewaysClient_Get_getNatGatewayWithNat64() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNatGatewaysClient().UpdateTags(ctx, "rg1", "test-natGateway", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // res = armnetwork.NatGatewaysClientGetResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // Nat64: to.Ptr(armnetwork.Nat64StateEnabled), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayUpdateTagsStandardV2Sku.json -func ExampleNatGatewaysClient_UpdateTags_updateNatGatewayWithStandardV2SkuTags() { +// Generated from example definition: 2025-07-01/NatGatewayWithServiceGatewayGet.json +func ExampleNatGatewaysClient_Get_getNatGatewayWithServiceGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNatGatewaysClient().UpdateTags(ctx, "rg1", "test-natGateway", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", 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.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPAddressesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // PublicIPPrefixesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), - // }}, - // SourceVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // res = armnetwork.NatGatewaysClientGetResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // ServiceGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayListAll.json -func ExampleNatGatewaysClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/NatGatewayList.json +func ExampleNatGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNatGatewaysClient().NewListAllPager(nil) + pager := clientFactory.NewNatGatewaysClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -519,110 +562,124 @@ func ExampleNatGatewaysClient_NewListAllPager() { _ = 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.NatGatewayListResult = armnetwork.NatGatewayListResult{ - // Value: []*armnetwork.NatGateway{ - // { - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("test-natGateway2"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGatewayes/test-natGateway2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // page = armnetwork.NatGatewaysClientListResponse{ + // NatGatewayListResult: armnetwork.NatGatewayListResult{ + // Value: []*armnetwork.NatGateway{ + // { + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateway/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, // }, - // }, - // { - // Name: to.Ptr("test-natGateway3"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGatewayes/test-natGateway3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPAddressesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // PublicIPPrefixesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), - // }}, - // SourceVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // { + // Name: to.Ptr("test-natGateway2"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/natGateway/test-natGateway2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + // { + // Name: to.Ptr("test-natGateway3"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/natGateway/test-natGateway3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPAddressesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // PublicIPPrefixesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), + // }, + // }, + // SourceVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatGatewayList.json -func ExampleNatGatewaysClient_NewListPager() { +// Generated from example definition: 2025-07-01/NatGatewayListAll.json +func ExampleNatGatewaysClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNatGatewaysClient().NewListPager("rg1", nil) + pager := clientFactory.NewNatGatewaysClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -633,94 +690,239 @@ func ExampleNatGatewaysClient_NewListPager() { _ = 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.NatGatewayListResult = armnetwork.NatGatewayListResult{ - // Value: []*armnetwork.NatGateway{ - // { - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateway/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("test-natGateway2"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGateway/test-natGateway2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // page = armnetwork.NatGatewaysClientListAllResponse{ + // NatGatewayListResult: armnetwork.NatGatewayListResult{ + // Value: []*armnetwork.NatGateway{ + // { + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, // }, - // }, - // { - // Name: to.Ptr("test-natGateway3"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGateway/test-natGateway3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPAddressesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // PublicIPPrefixesV6: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), - // }}, - // SourceVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // { + // Name: to.Ptr("test-natGateway2"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/natGatewayes/test-natGateway2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), // }, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + // { + // Name: to.Ptr("test-natGateway3"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/natGatewayes/test-natGateway3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPAddressesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // PublicIPPrefixesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), + // }, + // }, + // SourceVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/NatGatewayUpdateTags.json +func ExampleNatGatewaysClient_UpdateTags_updateNatGatewayTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNatGatewaysClient().UpdateTags(ctx, "rg1", "test-natGateway", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.NatGatewaysClientUpdateTagsResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NatGatewayUpdateTagsStandardV2Sku.json +func ExampleNatGatewaysClient_UpdateTags_updateNatGatewayWithStandardV2SkuTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNatGatewaysClient().UpdateTags(ctx, "rg1", "test-natGateway", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.NatGatewaysClientUpdateTagsResponse{ + // NatGateway: armnetwork.NatGateway{ + // Name: to.Ptr("test-natGateway"), + // Type: to.Ptr("Microsoft.Network/natGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.NatGatewayPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](5), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddresses: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // PublicIPAddressesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress2"), + // }, + // }, + // PublicIPPrefixes: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), + // }, + // }, + // PublicIPPrefixesV6: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix2"), + // }, + // }, + // SourceVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // }, + // Subnets: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // }, + // }, + // }, + // SKU: &armnetwork.NatGatewaySKU{ + // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandardV2), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/natrules_client.go b/sdk/resourcemanager/network/armnetwork/natrules_client.go index 1ae4bce0c7af..14d789f3e55b 100644 --- a/sdk/resourcemanager/network/armnetwork/natrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/natrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // NatRulesClient contains the methods for the NatRules group. // Don't use this type directly, use NewNatRulesClient() instead. +// +// Generated from API version 2025-07-01 type NatRulesClient struct { internal *arm.Client subscriptionID string } // NewNatRulesClient creates a new instance of NatRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatRulesClient, error) { @@ -43,11 +43,9 @@ func NewNatRulesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - natRuleParameters - Parameters supplied to create or Update a Nat Rule. // - options - NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *NatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *NatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *NatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NatRulesClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*runtime.Poller[NatRulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -142,8 +136,7 @@ func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,8 +148,6 @@ func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *NatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatRulesClient.BeginDelete" @@ -202,19 +193,16 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a nat ruleGet. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - NatRulesClientGetOptions contains the optional parameters for the NatRulesClient.Get method. func (client *NatRulesClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (NatRulesClientGetResponse, error) { var err error @@ -262,8 +250,8 @@ func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -278,9 +266,7 @@ func (client *NatRulesClient) getHandleResponse(resp *http.Response) (NatRulesCl } // NewListByVPNGatewayPager - Retrieves all nat rules for a particular virtual wan vpn gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.NewListByVPNGatewayPager // method. @@ -327,8 +313,8 @@ func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go index f02829eeaad9..62a428f0d25b 100644 --- a/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go @@ -1,154 +1,167 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatRuleGet.json -func ExampleNatRulesClient_Get() { +// Generated from example definition: 2025-07-01/NatRulePut.json +func ExampleNatRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", nil) + poller, err := clientFactory.NewNatRulesClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "natRule1", armnetwork.VPNGatewayNatRule{ + Properties: &armnetwork.VPNGatewayNatRuleProperties{ + Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + { + AddressSpace: to.Ptr("192.168.21.0/24"), + }, + }, + InternalMappings: []*armnetwork.VPNNatRuleMapping{ + { + AddressSpace: to.Ptr("10.4.0.0/24"), + }, + }, + IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), + Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + }, + }, 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 poll 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.VPNGatewayNatRule = armnetwork.VPNGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // }, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // }, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // res = armnetwork.NatRulesClientCreateOrUpdateResponse{ + // VPNGatewayNatRule: armnetwork.VPNGatewayNatRule{ + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection1"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // }, + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection2"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatRulePut.json -func ExampleNatRulesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/NatRuleDelete.json +func ExampleNatRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNatRulesClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "natRule1", armnetwork.VPNGatewayNatRule{ - Properties: &armnetwork.VPNGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("192.168.21.0/24"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("10.4.0.0/24"), - }}, - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), - Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - }, - }, nil) + poller, err := clientFactory.NewNatRulesClient().BeginDelete(ctx, "rg1", "gateway1", "natRule1", 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) + log.Fatalf("failed to poll 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.VPNGatewayNatRule = armnetwork.VPNGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.21.0/24"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection2"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.NatRulesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatRuleDelete.json -func ExampleNatRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NatRuleGet.json +func ExampleNatRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNatRulesClient().BeginDelete(ctx, "rg1", "gateway1", "natRule1", nil) + res, err := clientFactory.NewNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", 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) - } + // 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 = armnetwork.NatRulesClientGetResponse{ + // VPNGatewayNatRule: armnetwork.VPNGatewayNatRule{ + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NatRuleList.json +// Generated from example definition: 2025-07-01/NatRuleList.json func ExampleNatRulesClient_NewListByVPNGatewayPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -163,7 +176,73 @@ func ExampleNatRulesClient_NewListByVPNGatewayPager() { _ = 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.ListVPNGatewayNatRulesResult = armnetwork.ListVPNGatewayNatRulesResult{ + // page = armnetwork.NatRulesClientListByVPNGatewayResponse{ + // ListVPNGatewayNatRulesResult: armnetwork.ListVPNGatewayNatRulesResult{ + // Value: []*armnetwork.VPNGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection1"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // }, + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection2"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule2"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection1"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // }, + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection2"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG1/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go index 45f019507f6e..b31e14781c64 100644 --- a/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go index acedc545531e..12f28428d2ee 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go index 8a7c49a17fd5..03a0fa85cf69 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go index ebae8bae192f..067b07fd9542 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go index 80f1da3a5ac7..e4b6eb881b0d 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go index f714fcec5eb8..3a0c98efbd08 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go b/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go index 511d863a7193..3b09ee2d4bbc 100644 --- a/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go b/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go index a7946c30a144..518d7bce671d 100644 --- a/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go b/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go index 0191fa7c6495..1c3d8bf5f923 100644 --- a/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/operation_live_test.go b/sdk/resourcemanager/network/armnetwork/operation_live_test.go index 06ab05634d66..5852291a9778 100644 --- a/sdk/resourcemanager/network/armnetwork/operation_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/operation_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/operations_client.go b/sdk/resourcemanager/network/armnetwork/operations_client.go index f62f48f041dd..4a663d0bb58f 100644 --- a/sdk/resourcemanager/network/armnetwork/operations_client.go +++ b/sdk/resourcemanager/network/armnetwork/operations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -12,10 +11,13 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" + "strings" ) // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. +// +// Generated from API version 2025-07-01 type OperationsClient struct { internal *arm.Client } @@ -35,8 +37,6 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Network Rest API operations. -// -// Generated from API version 2025-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -69,8 +69,8 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go index 14a65a69a2f0..d80febf05984 100644 --- a/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/OperationList.json +// Generated from example definition: 2025-07-01/OperationList.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 := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,128 +33,135 @@ func ExampleOperationsClient_NewListPager() { _ = 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 = armnetwork.OperationListResult{ - // Value: []*armnetwork.Operation{ - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets LocalNetworkGateway"), - // Operation: to.Ptr("Get LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/write"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Creates or updates an existing LocalNetworkGateway"), - // Operation: to.Ptr("Create or update LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), + // page = armnetwork.OperationsClientListResponse{ + // OperationListResult: armnetwork.OperationListResult{ + // Value: []*armnetwork.Operation{ + // { + // Name: to.Ptr("Microsoft.Network/localnetworkgateways/read"), + // Display: &armnetwork.OperationDisplay{ + // Description: to.Ptr("Gets LocalNetworkGateway"), + // Operation: to.Ptr("Get LocalNetworkGateway"), + // Provider: to.Ptr("Microsoft Network"), + // Resource: to.Ptr("LocalNetworkGateway"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/delete"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Deletes LocalNetworkGateway"), - // Operation: to.Ptr("Delete LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), + // { + // Name: to.Ptr("Microsoft.Network/localnetworkgateways/write"), + // Display: &armnetwork.OperationDisplay{ + // Description: to.Ptr("Creates or updates an existing LocalNetworkGateway"), + // Operation: to.Ptr("Create or update LocalNetworkGateway"), + // Provider: to.Ptr("Microsoft Network"), + // Resource: to.Ptr("LocalNetworkGateway"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/networkInterfaces/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets available metrics for the Network Interface"), - // Operation: to.Ptr("Read Network Interface metric definitions"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("Network Interface metric definition"), + // { + // Name: to.Ptr("Microsoft.Network/localnetworkgateways/delete"), + // Display: &armnetwork.OperationDisplay{ + // Description: to.Ptr("Deletes LocalNetworkGateway"), + // Operation: to.Ptr("Delete LocalNetworkGateway"), + // Provider: to.Ptr("Microsoft Network"), + // Resource: to.Ptr("LocalNetworkGateway"), + // }, // }, - // Origin: to.Ptr("system"), - // Properties: &armnetwork.OperationPropertiesFormat{ - // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ - // MetricSpecifications: []*armnetwork.MetricSpecification{ - // { - // Name: to.Ptr("BytesSentRate"), - // AggregationType: to.Ptr("Total"), - // Availabilities: []*armnetwork.Availability{ - // { - // BlobDuration: to.Ptr("01:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("00:01:00"), + // { + // Name: to.Ptr("Microsoft.Network/networkInterfaces/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armnetwork.OperationDisplay{ + // Description: to.Ptr("Gets available metrics for the Network Interface"), + // Operation: to.Ptr("Read Network Interface metric definitions"), + // Provider: to.Ptr("Microsoft Network"), + // Resource: to.Ptr("Network Interface metric definition"), + // }, + // Origin: to.Ptr("system"), + // Properties: &armnetwork.OperationPropertiesFormat{ + // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ + // MetricSpecifications: []*armnetwork.MetricSpecification{ + // { + // Name: to.Ptr("BytesSentRate"), + // AggregationType: to.Ptr("Total"), + // Availabilities: []*armnetwork.Availability{ + // { + // BlobDuration: to.Ptr("01:00:00"), + // Retention: to.Ptr("00:00:00"), + // TimeGrain: to.Ptr("00:01:00"), + // }, + // { + // BlobDuration: to.Ptr("1.00:00:00"), + // Retention: to.Ptr("00:00:00"), + // TimeGrain: to.Ptr("01:00:00"), + // }, + // }, + // Dimensions: []*armnetwork.Dimension{ // }, - // { - // BlobDuration: to.Ptr("1.00:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("01:00:00"), - // }}, - // Dimensions: []*armnetwork.Dimension{ + // DisplayDescription: to.Ptr("Number of bytes the Network Interface sent"), + // DisplayName: to.Ptr("Bytes Sent"), + // EnableRegionalMdmAccount: to.Ptr(false), + // FillGapWithZero: to.Ptr(false), + // IsInternal: to.Ptr(false), + // MetricFilterPattern: to.Ptr("^__Ready__$"), + // Unit: to.Ptr("Count"), // }, - // DisplayDescription: to.Ptr("Number of bytes the Network Interface sent"), - // DisplayName: to.Ptr("Bytes Sent"), - // EnableRegionalMdmAccount: to.Ptr(false), - // FillGapWithZero: to.Ptr(false), - // IsInternal: to.Ptr(false), - // MetricFilterPattern: to.Ptr("^__Ready__$"), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("BytesReceivedRate"), - // AggregationType: to.Ptr("Total"), - // Availabilities: []*armnetwork.Availability{ - // { - // BlobDuration: to.Ptr("01:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("00:01:00"), + // { + // Name: to.Ptr("BytesReceivedRate"), + // AggregationType: to.Ptr("Total"), + // Availabilities: []*armnetwork.Availability{ + // { + // BlobDuration: to.Ptr("01:00:00"), + // Retention: to.Ptr("00:00:00"), + // TimeGrain: to.Ptr("00:01:00"), + // }, + // { + // BlobDuration: to.Ptr("1.00:00:00"), + // Retention: to.Ptr("00:00:00"), + // TimeGrain: to.Ptr("01:00:00"), + // }, + // }, + // Dimensions: []*armnetwork.Dimension{ // }, - // { - // BlobDuration: to.Ptr("1.00:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("01:00:00"), - // }}, - // Dimensions: []*armnetwork.Dimension{ + // DisplayDescription: to.Ptr("Number of bytes the Network Interface received"), + // DisplayName: to.Ptr("Bytes Received"), + // EnableRegionalMdmAccount: to.Ptr(false), + // FillGapWithZero: to.Ptr(false), + // IsInternal: to.Ptr(false), + // MetricFilterPattern: to.Ptr("^__Ready__$"), + // Unit: to.Ptr("Count"), // }, - // DisplayDescription: to.Ptr("Number of bytes the Network Interface received"), - // DisplayName: to.Ptr("Bytes Received"), - // EnableRegionalMdmAccount: to.Ptr(false), - // FillGapWithZero: to.Ptr(false), - // IsInternal: to.Ptr(false), - // MetricFilterPattern: to.Ptr("^__Ready__$"), - // Unit: to.Ptr("Count"), - // }}, + // }, + // }, // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/networksecuritygroups/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets the events for network security group"), - // Operation: to.Ptr("Get Network Security Group Event Log Definitions"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("Network Security Groups Log Definitions"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetwork.OperationPropertiesFormat{ - // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ - // LogSpecifications: []*armnetwork.LogSpecification{ - // { - // Name: to.Ptr("NetworkSecurityGroupEvent"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Event"), - // }, - // { - // Name: to.Ptr("NetworkSecurityGroupRuleCounter"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Rule Counter"), + // { + // Name: to.Ptr("Microsoft.Network/networksecuritygroups/providers/Microsoft.Insights/logDefinitions/read"), + // Display: &armnetwork.OperationDisplay{ + // Description: to.Ptr("Gets the events for network security group"), + // Operation: to.Ptr("Get Network Security Group Event Log Definitions"), + // Provider: to.Ptr("Microsoft Network"), + // Resource: to.Ptr("Network Security Groups Log Definitions"), + // }, + // Origin: to.Ptr("system"), + // Properties: &armnetwork.OperationPropertiesFormat{ + // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ + // LogSpecifications: []*armnetwork.LogSpecification{ + // { + // Name: to.Ptr("NetworkSecurityGroupEvent"), + // BlobDuration: to.Ptr("PT1H"), + // DisplayName: to.Ptr("Network Security Group Event"), + // }, + // { + // Name: to.Ptr("NetworkSecurityGroupRuleCounter"), + // BlobDuration: to.Ptr("PT1H"), + // DisplayName: to.Ptr("Network Security Group Rule Counter"), + // }, + // { + // Name: to.Ptr("NetworkSecurityGroupFlowEvent"), + // BlobDuration: to.Ptr("PT1H"), + // DisplayName: to.Ptr("Network Security Group Rule Flow Event"), + // }, // }, - // { - // Name: to.Ptr("NetworkSecurityGroupFlowEvent"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Rule Flow Event"), - // }}, + // }, // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/options.go b/sdk/resourcemanager/network/armnetwork/options.go index 9b60c66a23ca..d2b67c5edf7f 100644 --- a/sdk/resourcemanager/network/armnetwork/options.go +++ b/sdk/resourcemanager/network/armnetwork/options.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -31,8 +30,8 @@ type AdminRuleCollectionsClientGetOptions struct { // method. type AdminRuleCollectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -62,8 +61,8 @@ type AdminRulesClientGetOptions struct { // AdminRulesClientListOptions contains the optional parameters for the AdminRulesClient.NewListPager method. type AdminRulesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -315,6 +314,9 @@ type AzureFirewallFqdnTagsClientListAllOptions struct { // AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate // method. type AzureFirewallsClientBeginCreateOrUpdateOptions struct { + // When set to true, creates an AFC control plane for the Azure Firewall. + CreateAfcControlPlane *bool + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -409,6 +411,34 @@ type BgpServiceCommunitiesClientListOptions struct { // placeholder for future optional parameters } +// CommitsClientBeginCreateOrUpdateOptions contains the optional parameters for the CommitsClient.BeginCreateOrUpdate method. +type CommitsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// CommitsClientBeginDeleteOptions contains the optional parameters for the CommitsClient.BeginDelete method. +type CommitsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// CommitsClientGetOptions contains the optional parameters for the CommitsClient.Get method. +type CommitsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CommitsClientListOptions contains the optional parameters for the CommitsClient.NewListPager method. +type CommitsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + // ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate // method. type ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions struct { @@ -474,6 +504,30 @@ type ConnectionMonitorsClientUpdateTagsOptions struct { // placeholder for future optional parameters } +// ConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionPoliciesClient.BeginCreateOrUpdate +// method. +type ConnectionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ConnectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ConnectionPoliciesClient.BeginDelete +// method. +type ConnectionPoliciesClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ConnectionPoliciesClientGetOptions contains the optional parameters for the ConnectionPoliciesClient.Get method. +type ConnectionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectionPoliciesClientListOptions contains the optional parameters for the ConnectionPoliciesClient.NewListPager method. +type ConnectionPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + // ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete // method. type ConnectivityConfigurationsClientBeginDeleteOptions struct { @@ -501,8 +555,8 @@ type ConnectivityConfigurationsClientGetOptions struct { // method. type ConnectivityConfigurationsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -562,6 +616,17 @@ type DdosCustomPoliciesClientGetOptions struct { // placeholder for future optional parameters } +// DdosCustomPoliciesClientListAllOptions contains the optional parameters for the DdosCustomPoliciesClient.NewListAllPager +// method. +type DdosCustomPoliciesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// DdosCustomPoliciesClientListOptions contains the optional parameters for the DdosCustomPoliciesClient.NewListPager method. +type DdosCustomPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + // DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags // method. type DdosCustomPoliciesClientUpdateTagsOptions struct { @@ -737,6 +802,26 @@ type ExpressRouteCircuitsClientBeginDeleteOptions struct { ResumeToken string } +// ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails +// method. +type ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverAllTestsDetailsOptions struct { + // The type of failover test. + FailoverTestType *string + + // Fetch only the latest tests. + FetchLatest *bool + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions contains the optional parameters for the +// ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails method. +type ExpressRouteCircuitsClientBeginGetCircuitLinkFailoverSingleTestDetailsOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable // method. type ExpressRouteCircuitsClientBeginListArpTableOptions struct { @@ -758,6 +843,20 @@ type ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions struct { ResumeToken string } +// ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest +// method. +type ExpressRouteCircuitsClientBeginStartCircuitLinkFailoverTestOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest +// method. +type ExpressRouteCircuitsClientBeginStopCircuitLinkFailoverTestOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get method. type ExpressRouteCircuitsClientGetOptions struct { // placeholder for future optional parameters @@ -910,6 +1009,60 @@ type ExpressRouteGatewaysClientBeginDeleteOptions struct { ResumeToken string } +// ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails +// method. +type ExpressRouteGatewaysClientBeginGetFailoverAllTestsDetailsOptions struct { + // Fetch only the latest tests for each peering location. + FetchLatest *bool + + // Resumes the long-running operation from the provided token. + ResumeToken string + + // The type of failover test. + Type *string +} + +// ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails +// method. +type ExpressRouteGatewaysClientBeginGetFailoverSingleTestDetailsOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetResiliencyInformation +// method. +type ExpressRouteGatewaysClientBeginGetResiliencyInformationOptions struct { + // Whether to attempt a refresh of the resiliency information. + AttemptRefresh *bool + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginGetRoutesInformationOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginGetRoutesInformation +// method. +type ExpressRouteGatewaysClientBeginGetRoutesInformationOptions struct { + // Whether to attempt a refresh of the route sets. + AttemptRefresh *bool + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginStartSiteFailoverTest +// method. +type ExpressRouteGatewaysClientBeginStartSiteFailoverTestOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginStopSiteFailoverTest +// method. +type ExpressRouteGatewaysClientBeginStopSiteFailoverTestOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags // method. type ExpressRouteGatewaysClientBeginUpdateTagsOptions struct { @@ -1225,8 +1378,8 @@ type GroupsClientGetOptions struct { // GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. type GroupsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -1387,6 +1540,46 @@ type InboundSecurityRuleClientGetOptions struct { // placeholder for future optional parameters } +// InterconnectGroupsClientBeginGetNodeAvailabilityOptions contains the optional parameters for the InterconnectGroupsClient.BeginGetNodeAvailability +// method. +type InterconnectGroupsClientBeginGetNodeAvailabilityOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// InterconnectGroupsClientCreateOrUpdateOptions contains the optional parameters for the InterconnectGroupsClient.CreateOrUpdate +// method. +type InterconnectGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// InterconnectGroupsClientDeleteOptions contains the optional parameters for the InterconnectGroupsClient.Delete method. +type InterconnectGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// InterconnectGroupsClientGetOptions contains the optional parameters for the InterconnectGroupsClient.Get method. +type InterconnectGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InterconnectGroupsClientListAllOptions contains the optional parameters for the InterconnectGroupsClient.NewListAllPager +// method. +type InterconnectGroupsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// InterconnectGroupsClientListOptions contains the optional parameters for the InterconnectGroupsClient.NewListPager method. +type InterconnectGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// InterconnectGroupsClientUpdateTagsOptions contains the optional parameters for the InterconnectGroupsClient.UpdateTags +// method. +type InterconnectGroupsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + // InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get // method. type InterfaceIPConfigurationsClientGetOptions struct { @@ -1585,9 +1778,6 @@ type IpamPoolsClientListOptions struct { // IpamPoolsClientUpdateOptions contains the optional parameters for the IpamPoolsClient.Update method. type IpamPoolsClientUpdateOptions struct { - // Pool resource object to update partially. - Body *IpamPoolUpdate - // The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. IfMatch *string } @@ -1706,6 +1896,10 @@ type LoadBalancersClientBeginSwapPublicIPAddressesOptions struct { // LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. type LoadBalancersClientGetOptions struct { + // Controls verbosity of the returned load balancer resource. When set to 'Reduced', read-only back-reference collections + // (e.g., rules referencing frontendIPConfigurations) are omitted from the response. + DetailLevel *LoadBalancerDetailLevel + // Expands referenced resources. Expand *string } @@ -1878,8 +2072,8 @@ type ManagementGroupNetworkManagerConnectionsClientGetOptions struct { // method. type ManagementGroupNetworkManagerConnectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -1925,8 +2119,8 @@ type ManagerRoutingConfigurationsClientGetOptions struct { // method. type ManagerRoutingConfigurationsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -1957,8 +2151,8 @@ type ManagersClientGetOptions struct { // method. type ManagersClientListBySubscriptionOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -1968,8 +2162,8 @@ type ManagersClientListBySubscriptionOptions struct { // ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. type ManagersClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2725,8 +2919,8 @@ type RoutingRuleCollectionsClientGetOptions struct { // method. type RoutingRuleCollectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2756,8 +2950,8 @@ type RoutingRulesClientGetOptions struct { // RoutingRulesClientListOptions contains the optional parameters for the RoutingRulesClient.NewListPager method. type RoutingRulesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2783,8 +2977,8 @@ type ScopeConnectionsClientGetOptions struct { // ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager method. type ScopeConnectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2818,8 +3012,8 @@ type SecurityAdminConfigurationsClientGetOptions struct { // method. type SecurityAdminConfigurationsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2919,8 +3113,8 @@ type SecurityPerimeterAccessRulesClientGetOptions struct { // method. type SecurityPerimeterAccessRulesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2963,8 +3157,8 @@ type SecurityPerimeterAssociationsClientGetOptions struct { // method. type SecurityPerimeterAssociationsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -2994,8 +3188,8 @@ type SecurityPerimeterLinkReferencesClientGetOptions struct { // method. type SecurityPerimeterLinkReferencesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3024,8 +3218,8 @@ type SecurityPerimeterLinksClientGetOptions struct { // method. type SecurityPerimeterLinksClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3084,8 +3278,8 @@ type SecurityPerimeterProfilesClientGetOptions struct { // method. type SecurityPerimeterProfilesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3123,8 +3317,8 @@ type SecurityPerimetersClientGetOptions struct { // method. type SecurityPerimetersClientListBySubscriptionOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3134,8 +3328,8 @@ type SecurityPerimetersClientListBySubscriptionOptions struct { // SecurityPerimetersClientListOptions contains the optional parameters for the SecurityPerimetersClient.NewListPager method. type SecurityPerimetersClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3197,8 +3391,8 @@ type SecurityUserConfigurationsClientGetOptions struct { // method. type SecurityUserConfigurationsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3232,8 +3426,8 @@ type SecurityUserRuleCollectionsClientGetOptions struct { // method. type SecurityUserRuleCollectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3265,8 +3459,8 @@ type SecurityUserRulesClientGetOptions struct { // SecurityUserRulesClientListOptions contains the optional parameters for the SecurityUserRulesClient.NewListPager method. type SecurityUserRulesClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3424,8 +3618,7 @@ type StaticCidrsClientBeginDeleteOptions struct { // StaticCidrsClientCreateOptions contains the optional parameters for the StaticCidrsClient.Create method. type StaticCidrsClientCreateOptions struct { - // StaticCidr resource object to create/update. - Body *StaticCidr + // placeholder for future optional parameters } // StaticCidrsClientGetOptions contains the optional parameters for the StaticCidrsClient.Get method. @@ -3469,14 +3662,24 @@ type StaticMembersClientGetOptions struct { // StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.NewListPager method. type StaticMembersClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. Top *int32 } +// SubgroupsClientGetOptions contains the optional parameters for the SubgroupsClient.Get method. +type SubgroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubgroupsClientListOptions contains the optional parameters for the SubgroupsClient.NewListPager method. +type SubgroupsClientListOptions struct { + // placeholder for future optional parameters +} + // SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate method. type SubnetsClientBeginCreateOrUpdateOptions struct { // Resumes the long-running operation from the provided token. @@ -3536,8 +3739,8 @@ type SubscriptionNetworkManagerConnectionsClientGetOptions struct { // method. type SubscriptionNetworkManagerConnectionsClientListOptions struct { // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. + // the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent + // calls. SkipToken *string // An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -3849,9 +4052,6 @@ type VerifierWorkspacesClientListOptions struct { // VerifierWorkspacesClientUpdateOptions contains the optional parameters for the VerifierWorkspacesClient.Update method. type VerifierWorkspacesClientUpdateOptions struct { - // Verifier Workspace object to create/update. - Body *VerifierWorkspaceUpdate - // The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. IfMatch *string } diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go index 7b05894b41a2..7535fc679f23 100644 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // P2SVPNGatewaysClient contains the methods for the P2SVPNGateways group. // Don't use this type directly, use NewP2SVPNGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type P2SVPNGatewaysClient struct { internal *arm.Client subscriptionID string } // NewP2SVPNGatewaysClient creates a new instance of P2SVPNGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewP2SVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*P2SVPNGatewaysClient, error) { @@ -43,9 +43,7 @@ func NewP2SVPNGatewaysClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to create or Update a virtual wan p2s vpn gateway. // - options - P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *P2SVPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *P2SVPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *P2SVPNGatewaysClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *P2SVPNGatewaysClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDelete" @@ -193,18 +184,15 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginDisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - p2SVPNGatewayName - The name of the P2S Vpn Gateway. // - request - The parameters are supplied to disconnect p2s vpn connections. // - options - P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections @@ -216,8 +204,7 @@ func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -230,8 +217,6 @@ func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context // DisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections" @@ -273,9 +258,9 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } @@ -284,10 +269,8 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx // BeginGenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the gateway. // - parameters - Parameters supplied to the generate P2SVpnGateway VPN client package operation. // - options - P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile // method. @@ -298,8 +281,7 @@ func (client *P2SVPNGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGenerateVPNProfileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -311,8 +293,6 @@ func (client *P2SVPNGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, // GenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGenerateVPNProfile" @@ -337,6 +317,10 @@ func (client *P2SVPNGatewaysClient) generateVPNProfile(ctx context.Context, reso // generateVPNProfileCreateRequest creates the GenerateVPNProfile request. func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, _ *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -345,18 +329,15 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -365,9 +346,7 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. // Get - Retrieves the details of a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. func (client *P2SVPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (P2SVPNGatewaysClientGetResponse, error) { @@ -412,8 +391,8 @@ func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -430,10 +409,8 @@ func (client *P2SVPNGatewaysClient) getHandleResponse(resp *http.Response) (P2SV // BeginGetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth // method. func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*runtime.Poller[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse], error) { @@ -443,8 +420,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -457,8 +433,6 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.C // GetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth" @@ -483,6 +457,10 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Contex // getP2SVPNConnectionHealthCreateRequest creates the GetP2SVPNConnectionHealth request. func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -491,17 +469,13 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -509,10 +483,8 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c // BeginGetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the gateway. // - request - Request parameters supplied to get p2s vpn connections detailed health. // - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed // method. @@ -523,8 +495,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -537,8 +508,6 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx c // GetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed" @@ -580,9 +549,10 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } @@ -590,8 +560,6 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque } // NewListPager - Lists all the P2SVpnGateways in a subscription. -// -// Generated from API version 2025-05-01 // - options - P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListPager method. func (client *P2SVPNGatewaysClient) NewListPager(options *P2SVPNGatewaysClientListOptions) *runtime.Pager[P2SVPNGatewaysClientListResponse] { return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListResponse]{ @@ -628,8 +596,8 @@ func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, _ *P2 return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -644,9 +612,7 @@ func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2S } // NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager // method. func (client *P2SVPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[P2SVPNGatewaysClientListByResourceGroupResponse] { @@ -688,8 +654,8 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -705,9 +671,7 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupHandleResponse(resp *http // BeginReset - Resets the primary of the p2s vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset // method. @@ -718,8 +682,7 @@ func (client *P2SVPNGatewaysClient) BeginReset(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -731,8 +694,6 @@ func (client *P2SVPNGatewaysClient) BeginReset(ctx context.Context, resourceGrou // Reset - Resets the primary of the p2s vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginReset" @@ -757,6 +718,10 @@ func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName // resetCreateRequest creates the Reset request. func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *P2SVPNGatewaysClientBeginResetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -765,26 +730,20 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginUpdateTags - Updates virtual wan p2s vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to update a virtual wan p2s vpn gateway tags. // - options - P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags @@ -796,8 +755,7 @@ func (client *P2SVPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -809,8 +767,6 @@ func (client *P2SVPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourc // UpdateTags - Updates virtual wan p2s vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *P2SVPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginUpdateTags" @@ -852,9 +808,10 @@ func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go index c9362d2a3539..8d3ef9c65a30 100644 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go @@ -1,63 +1,125 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayGet.json -func ExampleP2SVPNGatewaysClient_Get() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayPut.json +func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewP2SVPNGatewaysClient().Get(ctx, "rg1", "p2sVpnGateway1", nil) + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNGateway{ + Location: to.Ptr("West US"), + Properties: &armnetwork.P2SVPNGatewayProperties{ + CustomDNSServers: []*string{ + to.Ptr("1.1.1.1"), + to.Ptr("2.2.2.2"), + }, + IsRoutingPreferenceInternet: to.Ptr(false), + P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ + { + Name: to.Ptr("P2SConnectionConfig1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + Properties: &armnetwork.P2SConnectionConfigurationProperties{ + RoutingConfiguration: &armnetwork.RoutingConfiguration{ + AssociatedRouteTable: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + }, + PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + IDs: []*armnetwork.SubResource{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + }, + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + }, + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + }, + }, + Labels: []*string{ + to.Ptr("label1"), + to.Ptr("label2"), + }, + }, + VnetRoutes: &armnetwork.VnetRoute{ + StaticRoutes: []*armnetwork.StaticRoute{}, + }, + }, + VPNClientAddressPool: &armnetwork.AddressSpace{ + AddressPrefixes: []*string{ + to.Ptr("101.3.0.0/16"), + }, + }, + }, + }, + }, + VirtualHub: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + }, + VPNGatewayScaleUnit: to.Ptr[int32](1), + VPNServerConfiguration: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, 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 poll 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.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // res = armnetwork.P2SVPNGatewaysClientCreateOrUpdateResponse{ + // P2SVPNGateway: armnetwork.P2SVPNGateway{ + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -65,124 +127,109 @@ func ExampleP2SVPNGatewaysClient_Get() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, // Labels: []*string{ // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, + // to.Ptr("label2"), // }, // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, // }, // }, - // } + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](0), + // TotalIngressBytesTransferred: to.Ptr[int64](0), + // VPNClientConnectionsCount: to.Ptr[int32](0), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayPut.json -func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayDelete.json +func ExampleP2SVPNGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNGateway{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.P2SVPNGatewayProperties{ - CustomDNSServers: []*string{ - to.Ptr("1.1.1.1"), - to.Ptr("2.2.2.2")}, - IsRoutingPreferenceInternet: to.Ptr(false), - P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - Name: to.Ptr("P2SConnectionConfig1"), - Properties: &armnetwork.P2SConnectionConfigurationProperties{ - RoutingConfiguration: &armnetwork.RoutingConfiguration{ - AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - IDs: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - }}, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, - VnetRoutes: &armnetwork.VnetRoute{ - StaticRoutes: []*armnetwork.StaticRoute{}, - }, - }, - VPNClientAddressPool: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("101.3.0.0/16")}, - }, - }, - }}, - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - }, - VPNGatewayScaleUnit: to.Ptr[int32](1), - VPNServerConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - }, + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDelete(ctx, "rg1", "p2sVpnGateway1", 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 poll 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 = armnetwork.P2SVPNGatewaysClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/P2sVpnGatewaysDisconnectP2sVpnConnections.json +func ExampleP2SVPNGatewaysClient_BeginDisconnectP2SVPNConnections() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDisconnectP2SVPNConnections(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionRequest{ + VPNConnectionIDs: []*string{ + to.Ptr("vpnconnId1"), + to.Ptr("vpnconnId2"), }, }, nil) if err != nil { @@ -190,37 +237,92 @@ func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse{ + // } +} + +// Generated from example definition: 2025-07-01/P2SVpnGatewayGenerateVpnProfile.json +func ExampleP2SVPNGatewaysClient_BeginGenerateVPNProfile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNProfileParameters{ + AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), + }, 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 poll 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 = armnetwork.P2SVPNGatewaysClientGenerateVPNProfileResponse{ + // VPNProfileResponse: armnetwork.VPNProfileResponse{ + // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // } +} + +// Generated from example definition: 2025-07-01/P2SVpnGatewayGet.json +func ExampleP2SVPNGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewP2SVPNGatewaysClient().Get(ctx, "rg1", "p2sVpnGateway1", 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.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, + // res = armnetwork.P2SVPNGatewaysClientGetResponse{ + // P2SVPNGateway: armnetwork.P2SVPNGateway{ + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -228,116 +330,120 @@ func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, // Labels: []*string{ // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, + // to.Ptr("label2"), // }, // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ // }, - // TotalEgressBytesTransferred: to.Ptr[int64](0), - // TotalIngressBytesTransferred: to.Ptr[int64](0), - // VPNClientConnectionsCount: to.Ptr[int32](0), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, + // }, // }, // }, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayUpdateTags.json -func ExampleP2SVPNGatewaysClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayGetConnectionHealth.json +func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "p2sVpnGateway1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealth(ctx, "rg1", "p2sVpnGateway1", 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) + log.Fatalf("failed to poll 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.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // res = armnetwork.P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse{ + // P2SVPNGateway: armnetwork.P2SVPNGateway{ + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -345,94 +451,91 @@ func ExampleP2SVPNGatewaysClient_BeginUpdateTags() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, // }, // }, - // } + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayDelete.json -func ExampleP2SVPNGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayGetConnectionHealthDetailed.json +func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealthDetailed() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDelete(ctx, "rg1", "p2sVpnGateway1", nil) + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealthDetailed(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionHealthRequest{ + OutputBlobSasURL: to.Ptr("https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), + VPNUserNamesFilter: []*string{ + to.Ptr("vpnUser1"), + to.Ptr("vpnUser2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse{ + // P2SVPNConnectionHealth: armnetwork.P2SVPNConnectionHealth{ + // SasURL: to.Ptr("aaaaaaaaaaaaaaaaaa"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayListByResourceGroup.json -func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayList.json +func ExampleP2SVPNGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewP2SVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewP2SVPNGatewaysClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -443,32 +546,36 @@ func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() { _ = 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.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{ - // Value: []*armnetwork.P2SVPNGateway{ - // { - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // page = armnetwork.P2SVPNGatewaysClientListResponse{ + // ListP2SVPNGatewaysResult: armnetwork.ListP2SVPNGatewaysResult{ + // Value: []*armnetwork.P2SVPNGateway{ + // { + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, + // EnableInternetSecurity: to.Ptr(true), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -476,159 +583,180 @@ func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, // Labels: []*string{ // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, + // to.Ptr("label2"), // }, // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, // }, // }, // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("p2sVpnGateway2"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("4.4.4.4"), + // }, + // IsRoutingPreferenceInternet: to.Ptr(false), + // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // Name: to.Ptr("p2sVpnGateway2"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), - // Location: to.Ptr("West US"), + // Name: to.Ptr("P2SConnectionConfig1"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("4.4.4.4")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // Properties: &armnetwork.P2SConnectionConfigurationProperties{ + // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, + // EnableInternetSecurity: to.Ptr(true), + // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), // }, - // }}, - // } + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.4.0.0/16"), + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayList.json -func ExampleP2SVPNGatewaysClient_NewListPager() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayListByResourceGroup.json +func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewP2SVPNGatewaysClient().NewListPager(nil) + pager := clientFactory.NewP2SVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -639,33 +767,35 @@ func ExampleP2SVPNGatewaysClient_NewListPager() { _ = 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.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{ - // Value: []*armnetwork.P2SVPNGateway{ - // { - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // page = armnetwork.P2SVPNGatewaysClientListByResourceGroupResponse{ + // ListP2SVPNGatewaysResult: armnetwork.ListP2SVPNGatewaysResult{ + // Value: []*armnetwork.P2SVPNGateway{ + // { + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(true), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, + // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -673,158 +803,173 @@ func ExampleP2SVPNGatewaysClient_NewListPager() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, // Labels: []*string{ // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, + // to.Ptr("label2"), // }, // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, // }, // }, // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("p2sVpnGateway2"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("4.4.4.4"), + // }, + // IsRoutingPreferenceInternet: to.Ptr(false), + // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // Name: to.Ptr("p2sVpnGateway2"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("4.4.4.4")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(true), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.4.0.0/16")}, - // }, - // }, - // }}, + // Name: to.Ptr("P2SConnectionConfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // Properties: &armnetwork.P2SConnectionConfigurationProperties{ + // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, + // EnableInternetSecurity: to.Ptr(false), + // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // }, + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), // }, - // }}, - // } + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // VPNClientAddressPool: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.3.0.0/16"), + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayReset.json +// Generated from example definition: 2025-07-01/P2SVpnGatewayReset.json func ExampleP2SVPNGatewaysClient_BeginReset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -834,36 +979,39 @@ func ExampleP2SVPNGatewaysClient_BeginReset() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // res = armnetwork.P2SVPNGatewaysClientResetResponse{ + // P2SVPNGateway: armnetwork.P2SVPNGateway{ + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -871,114 +1019,98 @@ func ExampleP2SVPNGatewaysClient_BeginReset() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // VPNClientAddressPool: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // to.Ptr("101.3.0.0/16"), // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayGenerateVpnProfile.json -func ExampleP2SVPNGatewaysClient_BeginGenerateVPNProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNProfileParameters{ - AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), - }, 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.VPNProfileResponse = armnetwork.VPNProfileResponse{ - // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayGetConnectionHealth.json -func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealth() { +// Generated from example definition: 2025-07-01/P2SVpnGatewayUpdateTags.json +func ExampleP2SVPNGatewaysClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealth(ctx, "rg1", "p2sVpnGateway1", nil) + poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "p2sVpnGateway1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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) + log.Fatalf("failed to poll 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.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, + // res = armnetwork.P2SVPNGatewaysClientUpdateTagsResponse{ + // P2SVPNGateway: armnetwork.P2SVPNGateway{ + // Name: to.Ptr("p2sVpnGateway1"), + // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.P2SVPNGatewayProperties{ + // CustomDNSServers: []*string{ + // to.Ptr("3.3.3.3"), + // }, // IsRoutingPreferenceInternet: to.Ptr(false), // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), // Properties: &armnetwork.P2SConnectionConfigurationProperties{ // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), + // }, + // }, // EnableInternetSecurity: to.Ptr(false), // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Name: to.Ptr("policyGroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ // IsDefault: to.Ptr(true), // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -986,91 +1118,69 @@ func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealth() { // Name: to.Ptr("policy1"), // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), // AttributeValue: to.Ptr("6ad1bd08"), - // }}, + // }, + // }, // Priority: to.Ptr[int32](0), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, // VPNClientAddressPool: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, + // to.Ptr("101.3.0.0/16"), // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2SVpnGatewayGetConnectionHealthDetailed.json -func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealthDetailed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealthDetailed(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionHealthRequest{ - OutputBlobSasURL: to.Ptr("https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), - VPNUserNamesFilter: []*string{ - to.Ptr("vpnUser1"), - to.Ptr("vpnUser2")}, - }, 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.P2SVPNConnectionHealth = armnetwork.P2SVPNConnectionHealth{ - // SasURL: to.Ptr("aaaaaaaaaaaaaaaaaa"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ + // AllocatedIPAddresses: []*string{ + // to.Ptr("1.1.1.1"), + // to.Ptr("2.2.2.2"), + // }, + // TotalEgressBytesTransferred: to.Ptr[int64](3000), + // TotalIngressBytesTransferred: to.Ptr[int64](2000), + // VPNClientConnectionsCount: to.Ptr[int32](2), + // }, + // VPNGatewayScaleUnit: to.Ptr[int32](1), + // VPNServerConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/P2sVpnGatewaysDisconnectP2sVpnConnections.json -func ExampleP2SVPNGatewaysClient_BeginDisconnectP2SVPNConnections() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDisconnectP2SVPNConnections(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionRequest{ - VPNConnectionIDs: []*string{ - to.Ptr("vpnconnId1"), - to.Ptr("vpnconnId2")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go b/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go index bec7099a6293..0377f2607c9c 100644 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go +++ b/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PacketCapturesClient contains the methods for the PacketCaptures group. // Don't use this type directly, use NewPacketCapturesClient() instead. +// +// Generated from API version 2025-07-01 type PacketCapturesClient struct { internal *arm.Client subscriptionID string } // NewPacketCapturesClient creates a new instance of PacketCapturesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPacketCapturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PacketCapturesClient, error) { @@ -43,9 +43,7 @@ func NewPacketCapturesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create and start a packet capture on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. // - parameters - Parameters that define the create packet capture operation. @@ -71,8 +69,6 @@ func (client *PacketCapturesClient) BeginCreate(ctx context.Context, resourceGro // Create - Create and start a packet capture on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PacketCapturesClient) create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginCreate" @@ -97,6 +93,10 @@ func (client *PacketCapturesClient) create(ctx context.Context, resourceGroupNam // createCreateRequest creates the Create request. func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, _ *PacketCapturesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res return nil, errors.New("parameter packetCaptureName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,9 +126,7 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res // BeginDelete - Deletes the specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. // - options - PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete @@ -143,8 +138,7 @@ func (client *PacketCapturesClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +150,6 @@ func (client *PacketCapturesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PacketCapturesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginDelete" @@ -182,6 +174,10 @@ func (client *PacketCapturesClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, _ *PacketCapturesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,26 +190,19 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter packetCaptureName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a packet capture session by name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. // - options - PacketCapturesClientGetOptions contains the optional parameters for the PacketCapturesClient.Get method. @@ -242,6 +231,10 @@ func (client *PacketCapturesClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, _ *PacketCapturesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -254,17 +247,13 @@ func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter packetCaptureName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,11 +269,9 @@ func (client *PacketCapturesClient) getHandleResponse(resp *http.Response) (Pack // BeginGetStatus - Query the status of a running packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkWatcherName - The name of the Network Watcher resource. -// - packetCaptureName - The name given to the packet capture session. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. +// - packetCaptureName - The name of the packet capture session. // - options - PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus // method. func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*runtime.Poller[PacketCapturesClientGetStatusResponse], error) { @@ -294,8 +281,7 @@ func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientGetStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -307,8 +293,6 @@ func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resource // GetStatus - Query the status of a running packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PacketCapturesClient) getStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginGetStatus" @@ -333,6 +317,10 @@ func (client *PacketCapturesClient) getStatus(ctx context.Context, resourceGroup // getStatusCreateRequest creates the GetStatus request. func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, _ *PacketCapturesClientBeginGetStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -345,45 +333,38 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, return nil, errors.New("parameter packetCaptureName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListPager - Lists all packet capture sessions within the specified resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkWatcherName - The name of the Network Watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - options - PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.NewListPager method. func (client *PacketCapturesClient) NewListPager(resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) *runtime.Pager[PacketCapturesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PacketCapturesClientListResponse]{ More: func(page PacketCapturesClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *PacketCapturesClientListResponse) (PacketCapturesClientListResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PacketCapturesClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return PacketCapturesClientListResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + }, nil) if err != nil { return PacketCapturesClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PacketCapturesClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -393,6 +374,10 @@ func (client *PacketCapturesClient) NewListPager(resourceGroupName string, netwo // listCreateRequest creates the List request. func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, _ *PacketCapturesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -401,17 +386,13 @@ func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resou return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -427,9 +408,7 @@ func (client *PacketCapturesClient) listHandleResponse(resp *http.Response) (Pac // BeginStop - Stops a specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. // - options - PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop @@ -441,8 +420,7 @@ func (client *PacketCapturesClient) BeginStop(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -454,8 +432,6 @@ func (client *PacketCapturesClient) BeginStop(ctx context.Context, resourceGroup // Stop - Stops a specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PacketCapturesClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginStop" @@ -480,6 +456,10 @@ func (client *PacketCapturesClient) stop(ctx context.Context, resourceGroupName // stopCreateRequest creates the Stop request. func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, _ *PacketCapturesClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -492,17 +472,12 @@ func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resou return nil, errors.New("parameter packetCaptureName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go b/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go index 2228046d805e..5ef6989d5768 100644 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCaptureCreate.json +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCaptureCreate.json func ExamplePacketCapturesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -34,13 +31,14 @@ func ExamplePacketCapturesClient_BeginCreate() { LocalIPAddress: to.Ptr("10.0.0.4"), LocalPort: to.Ptr("80"), Protocol: to.Ptr(armnetwork.PcProtocolTCP), - }}, + }, + }, StorageLocation: &armnetwork.PacketCaptureStorageLocation{ FilePath: to.Ptr("D:\\capture\\pc1.cap"), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), + StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), }, - Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), TimeLimitInSeconds: to.Ptr[int32](100), TotalBytesPerSession: to.Ptr[int64](100000), }, @@ -50,61 +48,18 @@ func ExamplePacketCapturesClient_BeginCreate() { } _, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCaptureGet.json -func ExamplePacketCapturesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPacketCapturesClient().Get(ctx, "rg1", "nw1", "pc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.PacketCaptureResult = armnetwork.PacketCaptureResult{ - // Name: to.Ptr("pc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ - // { - // LocalIPAddress: to.Ptr("10.0.0.4"), - // LocalPort: to.Ptr("80"), - // Protocol: to.Ptr(armnetwork.PcProtocolTCP), - // }}, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc1.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), - // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCaptureDelete.json +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCaptureDelete.json func ExamplePacketCapturesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -114,39 +69,64 @@ func ExamplePacketCapturesClient_BeginDelete() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCaptureStop.json -func ExamplePacketCapturesClient_BeginStop() { +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCaptureGet.json +func ExamplePacketCapturesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPacketCapturesClient().BeginStop(ctx, "rg1", "nw1", "pc1", nil) + res, err := clientFactory.NewPacketCapturesClient().Get(ctx, "rg1", "nw1", "pc1", 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) - } + // 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 = armnetwork.PacketCapturesClientGetResponse{ + // PacketCaptureResult: armnetwork.PacketCaptureResult{ + // Name: to.Ptr("pc1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), + // Properties: &armnetwork.PacketCaptureResultProperties{ + // BytesToCapturePerPacket: to.Ptr[int64](10000), + // Filters: []*armnetwork.PacketCaptureFilter{ + // { + // LocalIPAddress: to.Ptr("10.0.0.4"), + // LocalPort: to.Ptr("80"), + // Protocol: to.Ptr(armnetwork.PcProtocolTCP), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ + // FilePath: to.Ptr("D:\\capture\\pc1.cap"), + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), + // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), + // }, + // Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + // TimeLimitInSeconds: to.Ptr[int32](100), + // TotalBytesPerSession: to.Ptr[int64](100000), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCaptureQueryStatus.json +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCaptureQueryStatus.json func ExamplePacketCapturesClient_BeginGetStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -156,30 +136,32 @@ func ExamplePacketCapturesClient_BeginGetStatus() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PacketCaptureQueryStatusResult = armnetwork.PacketCaptureQueryStatusResult{ - // Name: to.Ptr("pc1"), - // CaptureStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-07T12:35:24.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // PacketCaptureError: []*armnetwork.PcError{ + // res = armnetwork.PacketCapturesClientGetStatusResponse{ + // PacketCaptureQueryStatusResult: armnetwork.PacketCaptureQueryStatusResult{ + // Name: to.Ptr("pc1"), + // CaptureStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-07T12:35:24Z"); return t}()), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), + // PacketCaptureError: []*armnetwork.PcError{ + // }, + // PacketCaptureStatus: to.Ptr(armnetwork.PcStatusStopped), + // StopReason: to.Ptr("TimeExceeded"), // }, - // PacketCaptureStatus: to.Ptr(armnetwork.PcStatusStopped), - // StopReason: to.Ptr("TimeExceeded"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherPacketCapturesList.json +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCapturesList.json func ExamplePacketCapturesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -194,50 +176,80 @@ func ExamplePacketCapturesClient_NewListPager() { _ = 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.PacketCaptureListResult = armnetwork.PacketCaptureListResult{ - // Value: []*armnetwork.PacketCaptureResult{ - // { - // Name: to.Ptr("pc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ - // { - // LocalIPAddress: to.Ptr("10.0.0.4"), - // LocalPort: to.Ptr("80"), - // Protocol: to.Ptr(armnetwork.PcProtocolTCP), - // }}, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc1.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), + // page = armnetwork.PacketCapturesClientListResponse{ + // PacketCaptureListResult: armnetwork.PacketCaptureListResult{ + // Value: []*armnetwork.PacketCaptureResult{ + // { + // Name: to.Ptr("pc1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), + // Properties: &armnetwork.PacketCaptureResultProperties{ + // BytesToCapturePerPacket: to.Ptr[int64](10000), + // Filters: []*armnetwork.PacketCaptureFilter{ + // { + // LocalIPAddress: to.Ptr("10.0.0.4"), + // LocalPort: to.Ptr("80"), + // Protocol: to.Ptr(armnetwork.PcProtocolTCP), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ + // FilePath: to.Ptr("D:\\capture\\pc1.cap"), + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), + // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), + // }, + // Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + // TimeLimitInSeconds: to.Ptr[int32](100), + // TotalBytesPerSession: to.Ptr[int64](100000), // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // Name: to.Ptr("pc2"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc2"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ + // { + // Name: to.Ptr("pc2"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc2"), + // Properties: &armnetwork.PacketCaptureResultProperties{ + // BytesToCapturePerPacket: to.Ptr[int64](10000), + // Filters: []*armnetwork.PacketCaptureFilter{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ + // FilePath: to.Ptr("D:\\capture\\pc2.cap"), + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), + // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc2.cap"), + // }, + // Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + // TimeLimitInSeconds: to.Ptr[int32](100), + // TotalBytesPerSession: to.Ptr[int64](100000), // }, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc2.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc2.cap"), - // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/NetworkWatcherPacketCaptureStop.json +func ExamplePacketCapturesClient_BeginStop() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPacketCapturesClient().BeginStop(ctx, "rg1", "nw1", "pc1", 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 poll 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 = armnetwork.PacketCapturesClientStopResponse{ + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go index 42651f98d679..c4c3a69e36ad 100644 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PeerExpressRouteCircuitConnectionsClient contains the methods for the PeerExpressRouteCircuitConnections group. // Don't use this type directly, use NewPeerExpressRouteCircuitConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type PeerExpressRouteCircuitConnectionsClient struct { internal *arm.Client subscriptionID string } // NewPeerExpressRouteCircuitConnectionsClient creates a new instance of PeerExpressRouteCircuitConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeerExpressRouteCircuitConnectionsClient, error) { @@ -43,12 +43,10 @@ func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string, credenti // Get - Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the express route circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. -// - connectionName - The name of the peer express route circuit connection. +// - connectionName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - PeerExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.Get // method. func (client *PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (PeerExpressRouteCircuitConnectionsClientGetResponse, error) { @@ -76,6 +74,10 @@ func (client *PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, // getCreateRequest creates the Get request. func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, _ *PeerExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -92,17 +94,13 @@ func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx con return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -117,10 +115,8 @@ func (client *PeerExpressRouteCircuitConnectionsClient) getHandleResponse(resp * } // NewListPager - Gets all global reach peer connections associated with a private peering in an express route circuit. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - circuitName - The name of the circuit. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - circuitName - The name of express route circuit. // - peeringName - The name of the peering. // - options - PeerExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.NewListPager // method. @@ -150,6 +146,10 @@ func (client *PeerExpressRouteCircuitConnectionsClient) NewListPager(resourceGro // listCreateRequest creates the List request. func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, _ *PeerExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -162,17 +162,13 @@ func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx co return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go index 6e30cccb2c21..f2efb50a8fa9 100644 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PeerExpressRouteCircuitConnectionGet.json +// Generated from example definition: 2025-07-01/PeerExpressRouteCircuitConnectionGet.json func ExamplePeerExpressRouteCircuitConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,34 +29,36 @@ func ExamplePeerExpressRouteCircuitConnectionsClient_Get() { // 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.PeerExpressRouteCircuitConnection = armnetwork.PeerExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/29"), - // AuthResourceGUID: to.Ptr(""), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), + // res = armnetwork.PeerExpressRouteCircuitConnectionsClientGetResponse{ + // PeerExpressRouteCircuitConnection: armnetwork.PeerExpressRouteCircuitConnection{ + // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), + // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), + // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("20.0.0.0/29"), + // AuthResourceGUID: to.Ptr(""), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PeerExpressRouteCircuitConnectionList.json +// Generated from example definition: 2025-07-01/PeerExpressRouteCircuitConnectionList.json func ExamplePeerExpressRouteCircuitConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -74,44 +73,47 @@ func ExamplePeerExpressRouteCircuitConnectionsClient_NewListPager() { _ = 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.PeerExpressRouteCircuitConnectionListResult = armnetwork.PeerExpressRouteCircuitConnectionListResult{ - // Value: []*armnetwork.PeerExpressRouteCircuitConnection{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/29"), - // AuthResourceGUID: to.Ptr(""), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), + // page = armnetwork.PeerExpressRouteCircuitConnectionsClientListResponse{ + // PeerExpressRouteCircuitConnectionListResult: armnetwork.PeerExpressRouteCircuitConnectionListResult{ + // Value: []*armnetwork.PeerExpressRouteCircuitConnection{ + // { + // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), + // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), + // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("20.0.0.0/29"), + // AuthResourceGUID: to.Ptr(""), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), - // Name: to.Ptr("c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("30.0.0.0/29"), - // AuthResourceGUID: to.Ptr("64283012-d377-421d-8398-f6aeb2ac7ea0"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionCentralusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), + // { + // Name: to.Ptr("c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), + // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), + // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ + // AddressPrefix: to.Ptr("30.0.0.0/29"), + // AuthResourceGUID: to.Ptr("64283012-d377-421d-8398-f6aeb2ac7ea0"), + // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), + // ConnectionName: to.Ptr("circuitConnectionCentralusEastus"), + // ExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), + // }, + // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitC/peerings/AzurePrivatePeering"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitC/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go b/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go index 9a5287914232..a52d586ab046 100644 --- a/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go +++ b/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork diff --git a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go index e98efc29f409..031882b78e5a 100644 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PrivateDNSZoneGroupsClient contains the methods for the PrivateDNSZoneGroups group. // Don't use this type directly, use NewPrivateDNSZoneGroupsClient() instead. +// +// Generated from API version 2025-07-01 type PrivateDNSZoneGroupsClient struct { internal *arm.Client subscriptionID string } // NewPrivateDNSZoneGroupsClient creates a new instance of PrivateDNSZoneGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateDNSZoneGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateDNSZoneGroupsClient, error) { @@ -43,11 +43,9 @@ func NewPrivateDNSZoneGroupsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. -// - privateDNSZoneGroupName - The name of the private dns zone group. +// - privateDNSZoneGroupName - The name of the private endpoint. // - parameters - Parameters supplied to the create or update private dns zone group operation. // - options - PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate // method. @@ -71,8 +69,6 @@ func (client *PrivateDNSZoneGroupsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateDNSZoneGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateDNSZoneGroupsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdate(ctx context.Context, re // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, _ *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +126,9 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified private dns zone group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. -// - privateDNSZoneGroupName - The name of the private dns zone group. +// - privateDNSZoneGroupName - The name of the private endpoint. // - options - PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete // method. func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*runtime.Poller[PrivateDNSZoneGroupsClientDeleteResponse], error) { @@ -143,8 +138,7 @@ func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateDNSZoneGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +150,6 @@ func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified private dns zone group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateDNSZoneGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateDNSZoneGroupsClient.BeginDelete" @@ -182,6 +174,10 @@ func (client *PrivateDNSZoneGroupsClient) deleteOperation(ctx context.Context, r // deleteCreateRequest creates the Delete request. func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, _ *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +190,21 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the private dns zone group resource by specified private dns zone group name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. -// - privateDNSZoneGroupName - The name of the private dns zone group. +// - privateDNSZoneGroupName - The name of the private endpoint. // - options - PrivateDNSZoneGroupsClientGetOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.Get // method. func (client *PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientGetOptions) (PrivateDNSZoneGroupsClientGetResponse, error) { @@ -243,6 +232,10 @@ func (client *PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, _ *PrivateDNSZoneGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +248,13 @@ func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,8 +269,6 @@ func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) } // NewListPager - Gets all private dns zone groups in a private endpoint. -// -// Generated from API version 2025-05-01 // - privateEndpointName - The name of the private endpoint. // - resourceGroupName - The name of the resource group. // - options - PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.NewListPager @@ -312,6 +299,10 @@ func (client *PrivateDNSZoneGroupsClient) NewListPager(privateEndpointName strin // listCreateRequest creates the List request. func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, _ *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointName == "" { return nil, errors.New("parameter privateEndpointName cannot be empty") } @@ -320,17 +311,13 @@ func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go index 6066d60092b5..3850603c0d80 100644 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go @@ -1,178 +1,196 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointDnsZoneGroupDelete.json -func ExamplePrivateDNSZoneGroupsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/PrivateEndpointDnsZoneGroupCreate.json +func ExamplePrivateDNSZoneGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginDelete(ctx, "rg1", "testPe", "testPdnsgroup", nil) + poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", "testPdnsgroup", armnetwork.PrivateDNSZoneGroup{ + Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ + PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ + { + Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), + }, + }, + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.PrivateDNSZoneGroupsClientCreateOrUpdateResponse{ + // PrivateDNSZoneGroup: armnetwork.PrivateDNSZoneGroup{ + // Name: to.Ptr("testPdnsgroup"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), + // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ + // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ + // { + // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + // PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), + // RecordSets: []*armnetwork.RecordSet{ + // { + // Fqdn: to.Ptr("abc.zone1.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.4"), + // }, + // RecordSetName: to.Ptr("abc"), + // RecordType: to.Ptr("A"), + // }, + // { + // Fqdn: to.Ptr("abc2.zone1.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.5"), + // }, + // RecordSetName: to.Ptr("abc2"), + // RecordType: to.Ptr("A"), + // }, + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointDnsZoneGroupGet.json -func ExamplePrivateDNSZoneGroupsClient_Get() { +// Generated from example definition: 2025-07-01/PrivateEndpointDnsZoneGroupDelete.json +func ExamplePrivateDNSZoneGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateDNSZoneGroupsClient().Get(ctx, "rg1", "testPe", "testPdnsgroup", nil) + poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginDelete(ctx, "rg1", "testPe", "testPdnsgroup", 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 poll 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.PrivateDNSZoneGroup = armnetwork.PrivateDNSZoneGroup{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), - // Name: to.Ptr("testPdnsgroup"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }, - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.6")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.7")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + // res = armnetwork.PrivateDNSZoneGroupsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointDnsZoneGroupCreate.json -func ExamplePrivateDNSZoneGroupsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/PrivateEndpointDnsZoneGroupGet.json +func ExamplePrivateDNSZoneGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", "testPdnsgroup", armnetwork.PrivateDNSZoneGroup{ - Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - { - Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - }, - }}, - }, - }, nil) + res, err := clientFactory.NewPrivateDNSZoneGroupsClient().Get(ctx, "rg1", "testPe", "testPdnsgroup", 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.PrivateDNSZoneGroup = armnetwork.PrivateDNSZoneGroup{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), - // Name: to.Ptr("testPdnsgroup"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, + // res = armnetwork.PrivateDNSZoneGroupsClientGetResponse{ + // PrivateDNSZoneGroup: armnetwork.PrivateDNSZoneGroup{ + // Name: to.Ptr("testPdnsgroup"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), + // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ + // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ + // { + // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + // PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), + // RecordSets: []*armnetwork.RecordSet{ + // { + // Fqdn: to.Ptr("abc.zone1.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.4"), + // }, // RecordSetName: to.Ptr("abc"), // RecordType: to.Ptr("A"), // }, // { // Fqdn: to.Ptr("abc2.zone1.com"), // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, + // to.Ptr("10.0.0.5"), + // }, + // RecordSetName: to.Ptr("abc2"), + // RecordType: to.Ptr("A"), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + // PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), + // RecordSets: []*armnetwork.RecordSet{ + // { + // Fqdn: to.Ptr("abc.zone2.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.6"), + // }, + // RecordSetName: to.Ptr("abc"), + // RecordType: to.Ptr("A"), + // }, + // { + // Fqdn: to.Ptr("abc2.zone2.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.7"), + // }, + // RecordSetName: to.Ptr("abc2"), + // RecordType: to.Ptr("A"), + // }, + // }, + // }, + // }, // }, - // } + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointDnsZoneGroupList.json +// Generated from example definition: 2025-07-01/PrivateEndpointDnsZoneGroupList.json func ExamplePrivateDNSZoneGroupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -187,64 +205,75 @@ func ExamplePrivateDNSZoneGroupsClient_NewListPager() { _ = 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.PrivateDNSZoneGroupListResult = armnetwork.PrivateDNSZoneGroupListResult{ - // Value: []*armnetwork.PrivateDNSZoneGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup1"), - // Name: to.Ptr("testPdnsgroup1"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, + // page = armnetwork.PrivateDNSZoneGroupsClientListResponse{ + // PrivateDNSZoneGroupListResult: armnetwork.PrivateDNSZoneGroupListResult{ + // Value: []*armnetwork.PrivateDNSZoneGroup{ + // { + // Name: to.Ptr("testPdnsgroup1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup1"), + // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ + // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ + // { + // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + // PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), + // RecordSets: []*armnetwork.RecordSet{ + // { + // Fqdn: to.Ptr("abc.zone1.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.4"), + // }, // RecordSetName: to.Ptr("abc"), // RecordType: to.Ptr("A"), // }, // { // Fqdn: to.Ptr("abc2.zone1.com"), // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, + // to.Ptr("10.0.0.5"), + // }, + // RecordSetName: to.Ptr("abc2"), + // RecordType: to.Ptr("A"), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup2"), - // Name: to.Ptr("testPdnsgroup2"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc3.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.6")}, - // RecordSetName: to.Ptr("abc3"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc4.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.7")}, - // RecordSetName: to.Ptr("abc4"), - // RecordType: to.Ptr("A"), - // }}, + // }, + // { + // Name: to.Ptr("testPdnsgroup2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup2"), + // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ + // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ + // { + // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ + // PrivateDNSZoneID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), + // RecordSets: []*armnetwork.RecordSet{ + // { + // Fqdn: to.Ptr("abc3.zone2.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.6"), + // }, + // RecordSetName: to.Ptr("abc3"), + // RecordType: to.Ptr("A"), + // }, + // { + // Fqdn: to.Ptr("abc4.zone2.com"), + // IPAddresses: []*string{ + // to.Ptr("10.0.0.7"), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RecordSetName: to.Ptr("abc4"), + // RecordType: to.Ptr("A"), + // }, + // }, // }, - // }}, - // } + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go index 8e341f388033..c5dd49c45020 100644 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go +++ b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PrivateEndpointsClient contains the methods for the PrivateEndpoints group. // Don't use this type directly, use NewPrivateEndpointsClient() instead. +// +// Generated from API version 2025-07-01 type PrivateEndpointsClient struct { internal *arm.Client subscriptionID string } // NewPrivateEndpointsClient creates a new instance of PrivateEndpointsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointsClient, error) { @@ -43,9 +43,7 @@ func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates an private endpoint in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. // - parameters - Parameters supplied to the create or update private endpoint operation. // - options - PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *PrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *PrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates an private endpoint in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *PrivateEndpointsClient) createOrUpdate(ctx context.Context, resour // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, _ *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter privateEndpointName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, _ *PrivateEndpointsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter privateEndpointName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified private endpoint by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. func (client *PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (PrivateEndpointsClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter privateEndpointName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (Pr } // NewListPager - Gets all private endpoints in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager // method. func (client *PrivateEndpointsClient) NewListPager(resourceGroupName string, options *PrivateEndpointsClientListOptions) *runtime.Pager[PrivateEndpointsClientListResponse] { @@ -298,21 +284,21 @@ func (client *PrivateEndpointsClient) NewListPager(resourceGroupName string, opt // listCreateRequest creates the List request. func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *PrivateEndpointsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -327,8 +313,6 @@ func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (P } // NewListBySubscriptionPager - Gets all private endpoints in a subscription. -// -// Generated from API version 2025-05-01 // - options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager // method. func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { @@ -366,8 +350,8 @@ func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go index 52c9145736d1..0c8ad6b5dc97 100644 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go @@ -1,282 +1,148 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointDelete.json -func ExamplePrivateEndpointsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/PrivateEndpointCreate.json +func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpoint() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginDelete(ctx, "rg1", "testPe", nil) + poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ + Location: to.Ptr("eastus2euap"), + Properties: &armnetwork.PrivateEndpointProperties{ + CustomNetworkInterfaceName: to.Ptr("testPeNic"), + IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + { + Name: to.Ptr("pestaticconfig"), + Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + GroupID: to.Ptr("file"), + MemberName: to.Ptr("file"), + PrivateIPAddress: to.Ptr("192.168.0.6"), + }, + }, + }, + IPVersionType: to.Ptr(armnetwork.PrivateEndpointIPVersionTypeIPv4), + PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + { + Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + GroupIDs: []*string{ + to.Ptr("groupIdFromResource"), + }, + PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + RequestMessage: to.Ptr("Please approve my connection."), + }, + }, + }, + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + }, + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointGet.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, + // res = armnetwork.PrivateEndpointsClientCreateOrUpdateResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus2euap"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ // { - // Fqdn: to.Ptr("abc2.cosmos.com"), + // Fqdn: to.Ptr("abc.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.6"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig2"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.7"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // to.Ptr("192.168.0.4"), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointGetWithASG.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithApplicationSecurityGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - // }}, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // to.Ptr("192.168.0.5"), + // }, // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.6"), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointGetForManualApproval.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithManualApprovalConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.5"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please manually approve my connection."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please approve my connection."), // }, // }, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointCreate.json -func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpoint() { +// Generated from example definition: 2025-07-01/PrivateEndpointCreateForManualApproval.json +func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWithManualApprovalConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ - Location: to.Ptr("eastus2euap"), + Location: to.Ptr("eastus"), Properties: &armnetwork.PrivateEndpointProperties{ CustomNetworkInterfaceName: to.Ptr("testPeNic"), IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ @@ -285,21 +151,23 @@ func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpoint() { Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ GroupID: to.Ptr("file"), MemberName: to.Ptr("file"), - PrivateIPAddress: to.Ptr("192.168.0.6"), + PrivateIPAddress: to.Ptr("192.168.0.5"), }, - }}, - IPVersionType: to.Ptr(armnetwork.PrivateEndpointIPVersionTypeIPv4), - PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + }, + }, + ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ { Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - RequestMessage: to.Ptr("Please approve my connection."), + to.Ptr("groupIdFromResource"), + }, + PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + RequestMessage: to.Ptr("Please manually approve my connection."), }, - }}, + }, + }, Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), }, }, }, nil) @@ -308,76 +176,85 @@ func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpoint() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // res = armnetwork.PrivateEndpointsClientCreateOrUpdateResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.6"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.5"), + // }, // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Awaiting approval"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Pending"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please manually approve my connection."), // }, // }, - // } + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointCreateWithASG.json +// Generated from example definition: 2025-07-01/PrivateEndpointCreateWithASG.json func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWithApplicationSecurityGroups() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -386,19 +263,22 @@ func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWith Properties: &armnetwork.PrivateEndpointProperties{ ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), + }, + }, PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ { Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + to.Ptr("groupIdFromResource"), + }, + PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), RequestMessage: to.Ptr("Please approve my connection."), }, - }}, + }, + }, Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), }, }, }, nil) @@ -407,173 +287,358 @@ func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWith } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - // }}, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // res = armnetwork.PrivateEndpointsClientCreateOrUpdateResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus2euap"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), + // }, + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // to.Ptr("192.168.0.5"), + // }, // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please approve my connection."), // }, // }, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointCreateForManualApproval.json -func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWithManualApprovalConnection() { +// Generated from example definition: 2025-07-01/PrivateEndpointDelete.json +func ExamplePrivateEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PrivateEndpointProperties{ - CustomNetworkInterfaceName: to.Ptr("testPeNic"), - IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - { - Name: to.Ptr("pestaticconfig"), - Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - GroupID: to.Ptr("file"), - MemberName: to.Ptr("file"), - PrivateIPAddress: to.Ptr("192.168.0.5"), - }, - }}, - ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - { - Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - RequestMessage: to.Ptr("Please manually approve my connection."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) + poller, err := clientFactory.NewPrivateEndpointsClient().BeginDelete(ctx, "rg1", "testPe", 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) + log.Fatalf("failed to poll 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.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // res = armnetwork.PrivateEndpointsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/PrivateEndpointGet.json +func ExamplePrivateEndpointsClient_Get_getPrivateEndpoint() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", 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 = armnetwork.PrivateEndpointsClientGetResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, + // }, + // { + // Fqdn: to.Ptr("abc2.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.6"), + // }, + // }, + // { + // Name: to.Ptr("pestaticconfig2"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.7"), + // }, + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please approve my connection."), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // }, + // } +} + +// Generated from example definition: 2025-07-01/PrivateEndpointGetForManualApproval.json +func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithManualApprovalConnection() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", 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 = armnetwork.PrivateEndpointsClientGetResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.5"), + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Awaiting approval"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Pending"), // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please manually approve my connection."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please manually approve my connection."), + // }, + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/PrivateEndpointGetWithASG.json +func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithApplicationSecurityGroups() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", 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 = armnetwork.PrivateEndpointsClientGetResponse{ + // PrivateEndpoint: armnetwork.PrivateEndpoint{ + // Name: to.Ptr("testPe"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), + // }, + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // { + // Fqdn: to.Ptr("abc2.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // RequestMessage: to.Ptr("Please approve my connection."), // }, // }, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointList.json +// Generated from example definition: 2025-07-01/PrivateEndpointList.json func ExamplePrivateEndpointsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -588,148 +653,165 @@ func ExamplePrivateEndpointsClient_NewListPager() { _ = 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.PrivateEndpointListResult = armnetwork.PrivateEndpointListResult{ - // Value: []*armnetwork.PrivateEndpoint{ - // { - // Name: to.Ptr("pe1"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // page = armnetwork.PrivateEndpointsClientListResponse{ + // PrivateEndpointListResult: armnetwork.PrivateEndpointListResult{ + // Value: []*armnetwork.PrivateEndpoint{ + // { + // Name: to.Ptr("pe1"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.10"), - // }, + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.10"), + // }, + // }, + // { + // Name: to.Ptr("pestaticconfig"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.11"), // }, - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.11"), + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // RequestMessage: to.Ptr("Please approve my connection for pe1."), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // { + // Name: to.Ptr("pe2"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc3.cosmos1.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.6"), + // }, // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // RequestMessage: to.Ptr("Please approve my connection for pe1."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // { + // Fqdn: to.Ptr("abc4.cosmos1.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.7"), // }, // }, // }, - // { - // Name: to.Ptr("pe2"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig3"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.8"), // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc3.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.6")}, - // }, - // { - // Fqdn: to.Ptr("abc4.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.7")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig3"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.8"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig4"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.9"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), - // }, - // }, - // }}, - // } + // }, + // { + // Name: to.Ptr("pestaticconfig4"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.9"), + // }, + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Awaiting approval"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Pending"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), + // }, + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateEndpointListAll.json +// Generated from example definition: 2025-07-01/PrivateEndpointListAll.json func ExamplePrivateEndpointsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -744,196 +826,220 @@ func ExamplePrivateEndpointsClient_NewListBySubscriptionPager() { _ = 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.PrivateEndpointListResult = armnetwork.PrivateEndpointListResult{ - // Value: []*armnetwork.PrivateEndpoint{ - // { - // Name: to.Ptr("pe1"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, + // page = armnetwork.PrivateEndpointsClientListBySubscriptionResponse{ + // PrivateEndpointListResult: armnetwork.PrivateEndpointListResult{ + // Value: []*armnetwork.PrivateEndpoint{ + // { + // Name: to.Ptr("pe1"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc.cosmos.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.4"), + // }, // }, // { // Fqdn: to.Ptr("abc2.cosmos.com"), // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig1"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.9"), + // to.Ptr("192.168.0.5"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig1"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.9"), + // }, + // }, + // { + // Name: to.Ptr("pestaticconfig2"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.10"), + // }, + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // RequestMessage: to.Ptr("Please approve my connection for pe1."), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // }, + // }, + // }, + // { + // Name: to.Ptr("pe2"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc3.cosmos1.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.5"), + // }, + // }, + // { + // Fqdn: to.Ptr("abc4.cosmos1.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.6"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig3"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.11"), + // }, + // }, + // { + // Name: to.Ptr("pestaticconfig4"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.12"), // }, - // { - // Name: to.Ptr("pestaticconfig2"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.10"), + // }, + // }, + // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // RequestMessage: to.Ptr("Please approve my connection for pe1."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Awaiting approval"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Pending"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2"), + // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), // }, // }, // }, - // { - // Name: to.Ptr("pe2"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), + // }, + // }, + // }, + // { + // Name: to.Ptr("pe3"), + // Type: to.Ptr("Microsoft.Network/privateEndpoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/pe3"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateEndpointProperties{ + // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ + // }, + // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ + // { + // Fqdn: to.Ptr("abc5.cosmos2.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.7"), + // }, + // }, + // { + // Fqdn: to.Ptr("abc6.cosmos2.com"), + // IPAddresses: []*string{ + // to.Ptr("192.168.0.8"), + // }, + // }, + // }, + // CustomNetworkInterfaceName: to.Ptr("testPeNic"), + // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ + // { + // Name: to.Ptr("pestaticconfig5"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file"), + // PrivateIPAddress: to.Ptr("192.168.0.13"), + // }, + // }, + // { + // Name: to.Ptr("pestaticconfig6"), + // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ + // GroupID: to.Ptr("file"), + // MemberName: to.Ptr("file2"), + // PrivateIPAddress: to.Ptr("192.168.0.14"), // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc3.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }, - // { - // Fqdn: to.Ptr("abc4.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.6")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig3"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.11"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig4"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.12"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2"), - // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), - // }, - // }, + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/provders/Microsoft.Network/networkInterfaces/pe3.nic.efgh5463"), + // }, + // }, + // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection3"), + // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("groupIdFromResource"), // }, - // { - // Name: to.Ptr("pe3"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/pe3"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc5.cosmos2.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.7")}, - // }, - // { - // Fqdn: to.Ptr("abc6.cosmos2.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.8")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig5"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.13"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig6"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.14"), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/provders/Microsoft.Network/networkInterfaces/pe3.nic.efgh5463"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection3"), - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateLinkServices/testPls3"), - // RequestMessage: to.Ptr("Please approve my connection for pe3."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet3"), - // }, - // }, - // }}, - // } + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr("Approved"), + // }, + // PrivateLinkServiceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/privateLinkServices/testPls3"), + // RequestMessage: to.Ptr("Please approve my connection for pe3."), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet3"), + // }, + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go index 4d8ff89f7e12..ab9190c3c3e5 100644 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PrivateLinkServicesClient contains the methods for the PrivateLinkServices group. // Don't use this type directly, use NewPrivateLinkServicesClient() instead. +// +// Generated from API version 2025-07-01 type PrivateLinkServicesClient struct { internal *arm.Client subscriptionID string } // NewPrivateLinkServicesClient creates a new instance of PrivateLinkServicesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateLinkServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkServicesClient, error) { @@ -43,10 +43,8 @@ func NewPrivateLinkServicesClient(subscriptionID string, credential azcore.Token // BeginCheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The location of the domain name. -// - parameters - The request body of CheckPrivateLinkService API call. +// - location - The location name. +// - parameters - The request body // - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the // PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility method. func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*runtime.Poller[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse], error) { @@ -56,8 +54,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility( return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -69,8 +66,6 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility( // CheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility" @@ -95,22 +90,23 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx c // checkPrivateLinkServiceVisibilityCreateRequest creates the CheckPrivateLinkServiceVisibility request. func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreateRequest(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, _ *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -120,8 +116,6 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate // BeginCheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service // in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - parameters - The request body of CheckPrivateLinkService API call. @@ -134,8 +128,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityB return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -148,8 +141,6 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityB // CheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service in // the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup" @@ -174,6 +165,10 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso // checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest creates the CheckPrivateLinkServiceVisibilityByResourceGroup request. func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, _ *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -182,18 +177,15 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -202,9 +194,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso // BeginCreateOrUpdate - Creates or updates an private link service in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. // - parameters - Parameters supplied to the create or update private link service operation. // - options - PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate @@ -216,8 +206,7 @@ func (client *PrivateLinkServicesClient) BeginCreateOrUpdate(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -229,8 +218,6 @@ func (client *PrivateLinkServicesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates an private link service in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateLinkServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCreateOrUpdate" @@ -255,6 +242,10 @@ func (client *PrivateLinkServicesClient) createOrUpdate(ctx context.Context, res // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, _ *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -263,18 +254,15 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter serviceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -283,9 +271,7 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified private link service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete // method. @@ -296,8 +282,7 @@ func (client *PrivateLinkServicesClient) BeginDelete(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -309,8 +294,6 @@ func (client *PrivateLinkServicesClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified private link service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDelete" @@ -335,6 +318,10 @@ func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, re // deleteCreateRequest creates the Delete request. func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, _ *PrivateLinkServicesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -343,28 +330,22 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context return nil, errors.New("parameter serviceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginDeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. -// - peConnectionName - The name of the private end point connection. +// - peConnectionName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the // PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection method. func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*runtime.Poller[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse], error) { @@ -374,8 +355,7 @@ func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -387,8 +367,6 @@ func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ct // DeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection" @@ -413,6 +391,10 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx con // deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, _ *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -425,26 +407,19 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe return nil, errors.New("parameter peConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified private link service by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. func (client *PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (PrivateLinkServicesClientGetResponse, error) { @@ -472,6 +447,10 @@ func (client *PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupN // getCreateRequest creates the Get request. func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -480,10 +459,6 @@ func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter serviceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -492,8 +467,8 @@ func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, r if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -510,11 +485,10 @@ func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) // GetPrivateEndpointConnection - Get the specific private end point connection by specific private link service in the resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. -// - peConnectionName - The name of the private end point connection. +// - peConnectionName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - PrivateLinkServicesClientGetPrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.GetPrivateEndpointConnection // method. func (client *PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (PrivateLinkServicesClientGetPrivateEndpointConnectionResponse, error) { @@ -542,6 +516,10 @@ func (client *PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx contex // getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -554,10 +532,6 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateReque return nil, errors.New("parameter peConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -566,8 +540,8 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -582,9 +556,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleRespo } // NewListPager - Gets all private link services in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager // method. func (client *PrivateLinkServicesClient) NewListPager(resourceGroupName string, options *PrivateLinkServicesClientListOptions) *runtime.Pager[PrivateLinkServicesClientListResponse] { @@ -613,21 +585,21 @@ func (client *PrivateLinkServicesClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *PrivateLinkServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -643,9 +615,7 @@ func (client *PrivateLinkServicesClient) listHandleResponse(resp *http.Response) // NewListAutoApprovedPrivateLinkServicesPager - Returns all of the private link service ids that can be linked to a Private // Endpoint with auto approved in this subscription in this region. -// -// Generated from API version 2025-05-01 -// - location - The location of the domain name. +// - location - The location name. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the // PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager method. func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesPager(location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) *runtime.Pager[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse] { @@ -674,21 +644,21 @@ func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesP // listAutoApprovedPrivateLinkServicesCreateRequest creates the ListAutoApprovedPrivateLinkServices request. func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCreateRequest(ctx context.Context, location string, _ *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -704,8 +674,6 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesHand // NewListAutoApprovedPrivateLinkServicesByResourceGroupPager - Returns all of the private link service ids that can be linked // to a Private Endpoint with auto approved in this subscription in this region. -// -// Generated from API version 2025-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters @@ -736,6 +704,10 @@ func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesB // listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest creates the ListAutoApprovedPrivateLinkServicesByResourceGroup request. func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, _ *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -744,17 +716,13 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -769,8 +737,6 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe } // NewListBySubscriptionPager - Gets all private link service in a subscription. -// -// Generated from API version 2025-05-01 // - options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager // method. func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { @@ -808,8 +774,8 @@ func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -824,9 +790,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp * } // NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager // method. @@ -856,6 +820,10 @@ func (client *PrivateLinkServicesClient) NewListPrivateEndpointConnectionsPager( // listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, _ *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -864,17 +832,13 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateReq return nil, errors.New("parameter serviceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -890,11 +854,10 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsHandleRes // UpdatePrivateEndpointConnection - Approve or reject private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the private link service. -// - peConnectionName - The name of the private end point connection. +// - peConnectionName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - parameters - Parameters supplied to approve or reject the private end point connection. // - options - PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.UpdatePrivateEndpointConnection // method. @@ -923,6 +886,10 @@ func (client *PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx con // updatePrivateEndpointConnectionCreateRequest creates the UpdatePrivateEndpointConnection request. func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection, _ *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -935,18 +902,15 @@ func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRe return nil, errors.New("parameter peConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go index fb6cd150a8bf..691543d0978c 100644 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go @@ -1,129 +1,87 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceDelete.json -func ExamplePrivateLinkServicesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/CheckPrivateLinkServiceVisibility.json +func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibility() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDelete(ctx, "rg1", "testPls", nil) + poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibility(ctx, "westus", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ + PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse{ + // PrivateLinkServiceVisibility: armnetwork.PrivateLinkServiceVisibility{ + // Visible: to.Ptr(true), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceGet.json -func ExamplePrivateLinkServicesClient_Get() { +// Generated from example definition: 2025-07-01/CheckPrivateLinkServiceVisibilityByResourceGroup.json +func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibilityByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateLinkServicesClient().Get(ctx, "rg1", "testPls", &armnetwork.PrivateLinkServicesClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibilityByResourceGroup(ctx, "westus", "rg1", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ + PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + }, 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 poll 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.PrivateLinkService = armnetwork.PrivateLinkService{ - // Name: to.Ptr("testPls"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/privateEndpointConnection"), - // Name: to.Ptr("privateEndpointConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // } + // res = armnetwork.PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse{ + // PrivateLinkServiceVisibility: armnetwork.PrivateLinkServiceVisibility{ + // Visible: to.Ptr(true), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceCreate.json +// Generated from example definition: 2025-07-01/PrivateLinkServiceCreate.json func ExamplePrivateLinkServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -133,12 +91,14 @@ func ExamplePrivateLinkServicesClient_BeginCreateOrUpdate() { AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ Subscriptions: []*string{ to.Ptr("subscription1"), - to.Ptr("subscription2")}, + to.Ptr("subscription2"), + }, }, Fqdns: []*string{ to.Ptr("fqdn1"), to.Ptr("fqdn2"), - to.Ptr("fqdn3")}, + to.Ptr("fqdn3"), + }, IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ { Name: to.Ptr("fe-lb"), @@ -147,19 +107,22 @@ func ExamplePrivateLinkServicesClient_BeginCreateOrUpdate() { PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), }, }, - }}, + }, + }, LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + }, + }, Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ Subscriptions: []*string{ to.Ptr("subscription1"), to.Ptr("subscription2"), - to.Ptr("subscription3")}, + to.Ptr("subscription3"), + }, }, }, }, nil) @@ -168,458 +131,254 @@ func ExamplePrivateLinkServicesClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PrivateLinkService = armnetwork.PrivateLinkService{ - // Name: to.Ptr("testPls"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, + // res = armnetwork.PrivateLinkServicesClientCreateOrUpdateResponse{ + // PrivateLinkService: armnetwork.PrivateLinkService{ + // Name: to.Ptr("testPls"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, // }, // Fqdns: []*string{ // to.Ptr("fqdn1"), // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, + // to.Ptr("fqdn3"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, // }, // }, - // } + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // to.Ptr("subscription3"), + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceList.json -func ExamplePrivateLinkServicesClient_NewListPager() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceDelete.json +func ExamplePrivateLinkServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateLinkServicesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkServiceListResult = armnetwork.PrivateLinkServiceListResult{ - // Value: []*armnetwork.PrivateLinkService{ - // { - // Name: to.Ptr("testPls1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), - // Name: to.Ptr("pec1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testPls2"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), - // Name: to.Ptr("pec2"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceListAll.json -func ExamplePrivateLinkServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDelete(ctx, "rg1", "testPls", nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().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.PrivateLinkServiceListResult = armnetwork.PrivateLinkServiceListResult{ - // Value: []*armnetwork.PrivateLinkService{ - // { - // Name: to.Ptr("testPls1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), - // Name: to.Ptr("pec1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testPls2"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), - // Name: to.Ptr("pec2"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.PrivateLinkServicesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceGetPrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_GetPrivateEndpointConnection() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceDeletePrivateEndpointConnection.json +func ExamplePrivateLinkServicesClient_BeginDeletePrivateEndpointConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateLinkServicesClient().GetPrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", &armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions{Expand: nil}) + poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDeletePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", 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 poll 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.PrivateEndpointConnection = armnetwork.PrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, + // res = armnetwork.PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceUpdatePrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_UpdatePrivateEndpointConnection() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceGet.json +func ExamplePrivateLinkServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateLinkServicesClient().UpdatePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", armnetwork.PrivateEndpointConnection{ - Name: to.Ptr("testPlePeConnection"), - Properties: &armnetwork.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armnetwork.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - }, - PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - Description: to.Ptr("approved it for some reason."), - Status: to.Ptr("Approved"), - }, - }, - }, nil) + res, err := clientFactory.NewPrivateLinkServicesClient().Get(ctx, "rg1", "testPls", 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.PrivateEndpointConnection = armnetwork.PrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), + // res = armnetwork.PrivateLinkServicesClientGetResponse{ + // PrivateLinkService: armnetwork.PrivateLinkService{ + // Name: to.Ptr("testPls"), + // Type: to.Ptr("Microsoft.Network/privateLinkServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, + // }, + // Fqdns: []*string{ + // to.Ptr("fqdn1"), + // to.Ptr("fqdn2"), + // to.Ptr("fqdn3"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), + // }, + // }, + // }, + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), + // }, + // }, + // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("privateEndpointConnection"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/privateEndpointConnection"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // to.Ptr("subscription3"), + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceDeletePrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_BeginDeletePrivateEndpointConnection() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceGetPrivateEndpointConnection.json +func ExamplePrivateLinkServicesClient_GetPrivateEndpointConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDeletePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", nil) + res, err := clientFactory.NewPrivateLinkServicesClient().GetPrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", 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) - } + // 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 = armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{ + // PrivateEndpointConnection: armnetwork.PrivateEndpointConnection{ + // Name: to.Ptr("testPlePeConnection"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PrivateLinkServiceListPrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_NewListPrivateEndpointConnectionsPager() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceList.json +func ExamplePrivateLinkServicesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateLinkServicesClient().NewListPrivateEndpointConnectionsPager("rg1", "testPls", nil) + pager := clientFactory.NewPrivateLinkServicesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -630,108 +389,237 @@ func ExamplePrivateLinkServicesClient_NewListPrivateEndpointConnectionsPager() { _ = 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.PrivateEndpointConnectionListResult = armnetwork.PrivateEndpointConnectionListResult{ - // Value: []*armnetwork.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection1"), - // Name: to.Ptr("testPlePeConnection1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), + // page = armnetwork.PrivateLinkServicesClientListResponse{ + // PrivateLinkServiceListResult: armnetwork.PrivateLinkServiceListResult{ + // Value: []*armnetwork.PrivateLinkService{ + // { + // Name: to.Ptr("testPls1"), + // Type: to.Ptr("Microsoft.Network/privateLinkServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // }, + // }, + // Fqdns: []*string{ + // to.Ptr("fqdn1"), + // to.Ptr("fqdn2"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), + // }, + // }, + // }, + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), + // }, + // }, + // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("pec1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // }, + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection2"), - // Name: to.Ptr("testPlePeConnection2"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("rejected by some reason."), - // Status: to.Ptr("Rejected"), + // { + // Name: to.Ptr("testPls2"), + // Type: to.Ptr("Microsoft.Network/privateLinkServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, + // }, + // Fqdns: []*string{ + // to.Ptr("fqdn1"), + // to.Ptr("fqdn2"), + // to.Ptr("fqdn3"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), + // }, + // }, + // }, + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), + // }, + // }, + // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("pec2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // to.Ptr("subscription3"), + // }, + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CheckPrivateLinkServiceVisibility.json -func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibility() { +// Generated from example definition: 2025-07-01/AutoApprovedPrivateLinkServicesGet.json +func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibility(ctx, "westus", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ - PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), - }, 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) + pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesPager("regionName", 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 = armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{ + // AutoApprovedPrivateLinkServicesResult: armnetwork.AutoApprovedPrivateLinkServicesResult{ + // Value: []*armnetwork.AutoApprovedPrivateLinkService{ + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // }, + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // }, + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), + // }, + // }, + // }, + // } } - // 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.PrivateLinkServiceVisibility = armnetwork.PrivateLinkServiceVisibility{ - // Visible: to.Ptr(true), - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CheckPrivateLinkServiceVisibilityByResourceGroup.json -func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibilityByResourceGroup() { +// Generated from example definition: 2025-07-01/AutoApprovedPrivateLinkServicesResourceGroupGet.json +func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibilityByResourceGroup(ctx, "westus", "rg1", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ - PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), - }, 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) + pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesByResourceGroupPager("regionName", "rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{ + // AutoApprovedPrivateLinkServicesResult: armnetwork.AutoApprovedPrivateLinkServicesResult{ + // Value: []*armnetwork.AutoApprovedPrivateLinkService{ + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // }, + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // }, + // { + // PrivateLinkService: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), + // }, + // }, + // }, + // } } - // 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.PrivateLinkServiceVisibility = armnetwork.PrivateLinkServiceVisibility{ - // Visible: to.Ptr(true), - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AutoApprovedPrivateLinkServicesGet.json -func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesPager() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceListAll.json +func ExamplePrivateLinkServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesPager("regionName", nil) + pager := clientFactory.NewPrivateLinkServicesClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -742,33 +630,159 @@ func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesPage _ = 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.AutoApprovedPrivateLinkServicesResult = armnetwork.AutoApprovedPrivateLinkServicesResult{ - // Value: []*armnetwork.AutoApprovedPrivateLinkService{ - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // page = armnetwork.PrivateLinkServicesClientListBySubscriptionResponse{ + // PrivateLinkServiceListResult: armnetwork.PrivateLinkServiceListResult{ + // Value: []*armnetwork.PrivateLinkService{ + // { + // Name: to.Ptr("testPls1"), + // Type: to.Ptr("Microsoft.Network/privateLinkServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, + // }, + // Fqdns: []*string{ + // to.Ptr("fqdn1"), + // to.Ptr("fqdn2"), + // to.Ptr("fqdn3"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), + // }, + // }, + // }, + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), + // }, + // }, + // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("pec1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // to.Ptr("subscription3"), + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("testPls2"), + // Type: to.Ptr("Microsoft.Network/privateLinkServices"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PrivateLinkServiceProperties{ + // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), + // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, + // }, + // Fqdns: []*string{ + // to.Ptr("fqdn1"), + // to.Ptr("fqdn2"), + // }, + // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), + // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ + // PrivateIPAddress: to.Ptr("10.0.1.5"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), + // }, + // }, + // }, + // }, + // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), + // }, + // }, + // NetworkInterfaces: []*armnetwork.Interface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), + // }, + // }, + // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("pec2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testPe2"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ + // Subscriptions: []*string{ + // to.Ptr("subscription1"), + // to.Ptr("subscription2"), + // }, + // }, + // }, + // }, // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), - // }}, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AutoApprovedPrivateLinkServicesResourceGroupGet.json -func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesByResourceGroupPager() { +// Generated from example definition: 2025-07-01/PrivateLinkServiceListPrivateEndpointConnection.json +func ExamplePrivateLinkServicesClient_NewListPrivateEndpointConnectionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesByResourceGroupPager("regionName", "rg1", nil) + pager := clientFactory.NewPrivateLinkServicesClient().NewListPrivateEndpointConnectionsPager("rg1", "testPls", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -779,17 +793,83 @@ func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesByRe _ = 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.AutoApprovedPrivateLinkServicesResult = armnetwork.AutoApprovedPrivateLinkServicesResult{ - // Value: []*armnetwork.AutoApprovedPrivateLinkService{ - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), + // page = armnetwork.PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{ + // PrivateEndpointConnectionListResult: armnetwork.PrivateEndpointConnectionListResult{ + // Value: []*armnetwork.PrivateEndpointConnection{ + // { + // Name: to.Ptr("testPlePeConnection1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection1"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // { + // Name: to.Ptr("testPlePeConnection2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection2"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("rejected by some reason."), + // Status: to.Ptr("Rejected"), + // }, + // }, + // }, // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), - // }}, + // }, // } } } + +// Generated from example definition: 2025-07-01/PrivateLinkServiceUpdatePrivateEndpointConnection.json +func ExamplePrivateLinkServicesClient_UpdatePrivateEndpointConnection() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateLinkServicesClient().UpdatePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", armnetwork.PrivateEndpointConnection{ + Name: to.Ptr("testPlePeConnection"), + Properties: &armnetwork.PrivateEndpointConnectionProperties{ + PrivateEndpoint: &armnetwork.PrivateEndpoint{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + }, + PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + Description: to.Ptr("approved it for some reason."), + Status: to.Ptr("Approved"), + }, + }, + }, 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 = armnetwork.PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{ + // PrivateEndpointConnection: armnetwork.PrivateEndpointConnection{ + // Name: to.Ptr("testPlePeConnection"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), + // Properties: &armnetwork.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armnetwork.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), + // }, + // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("approved it for some reason."), + // Status: to.Ptr("Approved"), + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client.go b/sdk/resourcemanager/network/armnetwork/profiles_client.go index 377b46ad9400..c27e29e2da02 100644 --- a/sdk/resourcemanager/network/armnetwork/profiles_client.go +++ b/sdk/resourcemanager/network/armnetwork/profiles_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// ProfilesClient contains the methods for the NetworkProfiles group. +// ProfilesClient contains the methods for the Profiles group. // Don't use this type directly, use NewProfilesClient() instead. +// +// Generated from API version 2025-07-01 type ProfilesClient struct { internal *arm.Client subscriptionID string } // NewProfilesClient creates a new instance of ProfilesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error) { @@ -43,10 +43,8 @@ func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a network profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkProfileName - The name of the network profile. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkProfileName - The name of the public IP prefix. // - parameters - Parameters supplied to the create or update network profile operation. // - options - ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method. func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (ProfilesClientCreateOrUpdateResponse, error) { @@ -74,6 +72,10 @@ func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, _ *ProfilesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,18 +84,15 @@ func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter networkProfileName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -111,10 +110,8 @@ func (client *ProfilesClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes the specified network profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkProfileName - The name of the NetworkProfile. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkProfileName - The name of the public IP prefix. // - options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*runtime.Poller[ProfilesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -123,8 +120,7 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -136,8 +132,6 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified network profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -162,6 +156,10 @@ func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, _ *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,26 +168,19 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter networkProfileName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified network profile in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkProfileName - The name of the public IP prefix. // - options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error) { @@ -217,6 +208,10 @@ func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -225,10 +220,6 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter networkProfileName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -237,8 +228,8 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -253,9 +244,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl } // NewListPager - Gets all network profiles in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. func (client *ProfilesClient) NewListPager(resourceGroupName string, options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ @@ -283,21 +272,21 @@ func (client *ProfilesClient) NewListPager(resourceGroupName string, options *Pr // listCreateRequest creates the List request. func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *ProfilesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -312,8 +301,6 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC } // NewListAllPager - Gets all the network profiles in a subscription. -// -// Generated from API version 2025-05-01 // - options - ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.NewListAllPager method. func (client *ProfilesClient) NewListAllPager(options *ProfilesClientListAllOptions) *runtime.Pager[ProfilesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListAllResponse]{ @@ -350,8 +337,8 @@ func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, _ *Profi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -367,10 +354,8 @@ func (client *ProfilesClient) listAllHandleResponse(resp *http.Response) (Profil // UpdateTags - Updates network profile tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkProfileName - The name of the network profile. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkProfileName - The name of the public IP prefix. // - parameters - Parameters supplied to update network profile tags. // - options - ProfilesClientUpdateTagsOptions contains the optional parameters for the ProfilesClient.UpdateTags method. func (client *ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, options *ProfilesClientUpdateTagsOptions) (ProfilesClientUpdateTagsResponse, error) { @@ -398,6 +383,10 @@ func (client *ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName // updateTagsCreateRequest creates the UpdateTags request. func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, _ *ProfilesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -406,18 +395,15 @@ func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, errors.New("parameter networkProfileName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go b/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go index dbe4ec0e488d..066ffd587416 100644 --- a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go @@ -1,28 +1,106 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileDelete.json +// Generated from example definition: 2025-07-01/NetworkProfileCreateConfigOnly.json +func ExampleProfilesClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "rg1", "networkProfile1", armnetwork.Profile{ + Location: to.Ptr("westus"), + Properties: &armnetwork.ProfilePropertiesFormat{ + ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + { + Name: to.Ptr("eth1"), + Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + IPConfigurations: []*armnetwork.IPConfigurationProfile{ + { + Name: to.Ptr("ipconfig1"), + Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + }, + }, + }, + }, + }, + }, + }, + }, + }, 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 = armnetwork.ProfilesClientCreateOrUpdateResponse{ + // Profile: armnetwork.Profile{ + // Name: to.Ptr("networkProfile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfig1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkProfileDelete.json func ExampleProfilesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -30,464 +108,343 @@ func ExampleProfilesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ProfilesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileGetConfigOnly.json +// Generated from example definition: 2025-07-01/NetworkProfileGetConfigOnly.json func ExampleProfilesClient_Get_getNetworkProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", 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.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // res = armnetwork.ProfilesClientGetResponse{ + // Profile: armnetwork.Profile{ + // Name: to.Ptr("networkProfile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // { + // Name: to.Ptr("ipconfigprofile2"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // { + // Name: to.Ptr("eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile3"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileGetWithContainerNic.json +// Generated from example definition: 2025-07-01/NetworkProfileGetWithContainerNic.json func ExampleProfilesClient_Get_getNetworkProfileWithContainerNetworkInterfaces() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", 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.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // ContainerNetworkInterfaces: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), + // res = armnetwork.ProfilesClientGetResponse{ + // Profile: armnetwork.Profile{ + // Name: to.Ptr("networkProfile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // ContainerNetworkInterfaces: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), - // }}, - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // { + // Name: to.Ptr("ipconfigprofile2"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // ContainerNetworkInterfaces: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // ContainerNetworkInterfaces: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), - // }}, - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile3"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), - // Name: to.Ptr("containerGroup1_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), - // Name: to.Ptr("containerGroup1_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // { + // Name: to.Ptr("containerGroup1_eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), - // Name: to.Ptr("containerGroup2_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // { + // Name: to.Ptr("containerGroup1_eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), - // Name: to.Ptr("containerGroup2_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // { + // Name: to.Ptr("containerGroup2_eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), - // Name: to.Ptr("containerGroup3_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // { + // Name: to.Ptr("containerGroup2_eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), - // Name: to.Ptr("containerGroup3_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // { + // Name: to.Ptr("containerGroup3_eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileCreateConfigOnly.json -func ExampleProfilesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "rg1", "networkProfile1", armnetwork.Profile{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ProfilePropertiesFormat{ - ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - { - Name: to.Ptr("eth1"), - Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - IPConfigurations: []*armnetwork.IPConfigurationProfile{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - }, - }, - }}, - }, - }}, - }, - }, 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.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileUpdateTags.json -func ExampleProfilesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().UpdateTags(ctx, "rg1", "test-np", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armnetwork.Profile{ - // Name: to.Ptr("test-np"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-np"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("containerGroup3_eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), + // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), + // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ + // Container: &armnetwork.Container{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), + // }, + // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // }, + // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileListAll.json -func ExampleProfilesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/NetworkProfileList.json +func ExampleProfilesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewProfilesClient().NewListAllPager(nil) + pager := clientFactory.NewProfilesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -498,92 +455,111 @@ func ExampleProfilesClient_NewListAllPager() { _ = 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.ProfileListResult = armnetwork.ProfileListResult{ - // Value: []*armnetwork.Profile{ - // { - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // page = armnetwork.ProfilesClientListResponse{ + // ProfileListResult: armnetwork.ProfileListResult{ + // Value: []*armnetwork.Profile{ + // { + // Name: to.Ptr("networkProfile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("ipconfigprofile2"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // }, - // { - // Name: to.Ptr("networkProfile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // { + // Name: to.Ptr("networkProfile2"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile3"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkProfileList.json -func ExampleProfilesClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkProfileListAll.json +func ExampleProfilesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewProfilesClient().NewListPager("rg1", nil) + pager := clientFactory.NewProfilesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -594,88 +570,151 @@ func ExampleProfilesClient_NewListPager() { _ = 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.ProfileListResult = armnetwork.ProfileListResult{ - // Value: []*armnetwork.Profile{ - // { - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // page = armnetwork.ProfilesClientListAllResponse{ + // ProfileListResult: armnetwork.ProfileListResult{ + // Value: []*armnetwork.Profile{ + // { + // Name: to.Ptr("networkProfile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), // }, - // }, - // { - // Name: to.Ptr("networkProfile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // { + // Name: to.Ptr("networkProfile2"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile3"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/NetworkProfileUpdateTags.json +func ExampleProfilesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewProfilesClient().UpdateTags(ctx, "rg1", "test-np", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ProfilesClientUpdateTagsResponse{ + // Profile: armnetwork.Profile{ + // Name: to.Ptr("test-np"), + // Type: to.Ptr("Microsoft.Network/networkProfiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-np"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.ProfilePropertiesFormat{ + // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("eth0"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), + // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ + // IPConfigurations: []*armnetwork.IPConfigurationProfile{ + // { + // Name: to.Ptr("ipconfigprofile1"), + // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), + // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), + // }, + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go index 4af66ff39b07..05b5dd526b8e 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go index 42d3efd80d97..894928b0b9d3 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PublicIPAddressesClient contains the methods for the PublicIPAddresses group. // Don't use this type directly, use NewPublicIPAddressesClient() instead. +// +// Generated from API versions 2018-10-01, 2025-07-01 type PublicIPAddressesClient struct { internal *arm.Client subscriptionID string } // NewPublicIPAddressesClient creates a new instance of PublicIPAddressesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPublicIPAddressesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPAddressesClient, error) { @@ -43,9 +43,7 @@ func NewPublicIPAddressesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a static or dynamic public IP address. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to the create or update public IP address operation. // - options - PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *PublicIPAddressesClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *PublicIPAddressesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a static or dynamic public IP address. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *PublicIPAddressesClient) createOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, _ *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C // BeginDdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus // method. @@ -137,8 +131,7 @@ func (client *PublicIPAddressesClient) BeginDdosProtectionStatus(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientDdosProtectionStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *PublicIPAddressesClient) BeginDdosProtectionStatus(ctx context.Con // DdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDdosProtectionStatus" @@ -176,6 +167,10 @@ func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, // ddosProtectionStatusCreateRequest creates the DdosProtectionStatus request. func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, _ *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,20 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginDelete - Deletes the specified public IP address. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete // method. @@ -214,8 +203,7 @@ func (client *PublicIPAddressesClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -227,8 +215,6 @@ func (client *PublicIPAddressesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified public IP address. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDelete" @@ -253,6 +239,10 @@ func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, _ *PublicIPAddressesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -261,27 +251,20 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginDisassociateCloudServiceReservedPublicIP - Disassociates the Cloud Service reserved Public IP and associates the specified // Standalone Public IP to the same Cloud Service frontend. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameter that define which Public IP Address should be associated in place of given Public IP Address. // - options - PublicIPAddressesClientBeginDisassociateCloudServiceReservedPublicIPOptions contains the optional parameters @@ -293,8 +276,7 @@ func (client *PublicIPAddressesClient) BeginDisassociateCloudServiceReservedPubl return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientDisassociateCloudServiceReservedPublicIPResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -307,8 +289,6 @@ func (client *PublicIPAddressesClient) BeginDisassociateCloudServiceReservedPubl // DisassociateCloudServiceReservedPublicIP - Disassociates the Cloud Service reserved Public IP and associates the specified // Standalone Public IP to the same Cloud Service frontend. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPAddressesClient) disassociateCloudServiceReservedPublicIP(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters DisassociateCloudServicePublicIPRequest, options *PublicIPAddressesClientBeginDisassociateCloudServiceReservedPublicIPOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDisassociateCloudServiceReservedPublicIP" @@ -350,9 +330,10 @@ func (client *PublicIPAddressesClient) disassociateCloudServiceReservedPublicIPC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -361,9 +342,7 @@ func (client *PublicIPAddressesClient) disassociateCloudServiceReservedPublicIPC // Get - Gets the specified public IP address in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. func (client *PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (PublicIPAddressesClientGetResponse, error) { @@ -391,6 +370,10 @@ func (client *PublicIPAddressesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -399,10 +382,6 @@ func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, res return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -411,8 +390,8 @@ func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -428,9 +407,7 @@ func (client *PublicIPAddressesClient) getHandleResponse(resp *http.Response) (P // GetCloudServicePublicIPAddress - Get the specified public IP address in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The role instance name. // - networkInterfaceName - The name of the network interface. @@ -462,7 +439,11 @@ func (client *PublicIPAddressesClient) GetCloudServicePublicIPAddress(ctx contex // getCloudServicePublicIPAddressCreateRequest creates the GetCloudServicePublicIPAddress request. func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetCloudServicePublicIPAddressOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -487,10 +468,6 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateReque return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -499,8 +476,8 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -516,14 +493,7 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressHandleRespo // GetVirtualMachineScaleSetPublicIPAddress - Get the specified public IP address in a virtual machine scale set. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. -// - networkInterfaceName - The name of the network interface. -// - ipConfigurationName - The name of the IP configuration. -// - publicIPAddressName - The name of the public IP Address. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions contains the optional parameters for the // PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress method. func (client *PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { @@ -551,6 +521,10 @@ func (client *PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress( // getVirtualMachineScaleSetPublicIPAddressCreateRequest creates the GetVirtualMachineScaleSetPublicIPAddress request. func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -575,10 +549,6 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressC return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -587,8 +557,8 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressC if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -603,9 +573,7 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressH } // NewListPager - Gets all public IP addresses in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager // method. func (client *PublicIPAddressesClient) NewListPager(resourceGroupName string, options *PublicIPAddressesClientListOptions) *runtime.Pager[PublicIPAddressesClientListResponse] { @@ -634,21 +602,21 @@ func (client *PublicIPAddressesClient) NewListPager(resourceGroupName string, op // listCreateRequest creates the List request. func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *PublicIPAddressesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -663,8 +631,6 @@ func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) ( } // NewListAllPager - Gets all the public IP addresses in a subscription. -// -// Generated from API version 2025-05-01 // - options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager // method. func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { @@ -702,8 +668,8 @@ func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -718,9 +684,7 @@ func (client *PublicIPAddressesClient) listAllHandleResponse(resp *http.Response } // NewListCloudServicePublicIPAddressesPager - Gets information about all public IP addresses on a cloud service level. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. // - options - PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager // method. @@ -749,7 +713,11 @@ func (client *PublicIPAddressesClient) NewListCloudServicePublicIPAddressesPager // listCloudServicePublicIPAddressesCreateRequest creates the ListCloudServicePublicIPAddresses request. func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, _ *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -758,17 +726,13 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRe return nil, errors.New("parameter cloudServiceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -784,13 +748,11 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesHandleRe // NewListCloudServiceRoleInstancePublicIPAddressesPager - Gets information about all public IP addresses in a role instance // IP configuration in a cloud service. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServiceName - The name of the cloud service. -// - roleInstanceName - The name of role instance. -// - networkInterfaceName - The network interface name. -// - ipConfigurationName - The IP configuration name. +// - roleInstanceName - The role instance name. +// - networkInterfaceName - The name of the network interface. +// - ipConfigurationName - The name of the IP configuration. // - options - PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions contains the optional parameters // for the PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager method. func (client *PublicIPAddressesClient) NewListCloudServiceRoleInstancePublicIPAddressesPager(resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse] { @@ -818,7 +780,11 @@ func (client *PublicIPAddressesClient) NewListCloudServiceRoleInstancePublicIPAd // listCloudServiceRoleInstancePublicIPAddressesCreateRequest creates the ListCloudServiceRoleInstancePublicIPAddresses request. func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, _ *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -839,17 +805,13 @@ func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddre return nil, errors.New("parameter ipConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -865,9 +827,7 @@ func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddre // NewListVirtualMachineScaleSetPublicIPAddressesPager - Gets information about all public IP addresses on a virtual machine // scale set level. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineScaleSetName - The name of the virtual machine scale set. // - options - PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions contains the optional parameters for // the PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager method. @@ -897,6 +857,10 @@ func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetPublicIPAddr // listVirtualMachineScaleSetPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetPublicIPAddresses request. func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, _ *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -905,17 +869,13 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddress return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -931,13 +891,7 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddress // NewListVirtualMachineScaleSetVMPublicIPAddressesPager - Gets information about all public IP addresses in a virtual machine // IP configuration in a virtual machine scale set. -// -// Generated from API version 2018-10-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the virtual machine scale set. -// - virtualmachineIndex - The virtual machine index. -// - networkInterfaceName - The network interface name. -// - ipConfigurationName - The IP configuration name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions contains the optional parameters // for the PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager method. func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetVMPublicIPAddressesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse] { @@ -966,6 +920,10 @@ func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetVMPublicIPAd // listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetVMPublicIPAddresses request. func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, _ *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -986,17 +944,13 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddre return nil, errors.New("parameter ipConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20181001) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1013,9 +967,7 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddre // BeginReserveCloudServicePublicIPAddress - Reserves the specified Cloud Service Public IP by switching its allocation method // to Static. If rollback is requested, reverts the allocation method to Dynamic. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameter that define which Public IP Address should be associated in place of given Public IP Address. // - options - PublicIPAddressesClientBeginReserveCloudServicePublicIPAddressOptions contains the optional parameters for the @@ -1027,8 +979,7 @@ func (client *PublicIPAddressesClient) BeginReserveCloudServicePublicIPAddress(c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientReserveCloudServicePublicIPAddressResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1041,8 +992,6 @@ func (client *PublicIPAddressesClient) BeginReserveCloudServicePublicIPAddress(c // ReserveCloudServicePublicIPAddress - Reserves the specified Cloud Service Public IP by switching its allocation method // to Static. If rollback is requested, reverts the allocation method to Dynamic. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPAddressesClient) reserveCloudServicePublicIPAddress(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters ReserveCloudServicePublicIPAddressRequest, options *PublicIPAddressesClientBeginReserveCloudServicePublicIPAddressOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginReserveCloudServicePublicIPAddress" @@ -1084,9 +1033,10 @@ func (client *PublicIPAddressesClient) reserveCloudServicePublicIPAddressCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1095,9 +1045,7 @@ func (client *PublicIPAddressesClient) reserveCloudServicePublicIPAddressCreateR // UpdateTags - Updates public IP address tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to update public IP address tags. // - options - PublicIPAddressesClientUpdateTagsOptions contains the optional parameters for the PublicIPAddressesClient.UpdateTags @@ -1127,6 +1075,10 @@ func (client *PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceG // updateTagsCreateRequest creates the UpdateTags request. func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject, _ *PublicIPAddressesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1135,18 +1087,15 @@ func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Conte return nil, errors.New("parameter publicIPAddressName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go index 04a692c61d15..90bc633bfc64 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go @@ -1,300 +1,179 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServicePublicIpListAll.json -func ExamplePublicIPAddressesClient_NewListCloudServicePublicIPAddressesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServicePublicIPAddressesPager("cs-tester", "cs1", 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm3.testvmssacc"), - // Fqdn: to.Ptr("vm3.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.118.216"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceRoleInstancePublicIpList.json -func ExamplePublicIPAddressesClient_NewListCloudServiceRoleInstancePublicIPAddressesPager() { +// Generated from example definition: 2025-07-01/PublicIpAddressCreateCustomizedValues.json +func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIPAddressAllocationMethod() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServiceRoleInstancePublicIPAddressesPager("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServicePublicIpGet.json -func ExamplePublicIPAddressesClient_GetCloudServicePublicIPAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + IdleTimeoutInMinutes: to.Ptr[int32](10), + PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + }, + SKU: &armnetwork.PublicIPAddressSKU{ + Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), + Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), + }, + }, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - res, err := clientFactory.NewPublicIPAddressesClient().GetCloudServicePublicIPAddress(ctx, "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), + // res = armnetwork.PublicIPAddressesClientCreateOrUpdateResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // }, + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), + // Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // Zones: []*string{ + // to.Ptr("1"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressDelete.json -func ExamplePublicIPAddressesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/PublicIpAddressCreateDefaults.json +func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIPAddressDefaults() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDelete(ctx, "rg1", "test-ip", nil) + poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ + Location: to.Ptr("eastus"), + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressGet.json -func ExamplePublicIPAddressesClient_Get_getPublicIpAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", &armnetwork.PublicIPAddressesClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // DdosProtectionPlan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // res = armnetwork.PublicIPAddressesClientCreateOrUpdateResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), // }, - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), // }, - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }, - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("Storage"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressGetStandardV2Sku.json -func ExamplePublicIPAddressesClient_Get_getPublicIpAddressWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/PublicIpAddressCreateDefaultsStandardV2Sku.json +func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIPAddressDefaultsWithStandardV2Sku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", &armnetwork.PublicIPAddressesClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ + Location: to.Ptr("eastus"), + }, 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 poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // DdosProtectionPlan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // res = armnetwork.PublicIPAddressesClientCreateOrUpdateResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), // }, - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandardV2), // }, - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }, - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("Storage"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressCreateDns.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDns() { +// Generated from example definition: 2025-07-01/PublicIpAddressCreateDns.json +func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIPAddressDns() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -311,40 +190,42 @@ func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDns } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("dnslbl"), - // Fqdn: to.Ptr("dnslbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // res = armnetwork.PublicIPAddressesClientCreateOrUpdateResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("dnslbl"), + // Fqdn: to.Ptr("dnslbl.westus.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressCreateDnsWithDomainNameLabelScope.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDnsWithDomainNameLabelScope() { +// Generated from example definition: 2025-07-01/PublicIpAddressCreateDnsWithDomainNameLabelScope.json +func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIPAddressDnsWithDomainNameLabelScope() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -362,239 +243,300 @@ func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDns } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("dnslbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("dnslbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // res = armnetwork.PublicIPAddressesClientCreateOrUpdateResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("dnslbl"), + // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), + // Fqdn: to.Ptr("dnslbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressCreateCustomizedValues.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressAllocationMethod() { +// Generated from example definition: 2025-07-01/PublicIpAddressGetDdosProtectionStatus.json +func ExamplePublicIPAddressesClient_BeginDdosProtectionStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - IdleTimeoutInMinutes: to.Ptr[int32](10), - PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - }, - SKU: &armnetwork.PublicIPAddressSKU{ - Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), - Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), - }, - }, nil) + poller, err := clientFactory.NewPublicIPAddressesClient().BeginDdosProtectionStatus(ctx, "rg1", "test-pip", 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) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), - // Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), + // res = armnetwork.PublicIPAddressesClientDdosProtectionStatusResponse{ + // PublicIPDdosProtectionStatusResult: armnetwork.PublicIPDdosProtectionStatusResult{ + // DdosProtectionPlanID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), + // PublicIPAddress: to.Ptr("10.0.1.5"), + // PublicIPAddressID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressCreateDefaults.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDefaults() { +// Generated from example definition: 2025-07-01/PublicIpAddressDelete.json +func ExamplePublicIPAddressesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - }, nil) + poller, err := clientFactory.NewPublicIPAddressesClient().BeginDelete(ctx, "rg1", "test-ip", 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) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), - // }, + // res = armnetwork.PublicIPAddressesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressCreateDefaultsStandardV2Sku.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDefaultsWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/PublicIpAddressDisassociateCloudServiceReservedPublicIp.json +func ExamplePublicIPAddressesClient_BeginDisassociateCloudServiceReservedPublicIP() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), + poller, err := clientFactory.NewPublicIPAddressesClient().BeginDisassociateCloudServiceReservedPublicIP(ctx, "rg1", "pip1", armnetwork.DisassociateCloudServicePublicIPRequest{ + PublicIPArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIpAddresses/pip2"), }, 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) + log.Fatalf("failed to poll 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // res = armnetwork.PublicIPAddressesClientDisassociateCloudServiceReservedPublicIPResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("pip1"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // }, + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressUpdateTags.json -func ExamplePublicIPAddressesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/PublicIpAddressGet.json +func ExamplePublicIPAddressesClient_Get_getPublicIPAddress() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicIPAddressesClient().UpdateTags(ctx, "rg1", "test-ip", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), + // res = armnetwork.PublicIPAddressesClientGetResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // DdosProtectionPlan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // }, + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // IPTags: []*armnetwork.IPTag{ + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("SQL"), + // }, + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("Storage"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // }, // }, - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // } +} + +// Generated from example definition: 2025-07-01/PublicIpAddressGetStandardV2Sku.json +func ExamplePublicIPAddressesClient_Get_getPublicIPAddressWithStandardV2Sku() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", 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 = armnetwork.PublicIPAddressesClientGetResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // DdosProtectionPlan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // }, + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // IPTags: []*armnetwork.IPTag{ + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("SQL"), + // }, + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("Storage"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandardV2), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressListAll.json -func ExamplePublicIPAddressesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/CloudServicePublicIpGet.json +func ExamplePublicIPAddressesClient_GetCloudServicePublicIPAddress() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPAddressesClient().NewListAllPager(nil) + res, err := clientFactory.NewPublicIPAddressesClient().GetCloudServicePublicIPAddress(ctx, "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", 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 = armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("pub1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("vm1.testvmssacc"), + // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPAddress: to.Ptr("13.67.119.72"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/PublicIpAddressList.json +func ExamplePublicIPAddressesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewPublicIPAddressesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -605,89 +547,102 @@ func ExamplePublicIPAddressesClient_NewListAllPager() { _ = 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // page = armnetwork.PublicIPAddressesClientListResponse{ + // PublicIPAddressListResult: armnetwork.PublicIPAddressListResult{ + // Value: []*armnetwork.PublicIPAddress{ + // { + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // IPTags: []*armnetwork.IPTag{ + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("SQL"), + // }, + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("Storage"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }, - // { - // Name: to.Ptr("ip01"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip01"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.247"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // { + // Name: to.Ptr("ip03"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip03"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("testlbl"), + // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPAddress: to.Ptr("40.85.154.247"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }, - // { - // Name: to.Ptr("ip02"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip02"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.248"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // { + // Name: to.Ptr("ip04"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip04"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("testlbl"), + // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), + // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPAddress: to.Ptr("40.85.154.248"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressList.json -func ExamplePublicIPAddressesClient_NewListPager() { +// Generated from example definition: 2025-07-01/PublicIpAddressListAll.json +func ExamplePublicIPAddressesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPAddressesClient().NewListPager("rg1", nil) + pager := clientFactory.NewPublicIPAddressesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -698,216 +653,92 @@ func ExamplePublicIPAddressesClient_NewListPager() { _ = 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), + // page = armnetwork.PublicIPAddressesClientListAllResponse{ + // PublicIPAddressListResult: armnetwork.PublicIPAddressListResult{ + // Value: []*armnetwork.PublicIPAddress{ + // { + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), // }, - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("Storage"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("ip03"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip03"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.247"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }, - // { - // Name: to.Ptr("ip04"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip04"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), + // { + // Name: to.Ptr("ip01"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip01"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("testlbl"), + // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPAddress: to.Ptr("40.85.154.247"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.248"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // }, + // { + // Name: to.Ptr("ip02"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip02"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("testlbl"), + // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), + // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPAddress: to.Ptr("40.85.154.248"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressGetDdosProtectionStatus.json -func ExamplePublicIPAddressesClient_BeginDdosProtectionStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDdosProtectionStatus(ctx, "rg1", "test-pip", 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.PublicIPDdosProtectionStatusResult = armnetwork.PublicIPDdosProtectionStatusResult{ - // DdosProtectionPlanID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), - // PublicIPAddress: to.Ptr("10.0.1.5"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressReserve.json -func ExamplePublicIPAddressesClient_BeginReserveCloudServicePublicIPAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginReserveCloudServicePublicIPAddress(ctx, "rg1", "test-ip", armnetwork.ReserveCloudServicePublicIPAddressRequest{ - IsRollback: to.Ptr(armnetwork.IsRollbackFalse), - }, 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("test-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpAddressDisassociateCloudServiceReservedPublicIp.json -func ExamplePublicIPAddressesClient_BeginDisassociateCloudServiceReservedPublicIP() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDisassociateCloudServiceReservedPublicIP(ctx, "rg1", "pip1", armnetwork.DisassociateCloudServicePublicIPRequest{ - PublicIPArmID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/publicIpAddresses/pip2"), - }, 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.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("pip1"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssPublicIpListAll.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetPublicIPAddressesPager() { +// Generated from example definition: 2025-07-01/CloudServicePublicIpListAll.json +func ExamplePublicIPAddressesClient_NewListCloudServicePublicIPAddressesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPAddressesClient().NewListVirtualMachineScaleSetPublicIPAddressesPager("vmss-tester", "vmss1", nil) + pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServicePublicIPAddressesPager("cs-tester", "cs1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -918,60 +749,63 @@ func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetPublicIPAddress _ = 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // page = armnetwork.PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{ + // PublicIPAddressListResult: armnetwork.PublicIPAddressListResult{ + // Value: []*armnetwork.PublicIPAddress{ + // { + // Name: to.Ptr("pub1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("vm1.testvmssacc"), + // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPAddress: to.Ptr("13.67.119.72"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }, - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm3.testvmssacc"), - // Fqdn: to.Ptr("vm3.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.118.216"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1"), + // { + // Name: to.Ptr("pub1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("vm3.testvmssacc"), + // Fqdn: to.Ptr("vm3.testvmssacc.southeastasia.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPAddress: to.Ptr("13.67.118.216"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssVmPublicIpList.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetVMPublicIPAddressesPager() { +// Generated from example definition: 2025-07-01/CloudServiceRoleInstancePublicIpList.json +func ExamplePublicIPAddressesClient_NewListCloudServiceRoleInstancePublicIPAddressesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPAddressesClient().NewListVirtualMachineScaleSetVMPublicIPAddressesPager("vmss-tester", "vmss1", "1", "nic1", "ip1", nil) + pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServiceRoleInstancePublicIPAddressesPager("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -982,64 +816,124 @@ func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetVMPublicIPAddre _ = 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.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // page = armnetwork.PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{ + // PublicIPAddressListResult: armnetwork.PublicIPAddressListResult{ + // Value: []*armnetwork.PublicIPAddress{ + // { + // Name: to.Ptr("pub1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ + // DomainNameLabel: to.Ptr("vm1.testvmssacc"), + // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPAddress: to.Ptr("13.67.119.72"), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VmssPublicIpGet.json -func ExamplePublicIPAddressesClient_GetVirtualMachineScaleSetPublicIPAddress() { +// Generated from example definition: 2025-07-01/PublicIpAddressReserve.json +func ExamplePublicIPAddressesClient_BeginReserveCloudServicePublicIPAddress() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPublicIPAddressesClient().BeginReserveCloudServicePublicIPAddress(ctx, "rg1", "test-ip", armnetwork.ReserveCloudServicePublicIPAddressRequest{ + IsRollback: to.Ptr(armnetwork.IsRollbackFalse), + }, 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 poll 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 = armnetwork.PublicIPAddressesClientReserveCloudServicePublicIPAddressResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("test-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // IdleTimeoutInMinutes: to.Ptr[int32](4), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // }, + // SKU: &armnetwork.PublicIPAddressSKU{ + // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/PublicIpAddressUpdateTags.json +func ExamplePublicIPAddressesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicIPAddressesClient().GetVirtualMachineScaleSetPublicIPAddress(ctx, "vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions{Expand: nil}) + res, err := clientFactory.NewPublicIPAddressesClient().UpdateTags(ctx, "rg1", "test-ip", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), + // res = armnetwork.PublicIPAddressesClientUpdateTagsResponse{ + // PublicIPAddress: armnetwork.PublicIPAddress{ + // Name: to.Ptr("testDNS-ip"), + // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ + // DdosSettings: &armnetwork.DdosSettings{ + // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), + // }, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // IPConfiguration: &armnetwork.IPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go b/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go index 63fdbbce3fe2..65ca34706d17 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go index 64b1ec3cfd0d..616fa2326251 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // PublicIPPrefixesClient contains the methods for the PublicIPPrefixes group. // Don't use this type directly, use NewPublicIPPrefixesClient() instead. +// +// Generated from API version 2025-07-01 type PublicIPPrefixesClient struct { internal *arm.Client subscriptionID string } // NewPublicIPPrefixesClient creates a new instance of PublicIPPrefixesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewPublicIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPPrefixesClient, error) { @@ -43,9 +43,7 @@ func NewPublicIPPrefixesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a static or dynamic public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to the create or update public IP prefix operation. // - options - PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *PublicIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPPrefixesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *PublicIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a static or dynamic public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *PublicIPPrefixesClient) createOrUpdate(ctx context.Context, resour // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, _ *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter publicIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,10 +120,8 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - publicIPPrefixName - The name of the PublicIpPrefix. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - publicIPPrefixName - The name of the public IP prefix. // - options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete // method. func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[PublicIPPrefixesClientDeleteResponse], error) { @@ -137,8 +131,7 @@ func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPPrefixesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, _ *PublicIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter publicIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified public IP prefix in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPPrefixName - The name of the public IP prefix. // - options - PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. func (client *PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (PublicIPPrefixesClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter publicIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (Pu } // NewListPager - Gets all public IP prefixes in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager // method. func (client *PublicIPPrefixesClient) NewListPager(resourceGroupName string, options *PublicIPPrefixesClientListOptions) *runtime.Pager[PublicIPPrefixesClientListResponse] { @@ -298,21 +284,21 @@ func (client *PublicIPPrefixesClient) NewListPager(resourceGroupName string, opt // listCreateRequest creates the List request. func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *PublicIPPrefixesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -327,8 +313,6 @@ func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (P } // NewListAllPager - Gets all the public IP prefixes in a subscription. -// -// Generated from API version 2025-05-01 // - options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager // method. func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { @@ -366,8 +350,8 @@ func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -383,9 +367,7 @@ func (client *PublicIPPrefixesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates public IP prefix tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to update public IP prefix tags. // - options - PublicIPPrefixesClientUpdateTagsOptions contains the optional parameters for the PublicIPPrefixesClient.UpdateTags @@ -415,6 +397,10 @@ func (client *PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGr // updateTagsCreateRequest creates the UpdateTags request. func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject, _ *PublicIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -423,18 +409,15 @@ func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, errors.New("parameter publicIPPrefixName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go index c47381a25f18..9806e53b7af9 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go @@ -1,147 +1,147 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixDelete.json -func ExamplePublicIPPrefixesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/PublicIpPrefixCreateCustomizedValues.json +func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIPPrefixAllocationMethod() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginDelete(ctx, "rg1", "test-ipprefix", nil) + poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ + Location: to.Ptr("westus"), + Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + PrefixLength: to.Ptr[int32](30), + PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + }, + SKU: &armnetwork.PublicIPPrefixSKU{ + Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixGet.json -func ExamplePublicIPPrefixesClient_Get_getPublicIpPrefix() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-ipprefix", &armnetwork.PublicIPPrefixesClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ + // res = armnetwork.PublicIPPrefixesClientCreateOrUpdateResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("192.168.254.2/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), + // }, + // Zones: []*string{ + // to.Ptr("1"), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixGetStandardV2Sku.json -func ExamplePublicIPPrefixesClient_Get_getPublicIpPrefixWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/PublicIpPrefixCreateDefaults.json +func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIPPrefixDefaults() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-ipprefix", &armnetwork.PublicIPPrefixesClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ + Location: to.Ptr("westus"), + Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + PrefixLength: to.Ptr[int32](30), + }, + SKU: &armnetwork.PublicIPPrefixSKU{ + Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + }, + }, 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 poll 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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ + // res = armnetwork.PublicIPPrefixesClientCreateOrUpdateResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("192.168.254.2/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixCreateCustomizedValues.json -func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixAllocationMethod() { +// Generated from example definition: 2025-07-01/PublicIpPrefixCreateDefaultsStandardV2Sku.json +func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIPPrefixDefaultsWithStandardV2Sku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ Location: to.Ptr("westus"), Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - PrefixLength: to.Ptr[int32](30), - PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + PrefixLength: to.Ptr[int32](30), }, SKU: &armnetwork.PublicIPPrefixSKU{ - Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), + Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), }, }, nil) if err != nil { @@ -149,197 +149,164 @@ func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixAlloc } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ + // res = armnetwork.PublicIPPrefixesClientCreateOrUpdateResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("192.168.254.2/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixCreateDefaults.json -func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixDefaults() { +// Generated from example definition: 2025-07-01/PublicIpPrefixDelete.json +func ExamplePublicIPPrefixesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - PrefixLength: to.Ptr[int32](30), - }, - SKU: &armnetwork.PublicIPPrefixSKU{ - Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - }, - }, nil) + poller, err := clientFactory.NewPublicIPPrefixesClient().BeginDelete(ctx, "rg1", "test-ipprefix", 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) + log.Fatalf("failed to poll 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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, + // res = armnetwork.PublicIPPrefixesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixCreateDefaultsStandardV2Sku.json -func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixDefaultsWithStandardV2Sku() { +// Generated from example definition: 2025-07-01/PublicIpPrefixGet.json +func ExamplePublicIPPrefixesClient_Get_getPublicIPPrefix() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - PrefixLength: to.Ptr[int32](30), - }, - SKU: &armnetwork.PublicIPPrefixSKU{ - Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), - }, - }, nil) + res, err := clientFactory.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-ipprefix", 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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ + // res = armnetwork.PublicIPPrefixesClientGetResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("192.168.254.2/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixUpdateTags.json -func ExamplePublicIPPrefixesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/PublicIpPrefixGetStandardV2Sku.json +func ExamplePublicIPPrefixesClient_Get_getPublicIPPrefixWithStandardV2Sku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicIPPrefixesClient().UpdateTags(ctx, "rg1", "test-ipprefix", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-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.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ + // res = armnetwork.PublicIPPrefixesClientGetResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("192.168.254.2/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandardV2), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixListAll.json -func ExamplePublicIPPrefixesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/PublicIpPrefixList.json +func ExamplePublicIPPrefixesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPPrefixesClient().NewListAllPager(nil) + pager := clientFactory.NewPublicIPPrefixesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -350,88 +317,69 @@ func ExamplePublicIPPrefixesClient_NewListAllPager() { _ = 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.PublicIPPrefixListResult = armnetwork.PublicIPPrefixListResult{ - // Value: []*armnetwork.PublicIPPrefix{ - // { - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("41.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ + // page = armnetwork.PublicIPPrefixesClientListResponse{ + // PublicIPPrefixListResult: armnetwork.PublicIPPrefixListResult{ + // Value: []*armnetwork.PublicIPPrefix{ + // { + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("40.85.154.2/30"), + // IPTags: []*armnetwork.IPTag{ + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("SQL"), + // }, + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("ipprefix01"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/ipprefix01"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // }, - // { - // Name: to.Ptr("pfx"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/publicIPPrefixes/pfx"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("25.101.84.16/30"), - // IPTags: []*armnetwork.IPTag{ + // { + // Name: to.Ptr("ipprefix03"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/ipprefix03"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("40.85.153.2/31"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](31), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/loadBalancers/lb-pfx/frontendIPConfigurations/ipconfig1"), + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PublicIpPrefixList.json -func ExamplePublicIPPrefixesClient_NewListPager() { +// Generated from example definition: 2025-07-01/PublicIpPrefixListAll.json +func ExamplePublicIPPrefixesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPublicIPPrefixesClient().NewListPager("rg1", nil) + pager := clientFactory.NewPublicIPPrefixesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -442,49 +390,126 @@ func ExamplePublicIPPrefixesClient_NewListPager() { _ = 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.PublicIPPrefixListResult = armnetwork.PublicIPPrefixListResult{ - // Value: []*armnetwork.PublicIPPrefix{ - // { - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.2/30"), - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }}, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // page = armnetwork.PublicIPPrefixesClientListAllResponse{ + // PublicIPPrefixListResult: armnetwork.PublicIPPrefixListResult{ + // Value: []*armnetwork.PublicIPPrefix{ + // { + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("41.85.154.247/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), + // }, + // }, + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // }, // }, - // }, - // { - // Name: to.Ptr("ipprefix03"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/ipprefix03"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.153.2/31"), - // IPTags: []*armnetwork.IPTag{ + // { + // Name: to.Ptr("ipprefix01"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/ipprefix01"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("40.85.154.247/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), // }, - // PrefixLength: to.Ptr[int32](31), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // { + // Name: to.Ptr("pfx"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/publicIPPrefixes/pfx"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("25.101.84.16/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg3/providers/Microsoft.Network/loadBalancers/lb-pfx/frontendIPConfigurations/ipconfig1"), + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/PublicIpPrefixUpdateTags.json +func ExamplePublicIPPrefixesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPublicIPPrefixesClient().UpdateTags(ctx, "rg1", "test-ipprefix", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.PublicIPPrefixesClientUpdateTagsResponse{ + // PublicIPPrefix: armnetwork.PublicIPPrefix{ + // Name: to.Ptr("test-ipprefix"), + // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ + // IPPrefix: to.Ptr("40.85.154.247/30"), + // IPTags: []*armnetwork.IPTag{ + // }, + // PrefixLength: to.Ptr[int32](30), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // }, + // SKU: &armnetwork.PublicIPPrefixSKU{ + // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go index 5a51f97a44a3..bec98ab406b7 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ReachabilityAnalysisIntentsClient contains the methods for the ReachabilityAnalysisIntents group. // Don't use this type directly, use NewReachabilityAnalysisIntentsClient() instead. +// +// Generated from API version 2025-07-01 type ReachabilityAnalysisIntentsClient struct { internal *arm.Client subscriptionID string } // NewReachabilityAnalysisIntentsClient creates a new instance of ReachabilityAnalysisIntentsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewReachabilityAnalysisIntentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReachabilityAnalysisIntentsClient, error) { @@ -43,12 +43,12 @@ func NewReachabilityAnalysisIntentsClient(subscriptionID string, credential azco } // Create - Creates Reachability Analysis Intent. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Creates Reachability Analysis Intent. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisIntentName - Reachability Analysis Intent name. // - body - Reachability Analysis Intent object to create/update. // - options - ReachabilityAnalysisIntentsClientCreateOptions contains the optional parameters for the ReachabilityAnalysisIntentsClient.Create @@ -103,9 +103,10 @@ func (client *ReachabilityAnalysisIntentsClient) createCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { return nil, err } @@ -122,12 +123,12 @@ func (client *ReachabilityAnalysisIntentsClient) createHandleResponse(resp *http } // Delete - Deletes Reachability Analysis Intent. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Deletes Reachability Analysis Intent. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisIntentName - Reachability Analysis Intent name. // - options - ReachabilityAnalysisIntentsClientDeleteOptions contains the optional parameters for the ReachabilityAnalysisIntentsClient.Delete // method. @@ -180,19 +181,18 @@ func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get the Reachability Analysis Intent. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Get the Reachability Analysis Intent. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisIntentName - Reachability Analysis Intent name. // - options - ReachabilityAnalysisIntentsClientGetOptions contains the optional parameters for the ReachabilityAnalysisIntentsClient.Get // method. @@ -246,8 +246,8 @@ func (client *ReachabilityAnalysisIntentsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -263,10 +263,10 @@ func (client *ReachabilityAnalysisIntentsClient) getHandleResponse(resp *http.Re // NewListPager - Gets list of Reachability Analysis Intents . // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets list of Reachability Analysis Intents . +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - options - ReachabilityAnalysisIntentsClientListOptions contains the optional parameters for the ReachabilityAnalysisIntentsClient.NewListPager // method. func (client *ReachabilityAnalysisIntentsClient) NewListPager(resourceGroupName string, networkManagerName string, workspaceName string, options *ReachabilityAnalysisIntentsClientListOptions) *runtime.Pager[ReachabilityAnalysisIntentsClientListResponse] { @@ -316,7 +316,7 @@ func (client *ReachabilityAnalysisIntentsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -332,7 +332,7 @@ func (client *ReachabilityAnalysisIntentsClient) listCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go index 0923337ecb49..b8f4b1a25d73 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go @@ -1,217 +1,242 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisIntentList.json -func ExampleReachabilityAnalysisIntentsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisIntentPut.json +func ExampleReachabilityAnalysisIntentsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewReachabilityAnalysisIntentsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", &armnetwork.ReachabilityAnalysisIntentsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.ReachabilityAnalysisIntentListResult = armnetwork.ReachabilityAnalysisIntentListResult{ - // Value: []*armnetwork.ReachabilityAnalysisIntent{ - // { - // Name: to.Ptr("testReachabilityAnalysisIntenant1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // }}, - // } + res, err := clientFactory.NewReachabilityAnalysisIntentsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", armnetwork.ReachabilityAnalysisIntent{ + Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ + Description: to.Ptr("A sample reachability analysis intent"), + DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + IPTraffic: &armnetwork.IPTraffic{ + DestinationIPs: []*string{ + to.Ptr("10.4.0.1"), + }, + DestinationPorts: []*string{ + to.Ptr("0"), + }, + Protocols: []*armnetwork.NetworkProtocol{ + to.Ptr(armnetwork.NetworkProtocolAny), + }, + SourceIPs: []*string{ + to.Ptr("10.4.0.0"), + }, + SourcePorts: []*string{ + to.Ptr("0"), + }, + }, + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + }, + }, 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 = armnetwork.ReachabilityAnalysisIntentsClientCreateResponse{ + // ReachabilityAnalysisIntent: armnetwork.ReachabilityAnalysisIntent{ + // Name: to.Ptr("testAnalysisIntentName"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), + // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisIntentGet.json -func ExampleReachabilityAnalysisIntentsClient_Get() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisIntentDelete.json +func ExampleReachabilityAnalysisIntentsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewReachabilityAnalysisIntentsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", nil) + res, err := clientFactory.NewReachabilityAnalysisIntentsClient().Delete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntent", 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.ReachabilityAnalysisIntent = armnetwork.ReachabilityAnalysisIntent{ - // Name: to.Ptr("testAnalysisIntentName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // } + // res = armnetwork.ReachabilityAnalysisIntentsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisIntentPut.json -func ExampleReachabilityAnalysisIntentsClient_Create() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisIntentGet.json +func ExampleReachabilityAnalysisIntentsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewReachabilityAnalysisIntentsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", armnetwork.ReachabilityAnalysisIntent{ - Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - Description: to.Ptr("A sample reachability analysis intent"), - DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - IPTraffic: &armnetwork.IPTraffic{ - DestinationIPs: []*string{ - to.Ptr("10.4.0.1")}, - DestinationPorts: []*string{ - to.Ptr("0")}, - Protocols: []*armnetwork.NetworkProtocol{ - to.Ptr(armnetwork.NetworkProtocolAny)}, - SourceIPs: []*string{ - to.Ptr("10.4.0.0")}, - SourcePorts: []*string{ - to.Ptr("0")}, - }, - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - }, - }, nil) + res, err := clientFactory.NewReachabilityAnalysisIntentsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", 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.ReachabilityAnalysisIntent = armnetwork.ReachabilityAnalysisIntent{ - // Name: to.Ptr("testAnalysisIntentName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, + // res = armnetwork.ReachabilityAnalysisIntentsClientGetResponse{ + // ReachabilityAnalysisIntent: armnetwork.ReachabilityAnalysisIntent{ + // Name: to.Ptr("testAnalysisIntentName"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), + // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // } + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisIntentDelete.json -func ExampleReachabilityAnalysisIntentsClient_Delete() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisIntentList.json +func ExampleReachabilityAnalysisIntentsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewReachabilityAnalysisIntentsClient().Delete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntent", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewReachabilityAnalysisIntentsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", 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 = armnetwork.ReachabilityAnalysisIntentsClientListResponse{ + // ReachabilityAnalysisIntentListResult: armnetwork.ReachabilityAnalysisIntentListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ReachabilityAnalysisIntent{ + // { + // Name: to.Ptr("testReachabilityAnalysisIntenant1"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), + // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go index e173682c1796..4bc1d8f01f30 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ReachabilityAnalysisRunsClient contains the methods for the ReachabilityAnalysisRuns group. // Don't use this type directly, use NewReachabilityAnalysisRunsClient() instead. +// +// Generated from API version 2025-07-01 type ReachabilityAnalysisRunsClient struct { internal *arm.Client subscriptionID string } // NewReachabilityAnalysisRunsClient creates a new instance of ReachabilityAnalysisRunsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewReachabilityAnalysisRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReachabilityAnalysisRunsClient, error) { @@ -43,12 +43,12 @@ func NewReachabilityAnalysisRunsClient(subscriptionID string, credential azcore. } // Create - Creates Reachability Analysis Runs. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Creates Reachability Analysis Runs. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisRunName - Reachability Analysis Run name. // - body - Analysis Run resource object to create/update. // - options - ReachabilityAnalysisRunsClientCreateOptions contains the optional parameters for the ReachabilityAnalysisRunsClient.Create @@ -103,9 +103,10 @@ func (client *ReachabilityAnalysisRunsClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { return nil, err } @@ -122,12 +123,12 @@ func (client *ReachabilityAnalysisRunsClient) createHandleResponse(resp *http.Re } // BeginDelete - Deletes Reachability Analysis Run. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Deletes Reachability Analysis Run. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisRunName - Reachability Analysis Run name. // - options - ReachabilityAnalysisRunsClientBeginDeleteOptions contains the optional parameters for the ReachabilityAnalysisRunsClient.BeginDelete // method. @@ -138,8 +139,7 @@ func (client *ReachabilityAnalysisRunsClient) BeginDelete(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReachabilityAnalysisRunsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,9 +150,9 @@ func (client *ReachabilityAnalysisRunsClient) BeginDelete(ctx context.Context, r } // Delete - Deletes Reachability Analysis Run. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 +// Deletes Reachability Analysis Run. +// If the operation fails it returns an *azcore.ResponseError type. func (client *ReachabilityAnalysisRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, options *ReachabilityAnalysisRunsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReachabilityAnalysisRunsClient.BeginDelete" @@ -202,19 +202,18 @@ func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets Reachability Analysis Run. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets Reachability Analysis Run. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - reachabilityAnalysisRunName - Reachability Analysis Run name. // - options - ReachabilityAnalysisRunsClientGetOptions contains the optional parameters for the ReachabilityAnalysisRunsClient.Get // method. @@ -268,8 +267,8 @@ func (client *ReachabilityAnalysisRunsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -285,10 +284,10 @@ func (client *ReachabilityAnalysisRunsClient) getHandleResponse(resp *http.Respo // NewListPager - Gets list of Reachability Analysis Runs. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets list of Reachability Analysis Runs. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - options - ReachabilityAnalysisRunsClientListOptions contains the optional parameters for the ReachabilityAnalysisRunsClient.NewListPager // method. func (client *ReachabilityAnalysisRunsClient) NewListPager(resourceGroupName string, networkManagerName string, workspaceName string, options *ReachabilityAnalysisRunsClientListOptions) *runtime.Pager[ReachabilityAnalysisRunsClientListResponse] { @@ -338,7 +337,7 @@ func (client *ReachabilityAnalysisRunsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -354,7 +353,7 @@ func (client *ReachabilityAnalysisRunsClient) listCreateRequest(ctx context.Cont if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go index 5964d3968745..d05ff435717e 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go @@ -1,219 +1,234 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisRunList.json -func ExampleReachabilityAnalysisRunsClient_NewListPager() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisRunPut.json +func ExampleReachabilityAnalysisRunsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewReachabilityAnalysisRunsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", &armnetwork.ReachabilityAnalysisRunsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.ReachabilityAnalysisRunListResult = armnetwork.ReachabilityAnalysisRunListResult{ - // Value: []*armnetwork.ReachabilityAnalysisRun{ - // { - // Name: to.Ptr("testReachabilityAnalysisRun1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisRuns/testReachabilityAnalysisRun1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + res, err := clientFactory.NewReachabilityAnalysisRunsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", armnetwork.ReachabilityAnalysisRun{ + Properties: &armnetwork.ReachabilityAnalysisRunProperties{ + Description: to.Ptr("A sample reachability analysis run"), + IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), + }, + }, 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 = armnetwork.ReachabilityAnalysisRunsClientCreateResponse{ + // ReachabilityAnalysisRun: armnetwork.ReachabilityAnalysisRun{ + // Name: to.Ptr("testAnalysisRunName"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), + // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // IntentContent: &armnetwork.IntentContent{ + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisRunGet.json -func ExampleReachabilityAnalysisRunsClient_Get() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisRunDelete.json +func ExampleReachabilityAnalysisRunsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewReachabilityAnalysisRunsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", nil) + poller, err := clientFactory.NewReachabilityAnalysisRunsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRun", 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.ReachabilityAnalysisRun = armnetwork.ReachabilityAnalysisRun{ - // Name: to.Ptr("testAnalysisRunName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // AnalysisResult: to.Ptr("{\"resultOutcome\":\"NoPacketsReached\",\"unreachedTrace\":\"[{\\\"name\\\":\\\"testVmSrc\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc\\\",\\\"resourceType\\\":\\\"Microsoft.Compute/virtualMachines\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkInterface\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkInterfaces\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkManager\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkManagers\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched an admin security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_ADMIN_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"AllowAllOutbound\\\",\\\"action\\\":\\\"Allow\\\",\\\"destinationAddress\\\":\\\"*\\\",\\\"sourceAddress\\\":\\\"*\\\",\\\"destinationPort\\\":\\\"1-65535\\\",\\\"sourcePort\\\":\\\"1-65535\\\",\\\"protocol\\\":\\\"Any\\\"}}},{\\\"name\\\":\\\"testnsg\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg-eus2\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkSecurityGroups\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a network security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"defaultSecurityRules/AllowVnetOutBound\\\",\\\"action\\\":\\\"allow\\\",\\\"destinationAddress\\\":\\\"VirtualNetwork\\\",\\\"sourceAddress\\\":\\\"VirtualNetwork\\\",\\\"destinationPort\\\":\\\"0-65535\\\",\\\"sourcePort\\\":\\\"0-65535\\\",\\\"protocol\\\":\\\"All\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a system route.\\\",\\\"explanationCode\\\":\\\"MATCHED_SYSTEM_ROUTE\\\",\\\"matchedSubnetRoute\\\":{\\\"source\\\":\\\"Default\\\",\\\"addressPrefix\\\":\\\"10.1.0.0/16\\\",\\\"nextHopIpAddress\\\":[],\\\"nextHopType\\\":\\\"ConnectedGroup\\\"}}},{\\\"name\\\":\\\"testvnet1\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet destination IP is destined to subnet prefix.\\\",\\\"explanationCode\\\":\\\"MATCHED_SUBNET_PREFIX\\\",\\\"matchedSubnetPrefix\\\":{\\\"subnet\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet-1/subnets/default\\\",\\\"subnetPrefix\\\":\\\"10.1.0.0/24\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"443\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\"\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet denied due to VM not currently running.\\\",\\\"explanationCode\\\":\\\"VM_TURNED_OFF\\\"}}]\"}"), - // ErrorMessage: to.Ptr(""), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisRunPut.json -func ExampleReachabilityAnalysisRunsClient_Create() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisRunGet.json +func ExampleReachabilityAnalysisRunsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewReachabilityAnalysisRunsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", armnetwork.ReachabilityAnalysisRun{ - Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - Description: to.Ptr("A sample reachability analysis run"), - IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - }, - }, nil) + res, err := clientFactory.NewReachabilityAnalysisRunsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", 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.ReachabilityAnalysisRun = armnetwork.ReachabilityAnalysisRun{ - // Name: to.Ptr("testAnalysisRunName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, + // res = armnetwork.ReachabilityAnalysisRunsClientGetResponse{ + // ReachabilityAnalysisRun: armnetwork.ReachabilityAnalysisRun{ + // Name: to.Ptr("testAnalysisRunName"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), + // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // AnalysisResult: to.Ptr("{\"resultOutcome\":\"NoPacketsReached\",\"unreachedTrace\":\"[{\\\"name\\\":\\\"testVmSrc\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc\\\",\\\"resourceType\\\":\\\"Microsoft.Compute/virtualMachines\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkInterface\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkInterfaces\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkManager\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkManagers\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched an admin security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_ADMIN_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"AllowAllOutbound\\\",\\\"action\\\":\\\"Allow\\\",\\\"destinationAddress\\\":\\\"*\\\",\\\"sourceAddress\\\":\\\"*\\\",\\\"destinationPort\\\":\\\"1-65535\\\",\\\"sourcePort\\\":\\\"1-65535\\\",\\\"protocol\\\":\\\"Any\\\"}}},{\\\"name\\\":\\\"testnsg\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg-eus2\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkSecurityGroups\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a network security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"defaultSecurityRules/AllowVnetOutBound\\\",\\\"action\\\":\\\"allow\\\",\\\"destinationAddress\\\":\\\"VirtualNetwork\\\",\\\"sourceAddress\\\":\\\"VirtualNetwork\\\",\\\"destinationPort\\\":\\\"0-65535\\\",\\\"sourcePort\\\":\\\"0-65535\\\",\\\"protocol\\\":\\\"All\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a system route.\\\",\\\"explanationCode\\\":\\\"MATCHED_SYSTEM_ROUTE\\\",\\\"matchedSubnetRoute\\\":{\\\"source\\\":\\\"Default\\\",\\\"addressPrefix\\\":\\\"10.1.0.0/16\\\",\\\"nextHopIpAddress\\\":[],\\\"nextHopType\\\":\\\"ConnectedGroup\\\"}}},{\\\"name\\\":\\\"testvnet1\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet destination IP is destined to subnet prefix.\\\",\\\"explanationCode\\\":\\\"MATCHED_SUBNET_PREFIX\\\",\\\"matchedSubnetPrefix\\\":{\\\"subnet\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet-1/subnets/default\\\",\\\"subnetPrefix\\\":\\\"10.1.0.0/24\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"443\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\"\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet denied due to VM not currently running.\\\",\\\"explanationCode\\\":\\\"VM_TURNED_OFF\\\"}}]\"}"), + // ErrorMessage: to.Ptr(""), + // IntentContent: &armnetwork.IntentContent{ + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ReachabilityAnalysisRunDelete.json -func ExampleReachabilityAnalysisRunsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ReachabilityAnalysisRunList.json +func ExampleReachabilityAnalysisRunsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewReachabilityAnalysisRunsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRun", 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) + pager := clientFactory.NewReachabilityAnalysisRunsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", 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 = armnetwork.ReachabilityAnalysisRunsClientListResponse{ + // ReachabilityAnalysisRunListResult: armnetwork.ReachabilityAnalysisRunListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisRuns?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ReachabilityAnalysisRun{ + // { + // Name: to.Ptr("testReachabilityAnalysisRun1"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisRuns/testReachabilityAnalysisRun1"), + // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ + // Description: to.Ptr("A sample reachability analysis intent"), + // IntentContent: &armnetwork.IntentContent{ + // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), + // IPTraffic: &armnetwork.IPTraffic{ + // DestinationIPs: []*string{ + // to.Ptr("10.4.0.1"), + // }, + // DestinationPorts: []*string{ + // to.Ptr("0"), + // }, + // Protocols: []*armnetwork.NetworkProtocol{ + // to.Ptr(armnetwork.NetworkProtocolAny), + // }, + // SourceIPs: []*string{ + // to.Ptr("10.4.0.0"), + // }, + // SourcePorts: []*string{ + // to.Ptr("0"), + // }, + // }, + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), + // }, + // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go index 200fe2e3e3ff..fece162b5361 100644 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ResourceNavigationLinksClient contains the methods for the ResourceNavigationLinks group. // Don't use this type directly, use NewResourceNavigationLinksClient() instead. +// +// Generated from API version 2025-07-01 type ResourceNavigationLinksClient struct { internal *arm.Client subscriptionID string } // NewResourceNavigationLinksClient creates a new instance of ResourceNavigationLinksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewResourceNavigationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceNavigationLinksClient, error) { @@ -43,9 +43,7 @@ func NewResourceNavigationLinksClient(subscriptionID string, credential azcore.T // List - Gets a list of resource navigation links for a subnet. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - options - ResourceNavigationLinksClientListOptions contains the optional parameters for the ResourceNavigationLinksClient.List @@ -74,7 +72,11 @@ func (client *ResourceNavigationLinksClient) List(ctx context.Context, resourceG // listCreateRequest creates the List request. func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, _ *ResourceNavigationLinksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/resourceNavigationLinks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Conte return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go index 900a9ab3ab17..42c54260c621 100644 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGetResourceNavigationLinks.json +// Generated from example definition: 2025-07-01/VirtualNetworkGetResourceNavigationLinks.json func ExampleResourceNavigationLinksClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,18 +29,21 @@ func ExampleResourceNavigationLinksClient_List() { // 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.ResourceNavigationLinksListResult = armnetwork.ResourceNavigationLinksListResult{ - // Value: []*armnetwork.ResourceNavigationLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/resourceNavigationLinks/redisCache_redis-tester"), - // Name: to.Ptr("redisCache_redis-tester"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ResourceNavigationLinkFormat{ - // Link: to.Ptr("/subscriptions/subid/resourceGroups/another-rg/providers/Microsoft.Cache/Redis/redis-tester"), - // LinkedResourceType: to.Ptr("Microsoft.Cache/redis"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.ResourceNavigationLinksClientListResponse{ + // ResourceNavigationLinksListResult: armnetwork.ResourceNavigationLinksListResult{ + // Value: []*armnetwork.ResourceNavigationLink{ + // { + // Name: to.Ptr("redisCache_redis-tester"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/resourceNavigationLinks/redisCache_redis-tester"), + // Properties: &armnetwork.ResourceNavigationLinkFormat{ + // Link: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/another-rg/providers/Microsoft.Cache/Redis/redis-tester"), + // LinkedResourceType: to.Ptr("Microsoft.Cache/redis"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/responses.go b/sdk/resourcemanager/network/armnetwork/responses.go index 4e8b9a9d86c1..0bf9b781127b 100644 --- a/sdk/resourcemanager/network/armnetwork/responses.go +++ b/sdk/resourcemanager/network/armnetwork/responses.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -24,7 +23,7 @@ type AdminRuleCollectionsClientGetResponse struct { // AdminRuleCollectionsClientListResponse contains the response from method AdminRuleCollectionsClient.NewListPager. type AdminRuleCollectionsClientListResponse struct { - // Security admin configuration rule collection list result. + // The response of a AdminRuleCollection list operation. AdminRuleCollectionListResult } @@ -47,7 +46,7 @@ type AdminRulesClientGetResponse struct { // AdminRulesClientListResponse contains the response from method AdminRulesClient.NewListPager. type AdminRulesClientListResponse struct { - // security configuration admin rule list result. + // Paged collection of BaseAdminRule items AdminRuleListResult } @@ -64,8 +63,7 @@ type ApplicationGatewayPrivateEndpointConnectionsClientGetResponse struct { // ApplicationGatewayPrivateEndpointConnectionsClientListResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager. type ApplicationGatewayPrivateEndpointConnectionsClientListResponse struct { - // Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections for - // an application gateway. + // The response of a ApplicationGatewayPrivateEndpointConnection list operation. ApplicationGatewayPrivateEndpointConnectionListResult } @@ -77,8 +75,7 @@ type ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse struct { // ApplicationGatewayPrivateLinkResourcesClientListResponse contains the response from method ApplicationGatewayPrivateLinkResourcesClient.NewListPager. type ApplicationGatewayPrivateLinkResourcesClientListResponse struct { - // Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an application - // gateway. + // The response of a ApplicationGatewayPrivateLinkResource list operation. ApplicationGatewayPrivateLinkResourceListResult } @@ -131,19 +128,17 @@ type ApplicationGatewaysClientGetSSLPredefinedPolicyResponse struct { // ApplicationGatewaysClientListAllResponse contains the response from method ApplicationGatewaysClient.NewListAllPager. type ApplicationGatewaysClientListAllResponse struct { - // Response for ListApplicationGateways API service call. + // The response of a ApplicationGateway list operation. ApplicationGatewayListResult } // ApplicationGatewaysClientListAvailableRequestHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableRequestHeaders. type ApplicationGatewaysClientListAvailableRequestHeadersResponse struct { - // Response for ApplicationGatewayAvailableRequestHeaders API service call. StringArray []*string } // ApplicationGatewaysClientListAvailableResponseHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableResponseHeaders. type ApplicationGatewaysClientListAvailableResponseHeadersResponse struct { - // Response for ApplicationGatewayAvailableResponseHeaders API service call. StringArray []*string } @@ -161,7 +156,6 @@ type ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse struct // ApplicationGatewaysClientListAvailableServerVariablesResponse contains the response from method ApplicationGatewaysClient.ListAvailableServerVariables. type ApplicationGatewaysClientListAvailableServerVariablesResponse struct { - // Response for ApplicationGatewayAvailableServerVariables API service call. StringArray []*string } @@ -173,7 +167,7 @@ type ApplicationGatewaysClientListAvailableWafRuleSetsResponse struct { // ApplicationGatewaysClientListResponse contains the response from method ApplicationGatewaysClient.NewListPager. type ApplicationGatewaysClientListResponse struct { - // Response for ListApplicationGateways API service call. + // The response of a ApplicationGateway list operation. ApplicationGatewayListResult } @@ -212,13 +206,13 @@ type ApplicationSecurityGroupsClientGetResponse struct { // ApplicationSecurityGroupsClientListAllResponse contains the response from method ApplicationSecurityGroupsClient.NewListAllPager. type ApplicationSecurityGroupsClientListAllResponse struct { - // A list of application security groups. + // The response of a ApplicationSecurityGroup list operation. ApplicationSecurityGroupListResult } // ApplicationSecurityGroupsClientListResponse contains the response from method ApplicationSecurityGroupsClient.NewListPager. type ApplicationSecurityGroupsClientListResponse struct { - // A list of application security groups. + // The response of a ApplicationSecurityGroup list operation. ApplicationSecurityGroupListResult } @@ -236,7 +230,7 @@ type AvailableDelegationsClientListResponse struct { // AvailableEndpointServicesClientListResponse contains the response from method AvailableEndpointServicesClient.NewListPager. type AvailableEndpointServicesClientListResponse struct { - // Response for the ListAvailableEndpointServices API service call. + // Paged collection of EndpointServiceResult items EndpointServicesListResult } @@ -272,7 +266,7 @@ type AvailableServiceAliasesClientListResponse struct { // AzureFirewallFqdnTagsClientListAllResponse contains the response from method AzureFirewallFqdnTagsClient.NewListAllPager. type AzureFirewallFqdnTagsClientListAllResponse struct { - // Response for ListAzureFirewallFqdnTags API service call. + // The response of a AzureFirewallFqdnTag list operation. AzureFirewallFqdnTagListResult } @@ -295,7 +289,7 @@ type AzureFirewallsClientGetResponse struct { // AzureFirewallsClientListAllResponse contains the response from method AzureFirewallsClient.NewListAllPager. type AzureFirewallsClientListAllResponse struct { - // Response for ListAzureFirewalls API service call. + // The response of a AzureFirewall list operation. AzureFirewallListResult } @@ -307,7 +301,7 @@ type AzureFirewallsClientListLearnedPrefixesResponse struct { // AzureFirewallsClientListResponse contains the response from method AzureFirewallsClient.NewListPager. type AzureFirewallsClientListResponse struct { - // Response for ListAzureFirewalls API service call. + // The response of a AzureFirewall list operation. AzureFirewallListResult } @@ -347,13 +341,13 @@ type BastionHostsClientGetResponse struct { // BastionHostsClientListByResourceGroupResponse contains the response from method BastionHostsClient.NewListByResourceGroupPager. type BastionHostsClientListByResourceGroupResponse struct { - // Response for ListBastionHosts API service call. + // The response of a BastionHost list operation. BastionHostListResult } // BastionHostsClientListResponse contains the response from method BastionHostsClient.NewListPager. type BastionHostsClientListResponse struct { - // Response for ListBastionHosts API service call. + // The response of a BastionHost list operation. BastionHostListResult } @@ -365,10 +359,33 @@ type BastionHostsClientUpdateTagsResponse struct { // BgpServiceCommunitiesClientListResponse contains the response from method BgpServiceCommunitiesClient.NewListPager. type BgpServiceCommunitiesClientListResponse struct { - // Response for the ListServiceCommunity API service call. + // The response of a BgpServiceCommunity list operation. BgpServiceCommunityListResult } +// CommitsClientCreateOrUpdateResponse contains the response from method CommitsClient.BeginCreateOrUpdate. +type CommitsClientCreateOrUpdateResponse struct { + // The commit resource + Commit +} + +// CommitsClientDeleteResponse contains the response from method CommitsClient.BeginDelete. +type CommitsClientDeleteResponse struct { + // placeholder for future response values +} + +// CommitsClientGetResponse contains the response from method CommitsClient.Get. +type CommitsClientGetResponse struct { + // The commit resource + Commit +} + +// CommitsClientListResponse contains the response from method CommitsClient.NewListPager. +type CommitsClientListResponse struct { + // The response of a Commit list operation. + CommitListResult +} + // ConfigurationPolicyGroupsClientCreateOrUpdateResponse contains the response from method ConfigurationPolicyGroupsClient.BeginCreateOrUpdate. type ConfigurationPolicyGroupsClientCreateOrUpdateResponse struct { // VpnServerConfigurationPolicyGroup Resource. @@ -427,6 +444,29 @@ type ConnectionMonitorsClientUpdateTagsResponse struct { ConnectionMonitorResult } +// ConnectionPoliciesClientCreateOrUpdateResponse contains the response from method ConnectionPoliciesClient.BeginCreateOrUpdate. +type ConnectionPoliciesClientCreateOrUpdateResponse struct { + // ConnectionPolicy resource defined for VirtualHub. + ConnectionPolicy +} + +// ConnectionPoliciesClientDeleteResponse contains the response from method ConnectionPoliciesClient.BeginDelete. +type ConnectionPoliciesClientDeleteResponse struct { + // placeholder for future response values +} + +// ConnectionPoliciesClientGetResponse contains the response from method ConnectionPoliciesClient.Get. +type ConnectionPoliciesClientGetResponse struct { + // ConnectionPolicy resource defined for VirtualHub. + ConnectionPolicy +} + +// ConnectionPoliciesClientListResponse contains the response from method ConnectionPoliciesClient.NewListPager. +type ConnectionPoliciesClientListResponse struct { + // List of ConnectionPolicies and a URL nextLink to get the next set of results. + ListConnectionPoliciesResult +} + // ConnectivityConfigurationsClientCreateOrUpdateResponse contains the response from method ConnectivityConfigurationsClient.CreateOrUpdate. type ConnectivityConfigurationsClientCreateOrUpdateResponse struct { // The network manager connectivity configuration resource @@ -446,8 +486,7 @@ type ConnectivityConfigurationsClientGetResponse struct { // ConnectivityConfigurationsClientListResponse contains the response from method ConnectivityConfigurationsClient.NewListPager. type ConnectivityConfigurationsClientListResponse struct { - // Result of the request to list network manager connectivity configurations. It contains a list of configurations and a link - // to get the next set of results. + // The response of a ConnectivityConfiguration list operation. ConnectivityConfigurationListResult } @@ -470,13 +509,13 @@ type CustomIPPrefixesClientGetResponse struct { // CustomIPPrefixesClientListAllResponse contains the response from method CustomIPPrefixesClient.NewListAllPager. type CustomIPPrefixesClientListAllResponse struct { - // Response for ListCustomIpPrefixes API service call. + // The response of a CustomIpPrefix list operation. CustomIPPrefixListResult } // CustomIPPrefixesClientListResponse contains the response from method CustomIPPrefixesClient.NewListPager. type CustomIPPrefixesClientListResponse struct { - // Response for ListCustomIpPrefixes API service call. + // The response of a CustomIpPrefix list operation. CustomIPPrefixListResult } @@ -503,6 +542,18 @@ type DdosCustomPoliciesClientGetResponse struct { DdosCustomPolicy } +// DdosCustomPoliciesClientListAllResponse contains the response from method DdosCustomPoliciesClient.NewListAllPager. +type DdosCustomPoliciesClientListAllResponse struct { + // The response of a DdosCustomPolicy list operation. + DdosCustomPolicyListResult +} + +// DdosCustomPoliciesClientListResponse contains the response from method DdosCustomPoliciesClient.NewListPager. +type DdosCustomPoliciesClientListResponse struct { + // The response of a DdosCustomPolicy list operation. + DdosCustomPolicyListResult +} + // DdosCustomPoliciesClientUpdateTagsResponse contains the response from method DdosCustomPoliciesClient.UpdateTags. type DdosCustomPoliciesClientUpdateTagsResponse struct { // A DDoS custom policy in a resource group. @@ -528,13 +579,13 @@ type DdosProtectionPlansClientGetResponse struct { // DdosProtectionPlansClientListByResourceGroupResponse contains the response from method DdosProtectionPlansClient.NewListByResourceGroupPager. type DdosProtectionPlansClientListByResourceGroupResponse struct { - // A list of DDoS protection plans. + // The response of a DdosProtectionPlan list operation. DdosProtectionPlanListResult } // DdosProtectionPlansClientListResponse contains the response from method DdosProtectionPlansClient.NewListPager. type DdosProtectionPlansClientListResponse struct { - // A list of DDoS protection plans. + // The response of a DdosProtectionPlan list operation. DdosProtectionPlanListResult } @@ -552,7 +603,7 @@ type DefaultSecurityRulesClientGetResponse struct { // DefaultSecurityRulesClientListResponse contains the response from method DefaultSecurityRulesClient.NewListPager. type DefaultSecurityRulesClientListResponse struct { - // Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. + // The response of a SecurityRule list operation. SecurityRuleListResult } @@ -575,13 +626,13 @@ type DscpConfigurationClientGetResponse struct { // DscpConfigurationClientListAllResponse contains the response from method DscpConfigurationClient.NewListAllPager. type DscpConfigurationClientListAllResponse struct { - // Response for the DscpConfigurationList API service call. + // The response of a DscpConfiguration list operation. DscpConfigurationListResult } // DscpConfigurationClientListResponse contains the response from method DscpConfigurationClient.NewListPager. type DscpConfigurationClientListResponse struct { - // Response for the DscpConfigurationList API service call. + // The response of a DscpConfiguration list operation. DscpConfigurationListResult } @@ -604,7 +655,7 @@ type ExpressRouteCircuitAuthorizationsClientGetResponse struct { // ExpressRouteCircuitAuthorizationsClientListResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.NewListPager. type ExpressRouteCircuitAuthorizationsClientListResponse struct { - // Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + // Paged collection of ExpressRouteCircuitAuthorization items AuthorizationListResult } @@ -627,8 +678,7 @@ type ExpressRouteCircuitConnectionsClientGetResponse struct { // ExpressRouteCircuitConnectionsClientListResponse contains the response from method ExpressRouteCircuitConnectionsClient.NewListPager. type ExpressRouteCircuitConnectionsClientListResponse struct { - // Response for ListConnections API service call retrieves all global reach connections that belongs to a Private Peering - // for an ExpressRouteCircuit. + // The response of a ExpressRouteCircuitConnection list operation. ExpressRouteCircuitConnectionListResult } @@ -651,7 +701,7 @@ type ExpressRouteCircuitPeeringsClientGetResponse struct { // ExpressRouteCircuitPeeringsClientListResponse contains the response from method ExpressRouteCircuitPeeringsClient.NewListPager. type ExpressRouteCircuitPeeringsClientListResponse struct { - // Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + // The response of a ExpressRouteCircuitPeering list operation. ExpressRouteCircuitPeeringListResult } @@ -666,6 +716,16 @@ type ExpressRouteCircuitsClientDeleteResponse struct { // placeholder for future response values } +// ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse contains the response from method ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverAllTestsDetails. +type ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse struct { + ExpressRouteLinkFailoverAllTestsDetailsArray []*ExpressRouteLinkFailoverAllTestsDetails +} + +// ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse contains the response from method ExpressRouteCircuitsClient.BeginGetCircuitLinkFailoverSingleTestDetails. +type ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse struct { + ExpressRouteLinkFailoverSingleTestDetailsArray []*ExpressRouteLinkFailoverSingleTestDetails +} + // ExpressRouteCircuitsClientGetPeeringStatsResponse contains the response from method ExpressRouteCircuitsClient.GetPeeringStats. type ExpressRouteCircuitsClientGetPeeringStatsResponse struct { // Contains stats associated with the peering. @@ -686,7 +746,7 @@ type ExpressRouteCircuitsClientGetStatsResponse struct { // ExpressRouteCircuitsClientListAllResponse contains the response from method ExpressRouteCircuitsClient.NewListAllPager. type ExpressRouteCircuitsClientListAllResponse struct { - // Response for ListExpressRouteCircuit API service call. + // The response of a ExpressRouteCircuit list operation. ExpressRouteCircuitListResult } @@ -698,7 +758,7 @@ type ExpressRouteCircuitsClientListArpTableResponse struct { // ExpressRouteCircuitsClientListResponse contains the response from method ExpressRouteCircuitsClient.NewListPager. type ExpressRouteCircuitsClientListResponse struct { - // Response for ListExpressRouteCircuit API service call. + // The response of a ExpressRouteCircuit list operation. ExpressRouteCircuitListResult } @@ -714,6 +774,16 @@ type ExpressRouteCircuitsClientListRoutesTableSummaryResponse struct { ExpressRouteCircuitsRoutesTableSummaryListResult } +// ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse contains the response from method ExpressRouteCircuitsClient.BeginStartCircuitLinkFailoverTest. +type ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse struct { + Value *string +} + +// ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse contains the response from method ExpressRouteCircuitsClient.BeginStopCircuitLinkFailoverTest. +type ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse struct { + Value *string +} + // ExpressRouteCircuitsClientUpdateTagsResponse contains the response from method ExpressRouteCircuitsClient.UpdateTags. type ExpressRouteCircuitsClientUpdateTagsResponse struct { // ExpressRouteCircuit resource. @@ -786,13 +856,13 @@ type ExpressRouteCrossConnectionsClientListArpTableResponse struct { // ExpressRouteCrossConnectionsClientListByResourceGroupResponse contains the response from method ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager. type ExpressRouteCrossConnectionsClientListByResourceGroupResponse struct { - // Response for ListExpressRouteCrossConnection API service call. + // The response of a ExpressRouteCrossConnection list operation. ExpressRouteCrossConnectionListResult } // ExpressRouteCrossConnectionsClientListResponse contains the response from method ExpressRouteCrossConnectionsClient.NewListPager. type ExpressRouteCrossConnectionsClientListResponse struct { - // Response for ListExpressRouteCrossConnection API service call. + // The response of a ExpressRouteCrossConnection list operation. ExpressRouteCrossConnectionListResult } @@ -825,12 +895,34 @@ type ExpressRouteGatewaysClientDeleteResponse struct { // placeholder for future response values } +// ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse contains the response from method ExpressRouteGatewaysClient.BeginGetFailoverAllTestsDetails. +type ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse struct { + ExpressRouteFailoverTestDetailsArray []*ExpressRouteFailoverTestDetails +} + +// ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse contains the response from method ExpressRouteGatewaysClient.BeginGetFailoverSingleTestDetails. +type ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse struct { + ExpressRouteFailoverSingleTestDetailsArray []*ExpressRouteFailoverSingleTestDetails +} + +// ExpressRouteGatewaysClientGetResiliencyInformationResponse contains the response from method ExpressRouteGatewaysClient.BeginGetResiliencyInformation. +type ExpressRouteGatewaysClientGetResiliencyInformationResponse struct { + // Gateway Resiliency Information + GatewayResiliencyInformation +} + // ExpressRouteGatewaysClientGetResponse contains the response from method ExpressRouteGatewaysClient.Get. type ExpressRouteGatewaysClientGetResponse struct { // ExpressRoute gateway resource. ExpressRouteGateway } +// ExpressRouteGatewaysClientGetRoutesInformationResponse contains the response from method ExpressRouteGatewaysClient.BeginGetRoutesInformation. +type ExpressRouteGatewaysClientGetRoutesInformationResponse struct { + // Gateway Route Sets Information + GatewayRouteSetsInformation +} + // ExpressRouteGatewaysClientListByResourceGroupResponse contains the response from method ExpressRouteGatewaysClient.ListByResourceGroup. type ExpressRouteGatewaysClientListByResourceGroupResponse struct { // List of ExpressRoute gateways. @@ -843,6 +935,16 @@ type ExpressRouteGatewaysClientListBySubscriptionResponse struct { ExpressRouteGatewayList } +// ExpressRouteGatewaysClientStartSiteFailoverTestResponse contains the response from method ExpressRouteGatewaysClient.BeginStartSiteFailoverTest. +type ExpressRouteGatewaysClientStartSiteFailoverTestResponse struct { + Value *string +} + +// ExpressRouteGatewaysClientStopSiteFailoverTestResponse contains the response from method ExpressRouteGatewaysClient.BeginStopSiteFailoverTest. +type ExpressRouteGatewaysClientStopSiteFailoverTestResponse struct { + Value *string +} + // ExpressRouteGatewaysClientUpdateTagsResponse contains the response from method ExpressRouteGatewaysClient.BeginUpdateTags. type ExpressRouteGatewaysClientUpdateTagsResponse struct { // ExpressRoute gateway resource. @@ -851,18 +953,24 @@ type ExpressRouteGatewaysClientUpdateTagsResponse struct { // ExpressRouteLinksClientGetResponse contains the response from method ExpressRouteLinksClient.Get. type ExpressRouteLinksClientGetResponse struct { + // ExpressRouteLink + // // ExpressRouteLink child resource definition. ExpressRouteLink } // ExpressRouteLinksClientListResponse contains the response from method ExpressRouteLinksClient.NewListPager. type ExpressRouteLinksClientListResponse struct { + // ExpressRouteLink List Result + // // Response for ListExpressRouteLinks API service call. ExpressRouteLinkListResult } // ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate. type ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse struct { + // ExpressRoute Port Authorization + // // ExpressRoutePort Authorization resource definition. ExpressRoutePortAuthorization } @@ -874,18 +982,24 @@ type ExpressRoutePortAuthorizationsClientDeleteResponse struct { // ExpressRoutePortAuthorizationsClientGetResponse contains the response from method ExpressRoutePortAuthorizationsClient.Get. type ExpressRoutePortAuthorizationsClientGetResponse struct { + // ExpressRoute Port Authorization + // // ExpressRoutePort Authorization resource definition. ExpressRoutePortAuthorization } // ExpressRoutePortAuthorizationsClientListResponse contains the response from method ExpressRoutePortAuthorizationsClient.NewListPager. type ExpressRoutePortAuthorizationsClientListResponse struct { - // Response for ListExpressRoutePortAuthorizations API service call. + // ExpressRoute Port Authorization List Result + // + // Paged collection of ExpressRoutePortAuthorization items ExpressRoutePortAuthorizationListResult } // ExpressRoutePortsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortsClient.BeginCreateOrUpdate. type ExpressRoutePortsClientCreateOrUpdateResponse struct { + // ExpressRoute Port + // // ExpressRoutePort resource definition. ExpressRoutePort } @@ -903,37 +1017,49 @@ type ExpressRoutePortsClientGenerateLOAResponse struct { // ExpressRoutePortsClientGetResponse contains the response from method ExpressRoutePortsClient.Get. type ExpressRoutePortsClientGetResponse struct { + // ExpressRoute Port + // // ExpressRoutePort resource definition. ExpressRoutePort } // ExpressRoutePortsClientListByResourceGroupResponse contains the response from method ExpressRoutePortsClient.NewListByResourceGroupPager. type ExpressRoutePortsClientListByResourceGroupResponse struct { - // Response for ListExpressRoutePorts API service call. + // ExpressRoute Port List Result + // + // Paged collection of ExpressRoutePort items ExpressRoutePortListResult } // ExpressRoutePortsClientListResponse contains the response from method ExpressRoutePortsClient.NewListPager. type ExpressRoutePortsClientListResponse struct { - // Response for ListExpressRoutePorts API service call. + // ExpressRoute Port List Result + // + // Paged collection of ExpressRoutePort items ExpressRoutePortListResult } // ExpressRoutePortsClientUpdateTagsResponse contains the response from method ExpressRoutePortsClient.UpdateTags. type ExpressRoutePortsClientUpdateTagsResponse struct { + // ExpressRoute Port + // // ExpressRoutePort resource definition. ExpressRoutePort } // ExpressRoutePortsLocationsClientGetResponse contains the response from method ExpressRoutePortsLocationsClient.Get. type ExpressRoutePortsLocationsClientGetResponse struct { + // ExpressRoutePorts Peering Location + // // Definition of the ExpressRoutePorts peering location resource. ExpressRoutePortsLocation } // ExpressRoutePortsLocationsClientListResponse contains the response from method ExpressRoutePortsLocationsClient.NewListPager. type ExpressRoutePortsLocationsClientListResponse struct { - // Response for ListExpressRoutePortsLocations API service call. + // ExpressRoutePorts Location List Result + // + // Paged collection of ExpressRoutePortsLocation items ExpressRoutePortsLocationListResult } @@ -945,7 +1071,7 @@ type ExpressRouteProviderPortsLocationClientListResponse struct { // ExpressRouteServiceProvidersClientListResponse contains the response from method ExpressRouteServiceProvidersClient.NewListPager. type ExpressRouteServiceProvidersClientListResponse struct { - // Response for the ListExpressRouteServiceProvider API service call. + // The response of a ExpressRouteServiceProvider list operation. ExpressRouteServiceProviderListResult } @@ -968,13 +1094,13 @@ type FirewallPoliciesClientGetResponse struct { // FirewallPoliciesClientListAllResponse contains the response from method FirewallPoliciesClient.NewListAllPager. type FirewallPoliciesClientListAllResponse struct { - // Response for ListFirewallPolicies API service call. + // The response of a FirewallPolicy list operation. FirewallPolicyListResult } // FirewallPoliciesClientListResponse contains the response from method FirewallPoliciesClient.NewListPager. type FirewallPoliciesClientListResponse struct { - // Response for ListFirewallPolicies API service call. + // The response of a FirewallPolicy list operation. FirewallPolicyListResult } @@ -1078,7 +1204,7 @@ type FirewallPolicyRuleCollectionGroupsClientGetResponse struct { // FirewallPolicyRuleCollectionGroupsClientListResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.NewListPager. type FirewallPolicyRuleCollectionGroupsClientListResponse struct { - // Response for ListFirewallPolicyRuleCollectionGroups API service call. + // The response of a FirewallPolicyRuleCollectionGroup list operation. FirewallPolicyRuleCollectionGroupListResult } @@ -1101,7 +1227,7 @@ type FlowLogsClientGetResponse struct { // FlowLogsClientListResponse contains the response from method FlowLogsClient.NewListPager. type FlowLogsClientListResponse struct { - // List of flow logs. + // The response of a FlowLog list operation. FlowLogListResult } @@ -1116,7 +1242,7 @@ type GroupsClientCreateOrUpdateResponse struct { // The network group resource Group - // ETag contains the information returned from the ETag header response. + // The current entity tag. ETag *string } @@ -1133,7 +1259,7 @@ type GroupsClientGetResponse struct { // GroupsClientListResponse contains the response from method GroupsClient.NewListPager. type GroupsClientListResponse struct { - // Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get the next set of results. + // The response of a NetworkGroup list operation. GroupListResult } @@ -1202,13 +1328,13 @@ type IPAllocationsClientGetResponse struct { // IPAllocationsClientListByResourceGroupResponse contains the response from method IPAllocationsClient.NewListByResourceGroupPager. type IPAllocationsClientListByResourceGroupResponse struct { - // Response for the ListIpAllocations API service call. + // The response of a IpAllocation list operation. IPAllocationListResult } // IPAllocationsClientListResponse contains the response from method IPAllocationsClient.NewListPager. type IPAllocationsClientListResponse struct { - // Response for the ListIpAllocations API service call. + // The response of a IpAllocation list operation. IPAllocationListResult } @@ -1237,13 +1363,13 @@ type IPGroupsClientGetResponse struct { // IPGroupsClientListByResourceGroupResponse contains the response from method IPGroupsClient.NewListByResourceGroupPager. type IPGroupsClientListByResourceGroupResponse struct { - // Response for the ListIpGroups API service call. + // The response of a IpGroup list operation. IPGroupListResult } // IPGroupsClientListResponse contains the response from method IPGroupsClient.NewListPager. type IPGroupsClientListResponse struct { - // Response for the ListIpGroups API service call. + // The response of a IpGroup list operation. IPGroupListResult } @@ -1272,7 +1398,7 @@ type InboundNatRulesClientGetResponse struct { // InboundNatRulesClientListResponse contains the response from method InboundNatRulesClient.NewListPager. type InboundNatRulesClientListResponse struct { - // Response for ListInboundNatRule API service call. + // The response of a InboundNatRule list operation. InboundNatRuleListResult } @@ -1288,6 +1414,47 @@ type InboundSecurityRuleClientGetResponse struct { InboundSecurityRule } +// InterconnectGroupsClientCreateOrUpdateResponse contains the response from method InterconnectGroupsClient.CreateOrUpdate. +type InterconnectGroupsClientCreateOrUpdateResponse struct { + // An interconnect group resource. + InterconnectGroup +} + +// InterconnectGroupsClientDeleteResponse contains the response from method InterconnectGroupsClient.Delete. +type InterconnectGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// InterconnectGroupsClientGetNodeAvailabilityResponse contains the response from method InterconnectGroupsClient.BeginGetNodeAvailability. +type InterconnectGroupsClientGetNodeAvailabilityResponse struct { + // Represents node availability information for subgroups within an interconnect group. + InterconnectGroupNodeAvailability +} + +// InterconnectGroupsClientGetResponse contains the response from method InterconnectGroupsClient.Get. +type InterconnectGroupsClientGetResponse struct { + // An interconnect group resource. + InterconnectGroup +} + +// InterconnectGroupsClientListAllResponse contains the response from method InterconnectGroupsClient.NewListAllPager. +type InterconnectGroupsClientListAllResponse struct { + // The response of a InterconnectGroup list operation. + InterconnectGroupListResult +} + +// InterconnectGroupsClientListResponse contains the response from method InterconnectGroupsClient.NewListPager. +type InterconnectGroupsClientListResponse struct { + // The response of a InterconnectGroup list operation. + InterconnectGroupListResult +} + +// InterconnectGroupsClientUpdateTagsResponse contains the response from method InterconnectGroupsClient.UpdateTags. +type InterconnectGroupsClientUpdateTagsResponse struct { + // An interconnect group resource. + InterconnectGroup +} + // InterfaceIPConfigurationsClientGetResponse contains the response from method InterfaceIPConfigurationsClient.Get. type InterfaceIPConfigurationsClientGetResponse struct { // IPConfiguration in a network interface. @@ -1296,13 +1463,13 @@ type InterfaceIPConfigurationsClientGetResponse struct { // InterfaceIPConfigurationsClientListResponse contains the response from method InterfaceIPConfigurationsClient.NewListPager. type InterfaceIPConfigurationsClientListResponse struct { - // Response for list ip configurations API service call. + // The response of a NetworkInterfaceIPConfiguration list operation. InterfaceIPConfigurationListResult } // InterfaceLoadBalancersClientListResponse contains the response from method InterfaceLoadBalancersClient.NewListPager. type InterfaceLoadBalancersClientListResponse struct { - // Response for list ip configurations API service call. + // Paged collection of LoadBalancer items InterfaceLoadBalancerListResult } @@ -1325,7 +1492,7 @@ type InterfaceTapConfigurationsClientGetResponse struct { // InterfaceTapConfigurationsClientListResponse contains the response from method InterfaceTapConfigurationsClient.NewListPager. type InterfaceTapConfigurationsClientListResponse struct { - // Response for list tap configurations API service call. + // The response of a NetworkInterfaceTapConfiguration list operation. InterfaceTapConfigurationListResult } @@ -1372,19 +1539,19 @@ type InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse struct { // InterfacesClientListAllResponse contains the response from method InterfacesClient.NewListAllPager. type InterfacesClientListAllResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } // InterfacesClientListCloudServiceNetworkInterfacesResponse contains the response from method InterfacesClient.NewListCloudServiceNetworkInterfacesPager. type InterfacesClientListCloudServiceNetworkInterfacesResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } // InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse contains the response from method InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager. type InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } @@ -1396,25 +1563,25 @@ type InterfacesClientListEffectiveNetworkSecurityGroupsResponse struct { // InterfacesClientListResponse contains the response from method InterfacesClient.NewListPager. type InterfacesClientListResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } // InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager. type InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse struct { - // Response for list ip configurations API service call. + // The response of a NetworkInterfaceIPConfiguration list operation. InterfaceIPConfigurationListResult } // InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager. type InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } // InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager. type InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } @@ -1484,7 +1651,7 @@ type LoadBalancerBackendAddressPoolsClientGetResponse struct { // LoadBalancerBackendAddressPoolsClientListResponse contains the response from method LoadBalancerBackendAddressPoolsClient.NewListPager. type LoadBalancerBackendAddressPoolsClientListResponse struct { - // Response for ListBackendAddressPool API service call. + // Paged collection of BackendAddressPool items LoadBalancerBackendAddressPoolListResult } @@ -1496,7 +1663,7 @@ type LoadBalancerFrontendIPConfigurationsClientGetResponse struct { // LoadBalancerFrontendIPConfigurationsClientListResponse contains the response from method LoadBalancerFrontendIPConfigurationsClient.NewListPager. type LoadBalancerFrontendIPConfigurationsClientListResponse struct { - // Response for ListFrontendIPConfiguration API service call. + // Paged collection of FrontendIPConfiguration items LoadBalancerFrontendIPConfigurationListResult } @@ -1514,13 +1681,13 @@ type LoadBalancerLoadBalancingRulesClientHealthResponse struct { // LoadBalancerLoadBalancingRulesClientListResponse contains the response from method LoadBalancerLoadBalancingRulesClient.NewListPager. type LoadBalancerLoadBalancingRulesClientListResponse struct { - // Response for ListLoadBalancingRule API service call. + // Paged collection of LoadBalancingRule items LoadBalancerLoadBalancingRuleListResult } // LoadBalancerNetworkInterfacesClientListResponse contains the response from method LoadBalancerNetworkInterfacesClient.NewListPager. type LoadBalancerNetworkInterfacesClientListResponse struct { - // Response for the ListNetworkInterface API service call. + // The response of a NetworkInterface list operation. InterfaceListResult } @@ -1532,7 +1699,7 @@ type LoadBalancerOutboundRulesClientGetResponse struct { // LoadBalancerOutboundRulesClientListResponse contains the response from method LoadBalancerOutboundRulesClient.NewListPager. type LoadBalancerOutboundRulesClientListResponse struct { - // Response for ListOutboundRule API service call. + // Paged collection of OutboundRule items LoadBalancerOutboundRuleListResult } @@ -1544,7 +1711,7 @@ type LoadBalancerProbesClientGetResponse struct { // LoadBalancerProbesClientListResponse contains the response from method LoadBalancerProbesClient.NewListPager. type LoadBalancerProbesClientListResponse struct { - // Response for ListProbe API service call. + // Paged collection of Probe items LoadBalancerProbeListResult } @@ -1567,7 +1734,7 @@ type LoadBalancersClientGetResponse struct { // LoadBalancersClientListAllResponse contains the response from method LoadBalancersClient.NewListAllPager. type LoadBalancersClientListAllResponse struct { - // Response for ListLoadBalancers API service call. + // The response of a LoadBalancer list operation. LoadBalancerListResult } @@ -1579,7 +1746,7 @@ type LoadBalancersClientListInboundNatRulePortMappingsResponse struct { // LoadBalancersClientListResponse contains the response from method LoadBalancersClient.NewListPager. type LoadBalancersClientListResponse struct { - // Response for ListLoadBalancers API service call. + // The response of a LoadBalancer list operation. LoadBalancerListResult } @@ -1619,7 +1786,7 @@ type LocalNetworkGatewaysClientGetResponse struct { // LocalNetworkGatewaysClientListResponse contains the response from method LocalNetworkGatewaysClient.NewListPager. type LocalNetworkGatewaysClientListResponse struct { - // Response for ListLocalNetworkGateways API service call. + // The response of a LocalNetworkGateway list operation. LocalNetworkGatewayListResult } @@ -1734,7 +1901,7 @@ type ManagementGroupNetworkManagerConnectionsClientGetResponse struct { // ManagementGroupNetworkManagerConnectionsClientListResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.NewListPager. type ManagementGroupNetworkManagerConnectionsClientListResponse struct { - // List of network manager connections. + // The response of a NetworkManagerConnection list operation. ManagerConnectionListResult } @@ -1769,7 +1936,7 @@ type ManagerRoutingConfigurationsClientGetResponse struct { // ManagerRoutingConfigurationsClientListResponse contains the response from method ManagerRoutingConfigurationsClient.NewListPager. type ManagerRoutingConfigurationsClientListResponse struct { - // A list of network manager routing configurations + // The response of a NetworkManagerRoutingConfiguration list operation. ManagerRoutingConfigurationListResult } @@ -1792,15 +1959,13 @@ type ManagersClientGetResponse struct { // ManagersClientListBySubscriptionResponse contains the response from method ManagersClient.NewListBySubscriptionPager. type ManagersClientListBySubscriptionResponse struct { - // Result of the request to list NetworkManager. It contains a list of network managers and a URL link to get the next set - // of results. + // The response of a NetworkManager list operation. ManagerListResult } // ManagersClientListResponse contains the response from method ManagersClient.NewListPager. type ManagersClientListResponse struct { - // Result of the request to list NetworkManager. It contains a list of network managers and a URL link to get the next set - // of results. + // The response of a NetworkManager list operation. ManagerListResult } @@ -1829,13 +1994,13 @@ type NatGatewaysClientGetResponse struct { // NatGatewaysClientListAllResponse contains the response from method NatGatewaysClient.NewListAllPager. type NatGatewaysClientListAllResponse struct { - // Response for ListNatGateways API service call. + // The response of a NatGateway list operation. NatGatewayListResult } // NatGatewaysClientListResponse contains the response from method NatGatewaysClient.NewListPager. type NatGatewaysClientListResponse struct { - // Response for ListNatGateways API service call. + // The response of a NatGateway list operation. NatGatewayListResult } @@ -1871,8 +2036,7 @@ type NatRulesClientListByVPNGatewayResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set of - // results. + // Paged collection of Operation items OperationListResult } @@ -1984,8 +2148,7 @@ type PeerExpressRouteCircuitConnectionsClientGetResponse struct { // PeerExpressRouteCircuitConnectionsClientListResponse contains the response from method PeerExpressRouteCircuitConnectionsClient.NewListPager. type PeerExpressRouteCircuitConnectionsClientListResponse struct { - // Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs to - // a Private Peering for an ExpressRouteCircuit. + // The response of a PeerExpressRouteCircuitConnection list operation. PeerExpressRouteCircuitConnectionListResult } @@ -2031,13 +2194,13 @@ type PrivateEndpointsClientGetResponse struct { // PrivateEndpointsClientListBySubscriptionResponse contains the response from method PrivateEndpointsClient.NewListBySubscriptionPager. type PrivateEndpointsClientListBySubscriptionResponse struct { - // Response for the ListPrivateEndpoints API service call. + // The response of a PrivateEndpoint list operation. PrivateEndpointListResult } // PrivateEndpointsClientListResponse contains the response from method PrivateEndpointsClient.NewListPager. type PrivateEndpointsClientListResponse struct { - // Response for the ListPrivateEndpoints API service call. + // The response of a PrivateEndpoint list operation. PrivateEndpointListResult } @@ -2095,19 +2258,19 @@ type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse struct // PrivateLinkServicesClientListBySubscriptionResponse contains the response from method PrivateLinkServicesClient.NewListBySubscriptionPager. type PrivateLinkServicesClientListBySubscriptionResponse struct { - // Response for the ListPrivateLinkService API service call. + // The response of a PrivateLinkService list operation. PrivateLinkServiceListResult } // PrivateLinkServicesClientListPrivateEndpointConnectionsResponse contains the response from method PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager. type PrivateLinkServicesClientListPrivateEndpointConnectionsResponse struct { - // Response for the ListPrivateEndpointConnection API service call. + // The response of a PrivateEndpointConnection list operation. PrivateEndpointConnectionListResult } // PrivateLinkServicesClientListResponse contains the response from method PrivateLinkServicesClient.NewListPager. type PrivateLinkServicesClientListResponse struct { - // Response for the ListPrivateLinkService API service call. + // The response of a PrivateLinkService list operation. PrivateLinkServiceListResult } @@ -2136,13 +2299,13 @@ type ProfilesClientGetResponse struct { // ProfilesClientListAllResponse contains the response from method ProfilesClient.NewListAllPager. type ProfilesClientListAllResponse struct { - // Response for ListNetworkProfiles API service call. + // The response of a NetworkProfile list operation. ProfileListResult } // ProfilesClientListResponse contains the response from method ProfilesClient.NewListPager. type ProfilesClientListResponse struct { - // Response for ListNetworkProfiles API service call. + // The response of a NetworkProfile list operation. ProfileListResult } @@ -2195,37 +2358,37 @@ type PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse str // PublicIPAddressesClientListAllResponse contains the response from method PublicIPAddressesClient.NewListAllPager. type PublicIPAddressesClientListAllResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } // PublicIPAddressesClientListCloudServicePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager. type PublicIPAddressesClientListCloudServicePublicIPAddressesResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } // PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager. type PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } // PublicIPAddressesClientListResponse contains the response from method PublicIPAddressesClient.NewListPager. type PublicIPAddressesClientListResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } // PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager. type PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } // PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager. type PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse struct { - // Response for ListPublicIpAddresses API service call. + // The response of a PublicIPAddress list operation. PublicIPAddressListResult } @@ -2260,13 +2423,13 @@ type PublicIPPrefixesClientGetResponse struct { // PublicIPPrefixesClientListAllResponse contains the response from method PublicIPPrefixesClient.NewListAllPager. type PublicIPPrefixesClientListAllResponse struct { - // Response for ListPublicIpPrefixes API service call. + // The response of a PublicIPPrefix list operation. PublicIPPrefixListResult } // PublicIPPrefixesClientListResponse contains the response from method PublicIPPrefixesClient.NewListPager. type PublicIPPrefixesClientListResponse struct { - // Response for ListPublicIpPrefixes API service call. + // The response of a PublicIPPrefix list operation. PublicIPPrefixListResult } @@ -2295,7 +2458,7 @@ type ReachabilityAnalysisIntentsClientGetResponse struct { // ReachabilityAnalysisIntentsClientListResponse contains the response from method ReachabilityAnalysisIntentsClient.NewListPager. type ReachabilityAnalysisIntentsClientListResponse struct { - // A list of Reachability Analysis Intents. + // The response of a ReachabilityAnalysisIntent list operation. ReachabilityAnalysisIntentListResult } @@ -2318,13 +2481,13 @@ type ReachabilityAnalysisRunsClientGetResponse struct { // ReachabilityAnalysisRunsClientListResponse contains the response from method ReachabilityAnalysisRunsClient.NewListPager. type ReachabilityAnalysisRunsClientListResponse struct { - // A list of Reachability Analysis Run + // The response of a ReachabilityAnalysisRun list operation. ReachabilityAnalysisRunListResult } // ResourceNavigationLinksClientListResponse contains the response from method ResourceNavigationLinksClient.List. type ResourceNavigationLinksClientListResponse struct { - // Response for ResourceNavigationLinks_List operation. + // Paged collection of ResourceNavigationLink items ResourceNavigationLinksListResult } @@ -2370,13 +2533,13 @@ type RouteFiltersClientGetResponse struct { // RouteFiltersClientListByResourceGroupResponse contains the response from method RouteFiltersClient.NewListByResourceGroupPager. type RouteFiltersClientListByResourceGroupResponse struct { - // Response for the ListRouteFilters API service call. + // The response of a RouteFilter list operation. RouteFilterListResult } // RouteFiltersClientListResponse contains the response from method RouteFiltersClient.NewListPager. type RouteFiltersClientListResponse struct { - // Response for the ListRouteFilters API service call. + // The response of a RouteFilter list operation. RouteFilterListResult } @@ -2428,13 +2591,13 @@ type RouteTablesClientGetResponse struct { // RouteTablesClientListAllResponse contains the response from method RouteTablesClient.NewListAllPager. type RouteTablesClientListAllResponse struct { - // Response for the ListRouteTable API service call. + // The response of a RouteTable list operation. RouteTableListResult } // RouteTablesClientListResponse contains the response from method RouteTablesClient.NewListPager. type RouteTablesClientListResponse struct { - // Response for the ListRouteTable API service call. + // The response of a RouteTable list operation. RouteTableListResult } @@ -2463,7 +2626,7 @@ type RoutesClientGetResponse struct { // RoutesClientListResponse contains the response from method RoutesClient.NewListPager. type RoutesClientListResponse struct { - // Response for the ListRoute API service call. + // The response of a Route list operation. RouteListResult } @@ -2509,7 +2672,7 @@ type RoutingRuleCollectionsClientGetResponse struct { // RoutingRuleCollectionsClientListResponse contains the response from method RoutingRuleCollectionsClient.NewListPager. type RoutingRuleCollectionsClientListResponse struct { - // Routing configuration rule collection list result. + // The response of a RoutingRuleCollection list operation. RoutingRuleCollectionListResult } @@ -2532,7 +2695,7 @@ type RoutingRulesClientGetResponse struct { // RoutingRulesClientListResponse contains the response from method RoutingRulesClient.NewListPager. type RoutingRulesClientListResponse struct { - // Routing configuration rule list result. + // The response of a RoutingRule list operation. RoutingRuleListResult } @@ -2555,7 +2718,7 @@ type ScopeConnectionsClientGetResponse struct { // ScopeConnectionsClientListResponse contains the response from method ScopeConnectionsClient.NewListPager. type ScopeConnectionsClientListResponse struct { - // List of scope connections. + // The response of a ScopeConnection list operation. ScopeConnectionListResult } @@ -2578,7 +2741,7 @@ type SecurityAdminConfigurationsClientGetResponse struct { // SecurityAdminConfigurationsClientListResponse contains the response from method SecurityAdminConfigurationsClient.NewListPager. type SecurityAdminConfigurationsClientListResponse struct { - // A list of network manager security admin configurations + // The response of a SecurityAdminConfiguration list operation. SecurityAdminConfigurationListResult } @@ -2601,13 +2764,13 @@ type SecurityGroupsClientGetResponse struct { // SecurityGroupsClientListAllResponse contains the response from method SecurityGroupsClient.NewListAllPager. type SecurityGroupsClientListAllResponse struct { - // Response for ListNetworkSecurityGroups API service call. + // The response of a NetworkSecurityGroup list operation. SecurityGroupListResult } // SecurityGroupsClientListResponse contains the response from method SecurityGroupsClient.NewListPager. type SecurityGroupsClientListResponse struct { - // Response for ListNetworkSecurityGroups API service call. + // The response of a NetworkSecurityGroup list operation. SecurityGroupListResult } @@ -2636,13 +2799,13 @@ type SecurityPartnerProvidersClientGetResponse struct { // SecurityPartnerProvidersClientListByResourceGroupResponse contains the response from method SecurityPartnerProvidersClient.NewListByResourceGroupPager. type SecurityPartnerProvidersClientListByResourceGroupResponse struct { - // Response for ListSecurityPartnerProviders API service call. + // The response of a SecurityPartnerProvider list operation. SecurityPartnerProviderListResult } // SecurityPartnerProvidersClientListResponse contains the response from method SecurityPartnerProvidersClient.NewListPager. type SecurityPartnerProvidersClientListResponse struct { - // Response for ListSecurityPartnerProviders API service call. + // The response of a SecurityPartnerProvider list operation. SecurityPartnerProviderListResult } @@ -2671,20 +2834,18 @@ type SecurityPerimeterAccessRulesClientGetResponse struct { // SecurityPerimeterAccessRulesClientListResponse contains the response from method SecurityPerimeterAccessRulesClient.NewListPager. type SecurityPerimeterAccessRulesClientListResponse struct { - // Result of the request to list NSP access rules. Contains a list of NSP access rules and a URL link to get the next set - // of results. + // The response of a NspAccessRule list operation. NspAccessRuleListResult } // SecurityPerimeterAccessRulesClientReconcileResponse contains the response from method SecurityPerimeterAccessRulesClient.Reconcile. type SecurityPerimeterAccessRulesClientReconcileResponse struct { - // Anything Interface any } // SecurityPerimeterAssociableResourceTypesClientListResponse contains the response from method SecurityPerimeterAssociableResourceTypesClient.NewListPager. type SecurityPerimeterAssociableResourceTypesClientListResponse struct { - // Paged list of perimeter associable resources. + // Paged collection of PerimeterAssociableResource items PerimeterAssociableResourcesListResult } @@ -2707,14 +2868,12 @@ type SecurityPerimeterAssociationsClientGetResponse struct { // SecurityPerimeterAssociationsClientListResponse contains the response from method SecurityPerimeterAssociationsClient.NewListPager. type SecurityPerimeterAssociationsClientListResponse struct { - // Result of the request to list NSP resource associations. Contains a list of NSP resource associations and a URL link to - // get the next set of results. + // Paged collection of NspAssociation items NspAssociationsListResult } // SecurityPerimeterAssociationsClientReconcileResponse contains the response from method SecurityPerimeterAssociationsClient.Reconcile. type SecurityPerimeterAssociationsClientReconcileResponse struct { - // Anything Interface any } @@ -2731,8 +2890,7 @@ type SecurityPerimeterLinkReferencesClientGetResponse struct { // SecurityPerimeterLinkReferencesClientListResponse contains the response from method SecurityPerimeterLinkReferencesClient.NewListPager. type SecurityPerimeterLinkReferencesClientListResponse struct { - // Result of the request to list NSP linkReference resources. Contains a list of NSP linkReference resources and a URL link - // to get the next set of results. + // The response of a NspLinkReference list operation. NspLinkReferenceListResult } @@ -2755,8 +2913,7 @@ type SecurityPerimeterLinksClientGetResponse struct { // SecurityPerimeterLinksClientListResponse contains the response from method SecurityPerimeterLinksClient.NewListPager. type SecurityPerimeterLinksClientListResponse struct { - // Result of the request to list NSP link resources. Contains a list of NSP link resources and a URL link to get the next - // set of results. + // The response of a NspLink list operation. NspLinkListResult } @@ -2779,8 +2936,7 @@ type SecurityPerimeterLoggingConfigurationsClientGetResponse struct { // SecurityPerimeterLoggingConfigurationsClientListResponse contains the response from method SecurityPerimeterLoggingConfigurationsClient.NewListPager. type SecurityPerimeterLoggingConfigurationsClientListResponse struct { - // Result of the request to list NSP logging configuration. Contains a list of NSP logging configurations and a URL link to - // get the next set of results. + // The response of a NspLoggingConfiguration list operation. NspLoggingConfigurationListResult } @@ -2809,7 +2965,7 @@ type SecurityPerimeterProfilesClientGetResponse struct { // SecurityPerimeterProfilesClientListResponse contains the response from method SecurityPerimeterProfilesClient.NewListPager. type SecurityPerimeterProfilesClientListResponse struct { - // Result of the request to list NSP profiles. Contains a list of NSP profiles and a URL link to get the next set of results. + // The response of a NspProfile list operation. NspProfileListResult } @@ -2838,15 +2994,13 @@ type SecurityPerimetersClientGetResponse struct { // SecurityPerimetersClientListBySubscriptionResponse contains the response from method SecurityPerimetersClient.NewListBySubscriptionPager. type SecurityPerimetersClientListBySubscriptionResponse struct { - // Result of the request to list NetworkSecurityPerimeter. It contains a list of network security perimeters and a URL link - // to get the next set of results. + // The response of a NetworkSecurityPerimeter list operation. SecurityPerimeterListResult } // SecurityPerimetersClientListResponse contains the response from method SecurityPerimetersClient.NewListPager. type SecurityPerimetersClientListResponse struct { - // Result of the request to list NetworkSecurityPerimeter. It contains a list of network security perimeters and a URL link - // to get the next set of results. + // The response of a NetworkSecurityPerimeter list operation. SecurityPerimeterListResult } @@ -2875,7 +3029,7 @@ type SecurityRulesClientGetResponse struct { // SecurityRulesClientListResponse contains the response from method SecurityRulesClient.NewListPager. type SecurityRulesClientListResponse struct { - // Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. + // The response of a SecurityRule list operation. SecurityRuleListResult } @@ -2898,7 +3052,7 @@ type SecurityUserConfigurationsClientGetResponse struct { // SecurityUserConfigurationsClientListResponse contains the response from method SecurityUserConfigurationsClient.NewListPager. type SecurityUserConfigurationsClientListResponse struct { - // A list of network manager security user configurations + // The response of a SecurityUserConfiguration list operation. SecurityUserConfigurationListResult } @@ -2921,7 +3075,7 @@ type SecurityUserRuleCollectionsClientGetResponse struct { // SecurityUserRuleCollectionsClientListResponse contains the response from method SecurityUserRuleCollectionsClient.NewListPager. type SecurityUserRuleCollectionsClientListResponse struct { - // Security user configuration rule collection list result. + // The response of a SecurityUserRuleCollection list operation. SecurityUserRuleCollectionListResult } @@ -2944,13 +3098,13 @@ type SecurityUserRulesClientGetResponse struct { // SecurityUserRulesClientListResponse contains the response from method SecurityUserRulesClient.NewListPager. type SecurityUserRulesClientListResponse struct { - // security user rule list result. + // The response of a SecurityUserRule list operation. SecurityUserRuleListResult } // ServiceAssociationLinksClientListResponse contains the response from method ServiceAssociationLinksClient.List. type ServiceAssociationLinksClientListResponse struct { - // Response for ServiceAssociationLinks_List operation. + // Paged collection of ServiceAssociationLink items ServiceAssociationLinksListResult } @@ -2973,13 +3127,13 @@ type ServiceEndpointPoliciesClientGetResponse struct { // ServiceEndpointPoliciesClientListByResourceGroupResponse contains the response from method ServiceEndpointPoliciesClient.NewListByResourceGroupPager. type ServiceEndpointPoliciesClientListByResourceGroupResponse struct { - // Response for ListServiceEndpointPolicies API service call. + // The response of a ServiceEndpointPolicy list operation. ServiceEndpointPolicyListResult } // ServiceEndpointPoliciesClientListResponse contains the response from method ServiceEndpointPoliciesClient.NewListPager. type ServiceEndpointPoliciesClientListResponse struct { - // Response for ListServiceEndpointPolicies API service call. + // The response of a ServiceEndpointPolicy list operation. ServiceEndpointPolicyListResult } @@ -3008,8 +3162,7 @@ type ServiceEndpointPolicyDefinitionsClientGetResponse struct { // ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager. type ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse struct { - // Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition that - // belongs to a service endpoint policy. + // The response of a ServiceEndpointPolicyDefinition list operation. ServiceEndpointPolicyDefinitionListResult } @@ -3044,13 +3197,13 @@ type ServiceGatewaysClientGetServicesResponse struct { // ServiceGatewaysClientListAllResponse contains the response from method ServiceGatewaysClient.NewListAllPager. type ServiceGatewaysClientListAllResponse struct { - // Response for ListServiceGateways API service call. + // The response of a ServiceGateway list operation. ServiceGatewayListResult } // ServiceGatewaysClientListResponse contains the response from method ServiceGatewaysClient.NewListPager. type ServiceGatewaysClientListResponse struct { - // Response for ListServiceGateways API service call. + // The response of a ServiceGateway list operation. ServiceGatewayListResult } @@ -3124,10 +3277,22 @@ type StaticMembersClientGetResponse struct { // StaticMembersClientListResponse contains the response from method StaticMembersClient.NewListPager. type StaticMembersClientListResponse struct { - // Result of the request to list StaticMember. It contains a list of groups and a URL link to get the next set of results. + // The response of a StaticMember list operation. StaticMemberListResult } +// SubgroupsClientGetResponse contains the response from method SubgroupsClient.Get. +type SubgroupsClientGetResponse struct { + // A subgroup in an interconnect group. + Subgroup +} + +// SubgroupsClientListResponse contains the response from method SubgroupsClient.NewListPager. +type SubgroupsClientListResponse struct { + // The response of a Subgroup list operation. + SubgroupListResult +} + // SubnetsClientCreateOrUpdateResponse contains the response from method SubnetsClient.BeginCreateOrUpdate. type SubnetsClientCreateOrUpdateResponse struct { // Subnet in a virtual network resource. @@ -3147,7 +3312,7 @@ type SubnetsClientGetResponse struct { // SubnetsClientListResponse contains the response from method SubnetsClient.NewListPager. type SubnetsClientListResponse struct { - // Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + // The response of a Subnet list operation. SubnetListResult } @@ -3180,7 +3345,7 @@ type SubscriptionNetworkManagerConnectionsClientGetResponse struct { // SubscriptionNetworkManagerConnectionsClientListResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.NewListPager. type SubscriptionNetworkManagerConnectionsClientListResponse struct { - // List of network manager connections. + // The response of a NetworkManagerConnection list operation. ManagerConnectionListResult } @@ -3445,7 +3610,7 @@ type VerifierWorkspacesClientGetResponse struct { // VerifierWorkspacesClientListResponse contains the response from method VerifierWorkspacesClient.NewListPager. type VerifierWorkspacesClientListResponse struct { - // A list of Verifier Workspace + // The response of a VerifierWorkspace list operation. VerifierWorkspaceListResult } @@ -3497,13 +3662,15 @@ type VirtualApplianceConnectionsClientListResponse struct { // VirtualApplianceSKUsClientGetResponse contains the response from method VirtualApplianceSKUsClient.Get. type VirtualApplianceSKUsClientGetResponse struct { + // Available NetworkVirtualApplianceSkus + // // Definition of the NetworkVirtualApplianceSkus resource. VirtualApplianceSKU } // VirtualApplianceSKUsClientListResponse contains the response from method VirtualApplianceSKUsClient.NewListPager. type VirtualApplianceSKUsClientListResponse struct { - // Response for ListNetworkVirtualApplianceSkus API service call. + // The response of a NetworkVirtualApplianceSku list operation. VirtualApplianceSKUListResult } @@ -3526,7 +3693,7 @@ type VirtualApplianceSitesClientGetResponse struct { // VirtualApplianceSitesClientListResponse contains the response from method VirtualApplianceSitesClient.NewListPager. type VirtualApplianceSitesClientListResponse struct { - // Response for ListNetworkVirtualApplianceSites API service call. + // Paged collection of VirtualApplianceSite items VirtualApplianceSiteListResult } @@ -3554,13 +3721,13 @@ type VirtualAppliancesClientGetResponse struct { // VirtualAppliancesClientListByResourceGroupResponse contains the response from method VirtualAppliancesClient.NewListByResourceGroupPager. type VirtualAppliancesClientListByResourceGroupResponse struct { - // Response for ListNetworkVirtualAppliances API service call. + // The response of a NetworkVirtualAppliance list operation. VirtualApplianceListResult } // VirtualAppliancesClientListResponse contains the response from method VirtualAppliancesClient.NewListPager. type VirtualAppliancesClientListResponse struct { - // Response for ListNetworkVirtualAppliances API service call. + // The response of a NetworkVirtualAppliance list operation. VirtualApplianceListResult } @@ -3601,13 +3768,11 @@ type VirtualHubBgpConnectionClientGetResponse struct { // VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes. type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse struct { - // Map from virtual router instance to list of peer routes. Value map[string][]*PeerRoute } // VirtualHubBgpConnectionsClientListLearnedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.BeginListLearnedRoutes. type VirtualHubBgpConnectionsClientListLearnedRoutesResponse struct { - // Map from virtual router instance to list of peer routes. Value map[string][]*PeerRoute } @@ -3737,13 +3902,13 @@ type VirtualNetworkAppliancesClientGetResponse struct { // VirtualNetworkAppliancesClientListAllResponse contains the response from method VirtualNetworkAppliancesClient.NewListAllPager. type VirtualNetworkAppliancesClientListAllResponse struct { - // Response for the ListVirtualNetworkAppliance API service call. + // The response of a VirtualNetworkAppliance list operation. VirtualNetworkApplianceListResult } // VirtualNetworkAppliancesClientListResponse contains the response from method VirtualNetworkAppliancesClient.NewListPager. type VirtualNetworkAppliancesClientListResponse struct { - // Response for the ListVirtualNetworkAppliance API service call. + // The response of a VirtualNetworkAppliance list operation. VirtualNetworkApplianceListResult } @@ -3783,7 +3948,7 @@ type VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse struct { // VirtualNetworkGatewayConnectionsClientListResponse contains the response from method VirtualNetworkGatewayConnectionsClient.NewListPager. type VirtualNetworkGatewayConnectionsClientListResponse struct { - // Response for the ListVirtualNetworkGatewayConnections API service call. + // The response of a VirtualNetworkGatewayConnection list operation. VirtualNetworkGatewayConnectionListResult } @@ -3884,13 +4049,11 @@ type VirtualNetworkGatewaysClientGetBgpPeerStatusResponse struct { // VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails. type VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse struct { - // Gateway Failover All Test Details ExpressRouteFailoverTestDetailsArray []*ExpressRouteFailoverTestDetails } // VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails. type VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse struct { - // Gateway Failover Single Test Details Object ExpressRouteFailoverSingleTestDetailsArray []*ExpressRouteFailoverSingleTestDetails } @@ -3969,7 +4132,7 @@ type VirtualNetworkGatewaysClientListRadiusSecretsResponse struct { // VirtualNetworkGatewaysClientListResponse contains the response from method VirtualNetworkGatewaysClient.NewListPager. type VirtualNetworkGatewaysClientListResponse struct { - // Response for the ListVirtualNetworkGateways API service call. + // The response of a VirtualNetworkGateway list operation. VirtualNetworkGatewayListResult } @@ -4045,7 +4208,7 @@ type VirtualNetworkPeeringsClientGetResponse struct { // VirtualNetworkPeeringsClientListResponse contains the response from method VirtualNetworkPeeringsClient.NewListPager. type VirtualNetworkPeeringsClientListResponse struct { - // Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. + // The response of a VirtualNetworkPeering list operation. VirtualNetworkPeeringListResult } @@ -4068,13 +4231,13 @@ type VirtualNetworkTapsClientGetResponse struct { // VirtualNetworkTapsClientListAllResponse contains the response from method VirtualNetworkTapsClient.NewListAllPager. type VirtualNetworkTapsClientListAllResponse struct { - // Response for ListVirtualNetworkTap API service call. + // The response of a VirtualNetworkTap list operation. VirtualNetworkTapListResult } // VirtualNetworkTapsClientListByResourceGroupResponse contains the response from method VirtualNetworkTapsClient.NewListByResourceGroupPager. type VirtualNetworkTapsClientListByResourceGroupResponse struct { - // Response for ListVirtualNetworkTap API service call. + // The response of a VirtualNetworkTap list operation. VirtualNetworkTapListResult } @@ -4109,7 +4272,7 @@ type VirtualNetworksClientGetResponse struct { // VirtualNetworksClientListAllResponse contains the response from method VirtualNetworksClient.NewListAllPager. type VirtualNetworksClientListAllResponse struct { - // Response for the ListVirtualNetworks API service call. + // The response of a VirtualNetwork list operation. VirtualNetworkListResult } @@ -4121,7 +4284,7 @@ type VirtualNetworksClientListDdosProtectionStatusResponse struct { // VirtualNetworksClientListResponse contains the response from method VirtualNetworksClient.NewListPager. type VirtualNetworksClientListResponse struct { - // Response for the ListVirtualNetworks API service call. + // The response of a VirtualNetwork list operation. VirtualNetworkListResult } @@ -4156,7 +4319,7 @@ type VirtualRouterPeeringsClientGetResponse struct { // VirtualRouterPeeringsClientListResponse contains the response from method VirtualRouterPeeringsClient.NewListPager. type VirtualRouterPeeringsClientListResponse struct { - // Response for ListVirtualRouterPeerings API service call. + // The response of a VirtualRouterPeering list operation. VirtualRouterPeeringListResult } @@ -4179,13 +4342,13 @@ type VirtualRoutersClientGetResponse struct { // VirtualRoutersClientListByResourceGroupResponse contains the response from method VirtualRoutersClient.NewListByResourceGroupPager. type VirtualRoutersClientListByResourceGroupResponse struct { - // Response for ListVirtualRouters API service call. + // The response of a VirtualRouter list operation. VirtualRouterListResult } // VirtualRoutersClientListResponse contains the response from method VirtualRoutersClient.NewListPager. type VirtualRoutersClientListResponse struct { - // Response for ListVirtualRouters API service call. + // The response of a VirtualRouter list operation. VirtualRouterListResult } @@ -4352,15 +4515,13 @@ type WebApplicationFirewallPoliciesClientGetResponse struct { // WebApplicationFirewallPoliciesClientListAllResponse contains the response from method WebApplicationFirewallPoliciesClient.NewListAllPager. type WebApplicationFirewallPoliciesClientListAllResponse struct { - // Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy objects - // and a URL link to get the next set of results. + // Paged collection of WebApplicationFirewallPolicy items WebApplicationFirewallPolicyListResult } // WebApplicationFirewallPoliciesClientListResponse contains the response from method WebApplicationFirewallPoliciesClient.NewListPager. type WebApplicationFirewallPoliciesClientListResponse struct { - // Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy objects - // and a URL link to get the next set of results. + // Paged collection of WebApplicationFirewallPolicy items WebApplicationFirewallPolicyListResult } @@ -4372,6 +4533,6 @@ type WebCategoriesClientGetResponse struct { // WebCategoriesClientListBySubscriptionResponse contains the response from method WebCategoriesClient.NewListBySubscriptionPager. type WebCategoriesClientListBySubscriptionResponse struct { - // Response for ListAzureWebCategories API service call. + // List of Azure Web Categories for a given Subscription. AzureWebCategoryListResult } diff --git a/sdk/resourcemanager/network/armnetwork/responses_serde.go b/sdk/resourcemanager/network/armnetwork/responses_serde.go index dbcb4ca9c70c..8eba902554a7 100644 --- a/sdk/resourcemanager/network/armnetwork/responses_serde.go +++ b/sdk/resourcemanager/network/armnetwork/responses_serde.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -27,6 +26,46 @@ func (a *AdminRulesClientGetResponse) UnmarshalJSON(data []byte) error { return nil } +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse. +func (e *ExpressRouteCircuitsClientGetCircuitLinkFailoverAllTestsDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.ExpressRouteLinkFailoverAllTestsDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse. +func (e *ExpressRouteCircuitsClientGetCircuitLinkFailoverSingleTestDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.ExpressRouteLinkFailoverSingleTestDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse. +func (e *ExpressRouteCircuitsClientStartCircuitLinkFailoverTestResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse. +func (e *ExpressRouteCircuitsClientStopCircuitLinkFailoverTestResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse. +func (e *ExpressRouteGatewaysClientGetFailoverAllTestsDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.ExpressRouteFailoverTestDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse. +func (e *ExpressRouteGatewaysClientGetFailoverSingleTestDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.ExpressRouteFailoverSingleTestDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewaysClientStartSiteFailoverTestResponse. +func (e *ExpressRouteGatewaysClientStartSiteFailoverTestResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewaysClientStopSiteFailoverTestResponse. +func (e *ExpressRouteGatewaysClientStopSiteFailoverTestResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &e.Value) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStartPacketCaptureResponse. func (v *VPNConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { return json.Unmarshal(data, &v.Value) diff --git a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go index b17fd325b1cb..908a1a2a9144 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RouteFilterRulesClient contains the methods for the RouteFilterRules group. // Don't use this type directly, use NewRouteFilterRulesClient() instead. +// +// Generated from API version 2025-07-01 type RouteFilterRulesClient struct { internal *arm.Client subscriptionID string } // NewRouteFilterRulesClient creates a new instance of RouteFilterRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRouteFilterRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFilterRulesClient, error) { @@ -43,9 +43,7 @@ func NewRouteFilterRulesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a route in the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - ruleName - The name of the route filter rule. // - routeFilterRuleParameters - Parameters supplied to the create or update route filter rule operation. @@ -71,8 +69,6 @@ func (client *RouteFilterRulesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a route in the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteFilterRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteFilterRulesClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *RouteFilterRulesClient) createOrUpdate(ctx context.Context, resour // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, _ *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterRuleParameters); err != nil { return nil, err } @@ -129,11 +126,9 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. -// - ruleName - The name of the rule. +// - ruleName - The name of the route filter rule. // - options - RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete // method. func (client *RouteFilterRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*runtime.Poller[RouteFilterRulesClientDeleteResponse], error) { @@ -156,8 +151,6 @@ func (client *RouteFilterRulesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteFilterRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFilterRulesClient.BeginDelete" @@ -182,6 +175,10 @@ func (client *RouteFilterRulesClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, _ *RouteFilterRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +191,21 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. -// - ruleName - The name of the rule. +// - ruleName - The name of the route filter rule. // - options - RouteFilterRulesClientGetOptions contains the optional parameters for the RouteFilterRulesClient.Get method. func (client *RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientGetOptions) (RouteFilterRulesClientGetResponse, error) { var err error @@ -242,6 +232,10 @@ func (client *RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, _ *RouteFilterRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -254,17 +248,13 @@ func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -279,9 +269,7 @@ func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (Ro } // NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - options - RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.NewListByRouteFilterPager // method. @@ -311,6 +299,10 @@ func (client *RouteFilterRulesClient) NewListByRouteFilterPager(resourceGroupNam // listByRouteFilterCreateRequest creates the ListByRouteFilter request. func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, _ *RouteFilterRulesClientListByRouteFilterOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -319,17 +311,13 @@ func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context return nil, errors.New("parameter routeFilterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go index 730b8b638043..9807133140cd 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go @@ -1,127 +1,136 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterRuleDelete.json -func ExampleRouteFilterRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/RouteFilterRuleCreate.json +func ExampleRouteFilterRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteFilterRulesClient().BeginDelete(ctx, "rg1", "filterName", "ruleName", nil) + poller, err := clientFactory.NewRouteFilterRulesClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", "ruleName", armnetwork.RouteFilterRule{ + Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + Access: to.Ptr(armnetwork.AccessAllow), + Communities: []*string{ + to.Ptr("12076:5030"), + to.Ptr("12076:5040"), + }, + RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.RouteFilterRulesClientCreateOrUpdateResponse{ + // RouteFilterRule: armnetwork.RouteFilterRule{ + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterRuleGet.json -func ExampleRouteFilterRulesClient_Get() { +// Generated from example definition: 2025-07-01/RouteFilterRuleDelete.json +func ExampleRouteFilterRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRouteFilterRulesClient().Get(ctx, "rg1", "filterName", "filterName", nil) + poller, err := clientFactory.NewRouteFilterRulesClient().BeginDelete(ctx, "rg1", "filterName", "ruleName", 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 poll 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.RouteFilterRule = armnetwork.RouteFilterRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // } + // res = armnetwork.RouteFilterRulesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterRuleCreate.json -func ExampleRouteFilterRulesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/RouteFilterRuleGet.json +func ExampleRouteFilterRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteFilterRulesClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", "ruleName", armnetwork.RouteFilterRule{ - Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - Access: to.Ptr(armnetwork.AccessAllow), - Communities: []*string{ - to.Ptr("12076:5030"), - to.Ptr("12076:5040")}, - RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - }, - }, nil) + res, err := clientFactory.NewRouteFilterRulesClient().Get(ctx, "rg1", "filterName", "filterName", 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.RouteFilterRule = armnetwork.RouteFilterRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, + // res = armnetwork.RouteFilterRulesClientGetResponse{ + // RouteFilterRule: armnetwork.RouteFilterRule{ + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterRuleListByRouteFilter.json +// Generated from example definition: 2025-07-01/RouteFilterRuleListByRouteFilter.json func ExampleRouteFilterRulesClient_NewListByRouteFilterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -136,21 +145,25 @@ func ExampleRouteFilterRulesClient_NewListByRouteFilterPager() { _ = 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.RouteFilterRuleListResult = armnetwork.RouteFilterRuleListResult{ - // Value: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, + // page = armnetwork.RouteFilterRulesClientListByRouteFilterResponse{ + // RouteFilterRuleListResult: armnetwork.RouteFilterRuleListResult{ + // Value: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/routefilters_client.go b/sdk/resourcemanager/network/armnetwork/routefilters_client.go index ee4ef95e9ccd..10a653846df4 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilters_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RouteFiltersClient contains the methods for the RouteFilters group. // Don't use this type directly, use NewRouteFiltersClient() instead. +// +// Generated from API version 2025-07-01 type RouteFiltersClient struct { internal *arm.Client subscriptionID string } // NewRouteFiltersClient creates a new instance of RouteFiltersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRouteFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFiltersClient, error) { @@ -43,9 +43,7 @@ func NewRouteFiltersClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates a route filter in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - routeFilterParameters - Parameters supplied to the create or update route filter operation. // - options - RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *RouteFiltersClient) BeginCreateOrUpdate(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteFiltersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *RouteFiltersClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a route filter in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteFiltersClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *RouteFiltersClient) createOrUpdate(ctx context.Context, resourceGr // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, _ *RouteFiltersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, errors.New("parameter routeFilterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterParameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete // method. @@ -150,8 +144,6 @@ func (client *RouteFiltersClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginDelete" @@ -176,6 +168,10 @@ func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceG // deleteCreateRequest creates the Delete request. func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, _ *RouteFiltersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +180,19 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, errors.New("parameter routeFilterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. func (client *RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (RouteFiltersClientGetResponse, error) { @@ -231,6 +220,10 @@ func (client *RouteFiltersClient) Get(ctx context.Context, resourceGroupName str // getCreateRequest creates the Get request. func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +232,6 @@ func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resource return nil, errors.New("parameter routeFilterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +240,8 @@ func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,8 +256,6 @@ func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteF } // NewListPager - Gets all route filters in a subscription. -// -// Generated from API version 2025-05-01 // - options - RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.NewListPager method. func (client *RouteFiltersClient) NewListPager(options *RouteFiltersClientListOptions) *runtime.Pager[RouteFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListResponse]{ @@ -305,8 +292,8 @@ func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, _ *Rout return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -321,9 +308,7 @@ func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (Route } // NewListByResourceGroupPager - Gets all route filters in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager // method. func (client *RouteFiltersClient) NewListByResourceGroupPager(resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) *runtime.Pager[RouteFiltersClientListByResourceGroupResponse] { @@ -352,21 +337,21 @@ func (client *RouteFiltersClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *RouteFiltersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -382,9 +367,7 @@ func (client *RouteFiltersClient) listByResourceGroupHandleResponse(resp *http.R // UpdateTags - Updates tags of a route filter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeFilterName - The name of the route filter. // - parameters - Parameters supplied to update route filter tags. // - options - RouteFiltersClientUpdateTagsOptions contains the optional parameters for the RouteFiltersClient.UpdateTags method. @@ -413,6 +396,10 @@ func (client *RouteFiltersClient) UpdateTags(ctx context.Context, resourceGroupN // updateTagsCreateRequest creates the UpdateTags request. func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject, _ *RouteFiltersClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -421,18 +408,15 @@ func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, r return nil, errors.New("parameter routeFilterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go index b1684bdc90ab..15a9edd674ba 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go @@ -1,225 +1,185 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterDelete.json -func ExampleRouteFiltersClient_BeginDelete() { +// Generated from example definition: 2025-07-01/RouteFilterCreate.json +func ExampleRouteFiltersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteFiltersClient().BeginDelete(ctx, "rg1", "filterName", nil) + poller, err := clientFactory.NewRouteFiltersClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", armnetwork.RouteFilter{ + Location: to.Ptr("West US"), + Properties: &armnetwork.RouteFilterPropertiesFormat{ + Rules: []*armnetwork.RouteFilterRule{ + { + Name: to.Ptr("ruleName"), + Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + Access: to.Ptr(armnetwork.AccessAllow), + Communities: []*string{ + to.Ptr("12076:5030"), + to.Ptr("12076:5040"), + }, + RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), + }, + }, + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterGet.json -func ExampleRouteFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteFiltersClient().Get(ctx, "rg1", "filterName", &armnetwork.RouteFiltersClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, + // res = armnetwork.RouteFiltersClientCreateOrUpdateResponse{ + // RouteFilter: armnetwork.RouteFilter{ + // Name: to.Ptr("filterName"), + // Type: to.Ptr("Microsoft.Network/routeFilters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.RouteFilterPropertiesFormat{ + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterCreate.json -func ExampleRouteFiltersClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/RouteFilterDelete.json +func ExampleRouteFiltersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteFiltersClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", armnetwork.RouteFilter{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.RouteFilterPropertiesFormat{ - Rules: []*armnetwork.RouteFilterRule{ - { - Name: to.Ptr("ruleName"), - Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - Access: to.Ptr(armnetwork.AccessAllow), - Communities: []*string{ - to.Ptr("12076:5030"), - to.Ptr("12076:5040")}, - RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - }, - }}, - }, - }, nil) + poller, err := clientFactory.NewRouteFiltersClient().BeginDelete(ctx, "rg1", "filterName", 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) + log.Fatalf("failed to poll 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.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // } + // res = armnetwork.RouteFiltersClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterUpdateTags.json -func ExampleRouteFiltersClient_UpdateTags() { +// Generated from example definition: 2025-07-01/RouteFilterGet.json +func ExampleRouteFiltersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRouteFiltersClient().UpdateTags(ctx, "rg1", "filterName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) + res, err := clientFactory.NewRouteFiltersClient().Get(ctx, "rg1", "filterName", 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.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030")}, + // res = armnetwork.RouteFiltersClientGetResponse{ + // RouteFilter: armnetwork.RouteFilter{ + // Name: to.Ptr("filterName"), + // Type: to.Ptr("Microsoft.Network/routeFilters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.RouteFilterPropertiesFormat{ + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterListByResourceGroup.json -func ExampleRouteFiltersClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/RouteFilterList.json +func ExampleRouteFiltersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRouteFiltersClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewRouteFiltersClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -230,53 +190,58 @@ func ExampleRouteFiltersClient_NewListByResourceGroupPager() { _ = 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.RouteFilterListResult = armnetwork.RouteFilterListResult{ - // Value: []*armnetwork.RouteFilter{ - // { - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, + // page = armnetwork.RouteFiltersClientListResponse{ + // RouteFilterListResult: armnetwork.RouteFilterListResult{ + // Value: []*armnetwork.RouteFilter{ + // { + // Name: to.Ptr("filterName"), + // Type: to.Ptr("Microsoft.Network/routeFilters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.RouteFilterPropertiesFormat{ + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // }}, - // } + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteFilterList.json -func ExampleRouteFiltersClient_NewListPager() { +// Generated from example definition: 2025-07-01/RouteFilterListByResourceGroup.json +func ExampleRouteFiltersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRouteFiltersClient().NewListPager(nil) + pager := clientFactory.NewRouteFiltersClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -287,37 +252,98 @@ func ExampleRouteFiltersClient_NewListPager() { _ = 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.RouteFilterListResult = armnetwork.RouteFilterListResult{ - // Value: []*armnetwork.RouteFilter{ - // { - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, + // page = armnetwork.RouteFiltersClientListByResourceGroupResponse{ + // RouteFilterListResult: armnetwork.RouteFilterListResult{ + // Value: []*armnetwork.RouteFilter{ + // { + // Name: to.Ptr("filterName"), + // Type: to.Ptr("Microsoft.Network/routeFilters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.RouteFilterPropertiesFormat{ + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // to.Ptr("12076:5040"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), // }, - // }}, + // }, + // }, // }, - // }}, - // } + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/RouteFilterUpdateTags.json +func ExampleRouteFiltersClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRouteFiltersClient().UpdateTags(ctx, "rg1", "filterName", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, 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 = armnetwork.RouteFiltersClientUpdateTagsResponse{ + // RouteFilter: armnetwork.RouteFilter{ + // Name: to.Ptr("filterName"), + // Type: to.Ptr("Microsoft.Network/routeFilters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.RouteFilterPropertiesFormat{ + // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteFilterRule{ + // { + // Name: to.Ptr("ruleName"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), + // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.AccessAllow), + // Communities: []*string{ + // to.Ptr("12076:5030"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), + // }, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/routemaps_client.go b/sdk/resourcemanager/network/armnetwork/routemaps_client.go index 6c005983aeac..0485e0e1771f 100644 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/routemaps_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RouteMapsClient contains the methods for the RouteMaps group. // Don't use this type directly, use NewRouteMapsClient() instead. +// +// Generated from API version 2025-07-01 type RouteMapsClient struct { internal *arm.Client subscriptionID string } // NewRouteMapsClient creates a new instance of RouteMapsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRouteMapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteMapsClient, error) { @@ -43,11 +43,9 @@ func NewRouteMapsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RouteMap's resource group. -// - virtualHubName - The name of the VirtualHub containing the RouteMap. -// - routeMapName - The name of the RouteMap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - routeMapName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - routeMapParameters - Parameters supplied to create or update a RouteMap. // - options - RouteMapsClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteMapsClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *RouteMapsClient) BeginCreateOrUpdate(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteMapsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *RouteMapsClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteMapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteMapsClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeMapParameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RouteMap's resource group. -// - virtualHubName - The name of the VirtualHub containing the RouteMap. -// - routeMapName - The name of the RouteMap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - routeMapName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - RouteMapsClientBeginDeleteOptions contains the optional parameters for the RouteMapsClient.BeginDelete method. func (client *RouteMapsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*runtime.Poller[RouteMapsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -142,8 +136,7 @@ func (client *RouteMapsClient) BeginDelete(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteMapsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,8 +148,6 @@ func (client *RouteMapsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteMapsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteMapsClient.BeginDelete" @@ -202,19 +193,16 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RouteMap's resource group. -// - virtualHubName - The name of the VirtualHub containing the RouteMap. -// - routeMapName - The name of the RouteMap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. +// - routeMapName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - RouteMapsClientGetOptions contains the optional parameters for the RouteMapsClient.Get method. func (client *RouteMapsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientGetOptions) (RouteMapsClientGetResponse, error) { var err error @@ -262,8 +250,8 @@ func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -278,10 +266,8 @@ func (client *RouteMapsClient) getHandleResponse(resp *http.Response) (RouteMaps } // NewListPager - Retrieves the details of all RouteMaps. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RouteMap's resource group'. -// - virtualHubName - The name of the VirtualHub containing the RouteMap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the VirtualHub. // - options - RouteMapsClientListOptions contains the optional parameters for the RouteMapsClient.NewListPager method. func (client *RouteMapsClient) NewListPager(resourceGroupName string, virtualHubName string, options *RouteMapsClientListOptions) *runtime.Pager[RouteMapsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RouteMapsClientListResponse]{ @@ -326,8 +312,8 @@ func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go index 429a1213da74..fa5130862c1a 100644 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go @@ -1,96 +1,33 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteMapGet.json -func ExampleRouteMapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteMapsClient().Get(ctx, "rg1", "virtualHub1", "routeMap1", 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.RouteMap = armnetwork.RouteMap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\"e203e953-7ba7-4302-a246-aa2ec03f6edf\""), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, - // AssociatedOutboundConnections: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteMapRule{ - // { - // Name: to.Ptr("rule1"), - // Actions: []*armnetwork.Action{ - // { - // Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), - // Parameters: []*armnetwork.Parameter{ - // { - // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ - // }, - // Community: []*string{ - // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteMapPut.json +// Generated from example definition: 2025-07-01/RouteMapPut.json func ExampleRouteMapsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRouteMapsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "routeMap1", armnetwork.RouteMap{ Properties: &armnetwork.RouteMapProperties{ AssociatedInboundConnections: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"), + }, AssociatedOutboundConnections: []*string{}, Rules: []*armnetwork.RouteMapRule{ { @@ -101,21 +38,27 @@ func ExampleRouteMapsClient_BeginCreateOrUpdate() { Parameters: []*armnetwork.Parameter{ { AsPath: []*string{ - to.Ptr("22334")}, + to.Ptr("22334"), + }, Community: []*string{}, RoutePrefix: []*string{}, - }}, - }}, + }, + }, + }, + }, MatchCriteria: []*armnetwork.Criterion{ { AsPath: []*string{}, Community: []*string{}, MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), RoutePrefix: []*string{ - to.Ptr("10.0.0.0/8")}, - }}, + to.Ptr("10.0.0.0/8"), + }, + }, + }, NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - }}, + }, + }, }, }, nil) if err != nil { @@ -123,19 +66,21 @@ func ExampleRouteMapsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.RouteMap = armnetwork.RouteMap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, + // res = armnetwork.RouteMapsClientCreateOrUpdateResponse{ + // RouteMap: armnetwork.RouteMap{ + // Name: to.Ptr("routeMap1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), + // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // Properties: &armnetwork.RouteMapProperties{ + // AssociatedInboundConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"), + // }, // AssociatedOutboundConnections: []*string{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), @@ -148,37 +93,44 @@ func ExampleRouteMapsClient_BeginCreateOrUpdate() { // Parameters: []*armnetwork.Parameter{ // { // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ + // to.Ptr("22334"), + // }, + // Community: []*string{ + // }, + // RoutePrefix: []*string{ + // }, // }, - // Community: []*string{ - // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, + // }, + // }, + // }, + // MatchCriteria: []*armnetwork.Criterion{ + // { + // AsPath: []*string{ + // }, + // Community: []*string{ + // }, + // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), + // RoutePrefix: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, + // }, + // }, + // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), // }, - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteMapDelete.json +// Generated from example definition: 2025-07-01/RouteMapDelete.json func ExampleRouteMapsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -186,20 +138,95 @@ func ExampleRouteMapsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.RouteMapsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteMapList.json +// Generated from example definition: 2025-07-01/RouteMapGet.json +func ExampleRouteMapsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRouteMapsClient().Get(ctx, "rg1", "virtualHub1", "routeMap1", 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 = armnetwork.RouteMapsClientGetResponse{ + // RouteMap: armnetwork.RouteMap{ + // Name: to.Ptr("routeMap1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), + // Etag: to.Ptr("W/\"e203e953-7ba7-4302-a246-aa2ec03f6edf\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // Properties: &armnetwork.RouteMapProperties{ + // AssociatedInboundConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"), + // }, + // AssociatedOutboundConnections: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Rules: []*armnetwork.RouteMapRule{ + // { + // Name: to.Ptr("rule1"), + // Actions: []*armnetwork.Action{ + // { + // Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), + // Parameters: []*armnetwork.Parameter{ + // { + // AsPath: []*string{ + // to.Ptr("22334"), + // }, + // Community: []*string{ + // }, + // RoutePrefix: []*string{ + // }, + // }, + // }, + // }, + // }, + // MatchCriteria: []*armnetwork.Criterion{ + // { + // AsPath: []*string{ + // }, + // Community: []*string{ + // }, + // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), + // RoutePrefix: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, + // }, + // }, + // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/RouteMapList.json func ExampleRouteMapsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -214,16 +241,18 @@ func ExampleRouteMapsClient_NewListPager() { _ = 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.ListRouteMapsResult = armnetwork.ListRouteMapsResult{ - // Value: []*armnetwork.RouteMap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, + // page = armnetwork.RouteMapsClientListResponse{ + // ListRouteMapsResult: armnetwork.ListRouteMapsResult{ + // Value: []*armnetwork.RouteMap{ + // { + // Name: to.Ptr("routeMap1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), + // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // Properties: &armnetwork.RouteMapProperties{ + // AssociatedInboundConnections: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"), + // }, // AssociatedOutboundConnections: []*string{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), @@ -236,27 +265,35 @@ func ExampleRouteMapsClient_NewListPager() { // Parameters: []*armnetwork.Parameter{ // { // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ - // }, - // Community: []*string{ + // to.Ptr("22334"), + // }, + // Community: []*string{ + // }, + // RoutePrefix: []*string{ + // }, // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, + // }, + // }, + // }, + // MatchCriteria: []*armnetwork.Criterion{ + // { + // AsPath: []*string{ + // }, + // Community: []*string{ + // }, + // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), + // RoutePrefix: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, + // }, + // }, + // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), // }, - // }}, - // } + // }, + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/routes_client.go b/sdk/resourcemanager/network/armnetwork/routes_client.go index 42e89a3ab852..c4a38b426ddc 100644 --- a/sdk/resourcemanager/network/armnetwork/routes_client.go +++ b/sdk/resourcemanager/network/armnetwork/routes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RoutesClient contains the methods for the Routes group. // Don't use this type directly, use NewRoutesClient() instead. +// +// Generated from API version 2025-07-01 type RoutesClient struct { internal *arm.Client subscriptionID string } // NewRoutesClient creates a new instance of RoutesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutesClient, error) { @@ -43,9 +43,7 @@ func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a route in the specified route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - routeName - The name of the route. // - routeParameters - Parameters supplied to the create or update route operation. @@ -58,8 +56,7 @@ func (client *RoutesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *RoutesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a route in the specified route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *RoutesClient) createOrUpdate(ctx context.Context, resourceGroupNam // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, _ *RoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, errors.New("parameter routeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeParameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - routeName - The name of the route. // - options - RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. @@ -142,8 +136,7 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,8 +148,6 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginDelete" @@ -181,6 +172,10 @@ func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupNa // deleteCreateRequest creates the Delete request. func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, _ *RoutesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -193,26 +188,19 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter routeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - routeName - The name of the route. // - options - RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. @@ -241,6 +229,10 @@ func (client *RoutesClient) Get(ctx context.Context, resourceGroupName string, r // getCreateRequest creates the Get request. func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, _ *RoutesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -253,17 +245,13 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, errors.New("parameter routeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -278,9 +266,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient } // NewListPager - Gets all routes in a route table. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - options - RoutesClientListOptions contains the optional parameters for the RoutesClient.NewListPager method. func (client *RoutesClient) NewListPager(resourceGroupName string, routeTableName string, options *RoutesClientListOptions) *runtime.Pager[RoutesClientListResponse] { @@ -309,6 +295,10 @@ func (client *RoutesClient) NewListPager(resourceGroupName string, routeTableNam // listCreateRequest creates the List request. func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, _ *RoutesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -317,17 +307,13 @@ func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter routeTableName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go index 8850eb536dd3..73a3bfa809cf 100644 --- a/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go @@ -1,116 +1,176 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableRouteDelete.json -func ExampleRoutesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/RouteTableRouteCreate.json +func ExampleRoutesClient_BeginCreateOrUpdate_createRoute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutesClient().BeginDelete(ctx, "rg1", "testrt", "route1", nil) + poller, err := clientFactory.NewRoutesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", "route1", armnetwork.Route{ + Properties: &armnetwork.RoutePropertiesFormat{ + AddressPrefix: to.Ptr("10.0.3.0/24"), + NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.RoutesClientCreateOrUpdateResponse{ + // Route: armnetwork.Route{ + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableRouteGet.json -func ExampleRoutesClient_Get() { +// Generated from example definition: 2025-07-01/RouteTableRouteCreateEcmp.json +func ExampleRoutesClient_BeginCreateOrUpdate_createEcmpRoute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutesClient().Get(ctx, "rg1", "testrt", "route1", nil) + poller, err := clientFactory.NewRoutesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", "ecmp-route", armnetwork.Route{ + Properties: &armnetwork.RoutePropertiesFormat{ + AddressPrefix: to.Ptr("10.1.0.0/16"), + NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualApplianceEcmp), + NextHop: &armnetwork.RouteNextHopEcmp{ + NextHopIPAddresses: []*string{ + to.Ptr("10.0.0.4"), + to.Ptr("10.0.0.5"), + to.Ptr("10.0.0.6"), + }, + }, + }, + }, 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 poll 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.Route = armnetwork.Route{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.RoutesClientCreateOrUpdateResponse{ + // Route: armnetwork.Route{ + // Name: to.Ptr("ecmp-route"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/ecmp-route"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.1.0.0/16"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualApplianceEcmp), + // NextHop: &armnetwork.RouteNextHopEcmp{ + // NextHopIPAddresses: []*string{ + // to.Ptr("10.0.0.4"), + // to.Ptr("10.0.0.5"), + // to.Ptr("10.0.0.6"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableRouteCreate.json -func ExampleRoutesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/RouteTableRouteDelete.json +func ExampleRoutesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", "route1", armnetwork.Route{ - Properties: &armnetwork.RoutePropertiesFormat{ - AddressPrefix: to.Ptr("10.0.3.0/24"), - NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - }, - }, nil) + poller, err := clientFactory.NewRoutesClient().BeginDelete(ctx, "rg1", "testrt", "route1", 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) + log.Fatalf("failed to poll 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.Route = armnetwork.Route{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.RoutesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/RouteTableRouteGet.json +func ExampleRoutesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRoutesClient().Get(ctx, "rg1", "testrt", "route1", 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 = armnetwork.RoutesClientGetResponse{ + // Route: armnetwork.Route{ + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableRouteList.json +// Generated from example definition: 2025-07-01/RouteTableRouteList.json func ExampleRoutesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -125,26 +185,29 @@ func ExampleRoutesClient_NewListPager() { _ = 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.RouteListResult = armnetwork.RouteListResult{ - // Value: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.RoutesClientListResponse{ + // RouteListResult: armnetwork.RouteListResult{ + // Value: []*armnetwork.Route{ + // { + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route2"), - // Name: to.Ptr("route2"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.2.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("route2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route2"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.2.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/routetable_live_test.go b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go index 2c77b7a12138..0e76d1cc9459 100644 --- a/sdk/resourcemanager/network/armnetwork/routetable_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client.go b/sdk/resourcemanager/network/armnetwork/routetables_client.go index 84df74d1dfc4..ab220d8ce5db 100644 --- a/sdk/resourcemanager/network/armnetwork/routetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/routetables_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RouteTablesClient contains the methods for the RouteTables group. // Don't use this type directly, use NewRouteTablesClient() instead. +// +// Generated from API version 2025-07-01 type RouteTablesClient struct { internal *arm.Client subscriptionID string } // NewRouteTablesClient creates a new instance of RouteTablesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteTablesClient, error) { @@ -43,9 +43,7 @@ func NewRouteTablesClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create or updates a route table in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to the create or update route table operation. // - options - RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *RouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteTablesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *RouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create or updates a route table in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *RouteTablesClient) createOrUpdate(ctx context.Context, resourceGro // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, _ *RouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context return nil, errors.New("parameter routeTableName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes the specified route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - options - RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*runtime.Poller[RouteTablesClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteTablesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes the specified route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginDelete" @@ -175,6 +166,10 @@ func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGr // deleteCreateRequest creates the Delete request. func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, _ *RouteTablesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -183,26 +178,19 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour return nil, errors.New("parameter routeTableName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified route table. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - options - RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. func (client *RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (RouteTablesClientGetResponse, error) { @@ -230,6 +218,10 @@ func (client *RouteTablesClient) Get(ctx context.Context, resourceGroupName stri // getCreateRequest creates the Get request. func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,10 +230,6 @@ func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter routeTableName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -250,8 +238,8 @@ func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -266,9 +254,7 @@ func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTa } // NewListPager - Gets all route tables in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.NewListPager method. func (client *RouteTablesClient) NewListPager(resourceGroupName string, options *RouteTablesClientListOptions) *runtime.Pager[RouteTablesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListResponse]{ @@ -296,21 +282,21 @@ func (client *RouteTablesClient) NewListPager(resourceGroupName string, options // listCreateRequest creates the List request. func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *RouteTablesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -325,8 +311,6 @@ func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteT } // NewListAllPager - Gets all route tables in a subscription. -// -// Generated from API version 2025-05-01 // - options - RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.NewListAllPager method. func (client *RouteTablesClient) NewListAllPager(options *RouteTablesClientListAllOptions) *runtime.Pager[RouteTablesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListAllResponse]{ @@ -363,8 +347,8 @@ func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, _ *Ro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -380,9 +364,7 @@ func (client *RouteTablesClient) listAllHandleResponse(resp *http.Response) (Rou // UpdateTags - Updates a route table tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to update route table tags. // - options - RouteTablesClientUpdateTagsOptions contains the optional parameters for the RouteTablesClient.UpdateTags method. @@ -411,6 +393,10 @@ func (client *RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupNa // updateTagsCreateRequest creates the UpdateTags request. func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject, _ *RouteTablesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -419,18 +405,15 @@ func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, re return nil, errors.New("parameter routeTableName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go index a4f276c88703..aaeac720f01e 100644 --- a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go @@ -1,127 +1,185 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableDelete.json -func ExampleRouteTablesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/RouteTableCreate.json +func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteTablesClient().BeginDelete(ctx, "rg1", "testrt", nil) + poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ + Location: to.Ptr("westus"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.RouteTablesClientCreateOrUpdateResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableGet.json -func ExampleRouteTablesClient_Get() { +// Generated from example definition: 2025-07-01/RouteTableCreateWithDisablePeeringRoute.json +func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithDisablePeeringRoute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRouteTablesClient().Get(ctx, "rg1", "testrt", &armnetwork.RouteTablesClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ + Location: to.Ptr("westus"), + Properties: &armnetwork.RouteTablePropertiesFormat{ + DisableBgpRoutePropagation: to.Ptr(true), + DisablePeeringRoute: to.Ptr(armnetwork.DisablePeeringRouteAll), + }, + }, 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 poll 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.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, + // res = armnetwork.RouteTablesClientCreateOrUpdateResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // DisableBgpRoutePropagation: to.Ptr(true), + // DisablePeeringRoute: to.Ptr(armnetwork.DisablePeeringRouteAll), + // Routes: []*armnetwork.Route{ + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableCreate.json -func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTable() { +// Generated from example definition: 2025-07-01/RouteTableCreateWithEcmpRoute.json +func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithEcmpRoute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ + poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt-ecmp", armnetwork.RouteTable{ Location: to.Ptr("westus"), + Properties: &armnetwork.RouteTablePropertiesFormat{ + DisableBgpRoutePropagation: to.Ptr(false), + Routes: []*armnetwork.Route{ + { + Name: to.Ptr("ecmp-route"), + Properties: &armnetwork.RoutePropertiesFormat{ + AddressPrefix: to.Ptr("10.1.0.0/16"), + NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualApplianceEcmp), + NextHop: &armnetwork.RouteNextHopEcmp{ + NextHopIPAddresses: []*string{ + to.Ptr("10.0.0.4"), + to.Ptr("10.0.0.5"), + to.Ptr("10.0.0.6"), + }, + }, + }, + }, + }, + }, }, 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) + log.Fatalf("failed to poll 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.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ + // res = armnetwork.RouteTablesClientCreateOrUpdateResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt-ecmp"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt-ecmp"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("ecmp-route"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt-ecmp/routes/ecmp-route"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.1.0.0/16"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualApplianceEcmp), + // NextHop: &armnetwork.RouteNextHopEcmp{ + // NextHopIPAddresses: []*string{ + // to.Ptr("10.0.0.4"), + // to.Ptr("10.0.0.5"), + // to.Ptr("10.0.0.6"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableCreateWithRoute.json +// Generated from example definition: 2025-07-01/RouteTableCreateWithRoute.json func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithRoute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -136,7 +194,8 @@ func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithRoute() { AddressPrefix: to.Ptr("10.0.3.0/24"), NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), }, - }}, + }, + }, }, }, nil) if err != nil { @@ -144,81 +203,113 @@ func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithRoute() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.RouteTablesClientCreateOrUpdateResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableUpdateTags.json -func ExampleRouteTablesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/RouteTableDelete.json +func ExampleRouteTablesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRouteTablesClient().UpdateTags(ctx, "rg1", "testrt", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewRouteTablesClient().BeginDelete(ctx, "rg1", "testrt", 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 poll 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.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ + // res = armnetwork.RouteTablesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/RouteTableGet.json +func ExampleRouteTablesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRouteTablesClient().Get(ctx, "rg1", "testrt", 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 = armnetwork.RouteTablesClientGetResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableList.json +// Generated from example definition: 2025-07-01/RouteTableList.json func ExampleRouteTablesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -233,52 +324,56 @@ func ExampleRouteTablesClient_NewListPager() { _ = 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.RouteTableListResult = armnetwork.RouteTableListResult{ - // Value: []*armnetwork.RouteTable{ - // { - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.RouteTablesClientListResponse{ + // RouteTableListResult: armnetwork.RouteTableListResult{ + // Value: []*armnetwork.RouteTable{ + // { + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // }, - // }, - // { - // Name: to.Ptr("testrt2"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("testrt2"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // DisableBgpRoutePropagation: to.Ptr(true), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RouteTableListAll.json +// Generated from example definition: 2025-07-01/RouteTableListAll.json func ExampleRouteTablesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -293,38 +388,84 @@ func ExampleRouteTablesClient_NewListAllPager() { _ = 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.RouteTableListResult = armnetwork.RouteTableListResult{ - // Value: []*armnetwork.RouteTable{ - // { - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.RouteTablesClientListAllResponse{ + // RouteTableListResult: armnetwork.RouteTableListResult{ + // Value: []*armnetwork.RouteTable{ + // { + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("route1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), + // Properties: &armnetwork.RoutePropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.3.0/24"), + // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // }, - // }, - // { - // Name: to.Ptr("testrt3"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/routeTables/testrt3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ + // { + // Name: to.Ptr("testrt3"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/routeTables/testrt3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // }, // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/RouteTableUpdateTags.json +func ExampleRouteTablesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRouteTablesClient().UpdateTags(ctx, "rg1", "testrt", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.RouteTablesClientUpdateTagsResponse{ + // RouteTable: armnetwork.RouteTable{ + // Name: to.Ptr("testrt"), + // Type: to.Ptr("Microsoft.Network/routeTables"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.RouteTablePropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.Route{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/routingintent_client.go b/sdk/resourcemanager/network/armnetwork/routingintent_client.go index 32219c173c81..40c4aa0c629c 100644 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingintent_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // RoutingIntentClient contains the methods for the RoutingIntent group. // Don't use this type directly, use NewRoutingIntentClient() instead. +// +// Generated from API version 2025-07-01 type RoutingIntentClient struct { internal *arm.Client subscriptionID string } // NewRoutingIntentClient creates a new instance of RoutingIntentClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRoutingIntentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutingIntentClient, error) { @@ -43,11 +43,10 @@ func NewRoutingIntentClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RoutingIntent. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routingIntentName - The name of the per VirtualHub singleton Routing Intent resource. +// - routingIntentName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - routingIntentParameters - Parameters supplied to create or update RoutingIntent. // - options - RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate // method. @@ -58,8 +57,7 @@ func (client *RoutingIntentClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingIntentClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +69,6 @@ func (client *RoutingIntentClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutingIntentClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RoutingIntentClient.BeginCreateOrUpdate" @@ -118,9 +114,10 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingIntentParameters); err != nil { return nil, err } @@ -129,11 +126,10 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RoutingIntent. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routingIntentName - The name of the RoutingIntent. +// - routingIntentName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete // method. func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*runtime.Poller[RoutingIntentClientDeleteResponse], error) { @@ -143,8 +139,7 @@ func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingIntentClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +151,6 @@ func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutingIntentClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingIntentClient.BeginDelete" @@ -203,19 +196,17 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the RoutingIntent. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - routingIntentName - The name of the RoutingIntent. +// - routingIntentName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - RoutingIntentClientGetOptions contains the optional parameters for the RoutingIntentClient.Get method. func (client *RoutingIntentClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (RoutingIntentClientGetResponse, error) { var err error @@ -263,8 +254,8 @@ func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -279,9 +270,7 @@ func (client *RoutingIntentClient) getHandleResponse(resp *http.Response) (Routi } // NewListPager - Retrieves the details of all RoutingIntent child resources of the VirtualHub. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.NewListPager method. func (client *RoutingIntentClient) NewListPager(resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) *runtime.Pager[RoutingIntentClientListResponse] { @@ -327,8 +316,8 @@ func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go index 21e7a3a85ca4..6a1ac9b7a1b6 100644 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RoutingIntentPut.json +// Generated from example definition: 2025-07-01/RoutingIntentPut.json func ExampleRoutingIntentClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,15 +29,18 @@ func ExampleRoutingIntentClient_BeginCreateOrUpdate() { { Name: to.Ptr("InternetTraffic"), Destinations: []*string{ - to.Ptr("Internet")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + to.Ptr("Internet"), + }, + NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), }, { Name: to.Ptr("PrivateTrafficPolicy"), Destinations: []*string{ - to.Ptr("PrivateTraffic")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - }}, + to.Ptr("PrivateTraffic"), + }, + NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + }, + }, }, }, nil) if err != nil { @@ -48,106 +48,121 @@ func ExampleRoutingIntentClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.RoutingIntent = armnetwork.RoutingIntent{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // res = armnetwork.RoutingIntentClientCreateOrUpdateResponse{ + // RoutingIntent: armnetwork.RoutingIntent{ + // Name: to.Ptr("Intent1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), + // Properties: &armnetwork.RoutingIntentProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingPolicies: []*armnetwork.RoutingPolicy{ + // { + // Name: to.Ptr("InternetTraffic"), + // Destinations: []*string{ + // to.Ptr("Internet"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), // }, // { // Name: to.Ptr("PrivateTrafficPolicy"), // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, + // to.Ptr("PrivateTraffic"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RoutingIntentGet.json -func ExampleRoutingIntentClient_Get() { +// Generated from example definition: 2025-07-01/RoutingIntentDelete.json +func ExampleRoutingIntentClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingIntentClient().Get(ctx, "rg1", "virtualHub1", "Intent1", nil) + poller, err := clientFactory.NewRoutingIntentClient().BeginDelete(ctx, "rg1", "virtualHub1", "Intent1", 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 poll 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.RoutingIntent = armnetwork.RoutingIntent{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }, - // { - // Name: to.Ptr("PrivateTrafficPolicy"), - // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, - // }, - // } + // res = armnetwork.RoutingIntentClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RoutingIntentDelete.json -func ExampleRoutingIntentClient_BeginDelete() { +// Generated from example definition: 2025-07-01/RoutingIntentGet.json +func ExampleRoutingIntentClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutingIntentClient().BeginDelete(ctx, "rg1", "virtualHub1", "Intent1", nil) + res, err := clientFactory.NewRoutingIntentClient().Get(ctx, "rg1", "virtualHub1", "Intent1", 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) - } + // 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 = armnetwork.RoutingIntentClientGetResponse{ + // RoutingIntent: armnetwork.RoutingIntent{ + // Name: to.Ptr("Intent1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), + // Properties: &armnetwork.RoutingIntentProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingPolicies: []*armnetwork.RoutingPolicy{ + // { + // Name: to.Ptr("InternetTraffic"), + // Destinations: []*string{ + // to.Ptr("Internet"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // }, + // { + // Name: to.Ptr("PrivateTrafficPolicy"), + // Destinations: []*string{ + // to.Ptr("PrivateTraffic"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/RoutingIntentList.json +// Generated from example definition: 2025-07-01/RoutingIntentList.json func ExampleRoutingIntentClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -162,30 +177,36 @@ func ExampleRoutingIntentClient_NewListPager() { _ = 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.ListRoutingIntentResult = armnetwork.ListRoutingIntentResult{ - // Value: []*armnetwork.RoutingIntent{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // page = armnetwork.RoutingIntentClientListResponse{ + // ListRoutingIntentResult: armnetwork.ListRoutingIntentResult{ + // Value: []*armnetwork.RoutingIntent{ + // { + // Name: to.Ptr("Intent1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), + // Properties: &armnetwork.RoutingIntentProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingPolicies: []*armnetwork.RoutingPolicy{ + // { + // Name: to.Ptr("InternetTraffic"), + // Destinations: []*string{ + // to.Ptr("Internet"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), // }, // { // Name: to.Ptr("PrivateTrafficPolicy"), // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, + // to.Ptr("PrivateTraffic"), + // }, + // NextHop: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + // }, // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go index baecf8caab58..3300271cc8d7 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // RoutingRuleCollectionsClient contains the methods for the RoutingRuleCollections group. // Don't use this type directly, use NewRoutingRuleCollectionsClient() instead. +// +// Generated from API version 2025-07-01 type RoutingRuleCollectionsClient struct { internal *arm.Client subscriptionID string } // NewRoutingRuleCollectionsClient creates a new instance of RoutingRuleCollectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRoutingRuleCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutingRuleCollectionsClient, error) { @@ -44,8 +44,6 @@ func NewRoutingRuleCollectionsClient(subscriptionID string, credential azcore.To // CreateOrUpdate - Creates or updates a routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -103,9 +101,10 @@ func (client *RoutingRuleCollectionsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleCollection); err != nil { return nil, err } @@ -123,8 +122,6 @@ func (client *RoutingRuleCollectionsClient) createOrUpdateHandleResponse(resp *h // BeginDelete - Deletes an routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -138,8 +135,7 @@ func (client *RoutingRuleCollectionsClient) BeginDelete(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingRuleCollectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -151,8 +147,6 @@ func (client *RoutingRuleCollectionsClient) BeginDelete(ctx context.Context, res // Delete - Deletes an routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutingRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *RoutingRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingRuleCollectionsClient.BeginDelete" @@ -202,19 +196,16 @@ func (client *RoutingRuleCollectionsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a network manager routing configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -271,8 +262,8 @@ func (client *RoutingRuleCollectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -287,8 +278,6 @@ func (client *RoutingRuleCollectionsClient) getHandleResponse(resp *http.Respons } // NewListPager - Lists all the rule collections in a routing configuration, in a paginated format. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -347,8 +336,8 @@ func (client *RoutingRuleCollectionsClient) listCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go index 4887d4146175..5bd0c356d55a 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go @@ -1,184 +1,196 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleCollectionList.json -func ExampleRoutingRuleCollectionsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleCollectionPut.json +func ExampleRoutingRuleCollectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRoutingRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", &armnetwork.RoutingRuleCollectionsClientListOptions{Top: nil, - SkipToken: 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.RoutingRuleCollectionListResult = armnetwork.RoutingRuleCollectionListResult{ - // Value: []*armnetwork.RoutingRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewRoutingRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", armnetwork.RoutingRuleCollection{ + Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ + Description: to.Ptr("A sample policy"), + AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ + { + NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + }, + }, + }, + }, 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 = armnetwork.RoutingRuleCollectionsClientCreateOrUpdateResponse{ + // RoutingRuleCollection: armnetwork.RoutingRuleCollection{ + // Name: to.Ptr("myTestRoutingConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleCollectionGet.json -func ExampleRoutingRuleCollectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleCollectionDelete.json +func ExampleRoutingRuleCollectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", nil) + poller, err := clientFactory.NewRoutingRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", 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 poll 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.RoutingRuleCollection = armnetwork.RoutingRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.RoutingRuleCollectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleCollectionPut.json -func ExampleRoutingRuleCollectionsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleCollectionGet.json +func ExampleRoutingRuleCollectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", armnetwork.RoutingRuleCollection{ - Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - { - NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - }}, - }, - }, nil) + res, err := clientFactory.NewRoutingRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", 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.RoutingRuleCollection = armnetwork.RoutingRuleCollection{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.RoutingRuleCollectionsClientGetResponse{ + // RoutingRuleCollection: armnetwork.RoutingRuleCollection{ + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleCollectionDelete.json -func ExampleRoutingRuleCollectionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleCollectionList.json +func ExampleRoutingRuleCollectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutingRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", &armnetwork.RoutingRuleCollectionsClientBeginDeleteOptions{Force: 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) + pager := clientFactory.NewRoutingRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", 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 = armnetwork.RoutingRuleCollectionsClientListResponse{ + // RoutingRuleCollectionListResult: armnetwork.RoutingRuleCollectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections?api-version=2023-03-01-preview&$skipToken=10"), + // Value: []*armnetwork.RoutingRuleCollection{ + // { + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/routingrules_client.go b/sdk/resourcemanager/network/armnetwork/routingrules_client.go index 82be16fcf323..4d06c8dcccec 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // RoutingRulesClient contains the methods for the RoutingRules group. // Don't use this type directly, use NewRoutingRulesClient() instead. +// +// Generated from API version 2025-07-01 type RoutingRulesClient struct { internal *arm.Client subscriptionID string } // NewRoutingRulesClient creates a new instance of RoutingRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewRoutingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutingRulesClient, error) { @@ -44,8 +44,6 @@ func NewRoutingRulesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates an routing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -108,9 +106,10 @@ func (client *RoutingRulesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingRule); err != nil { return nil, err } @@ -128,8 +127,6 @@ func (client *RoutingRulesClient) createOrUpdateHandleResponse(resp *http.Respon // BeginDelete - Deletes a routing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -144,8 +141,7 @@ func (client *RoutingRulesClient) BeginDelete(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,8 +153,6 @@ func (client *RoutingRulesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a routing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *RoutingRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *RoutingRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingRulesClient.BeginDelete" @@ -212,19 +206,16 @@ func (client *RoutingRulesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a network manager routing configuration routing rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -285,8 +276,8 @@ func (client *RoutingRulesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -301,8 +292,6 @@ func (client *RoutingRulesClient) getHandleResponse(resp *http.Response) (Routin } // NewListPager - List all network manager routing configuration routing rules. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -365,8 +354,8 @@ func (client *RoutingRulesClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go index 1f8d7bf3f91a..c33247f8df8f 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go @@ -1,142 +1,97 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleList.json -func ExampleRoutingRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutingRulesClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", &armnetwork.RoutingRulesClientListOptions{Top: nil, - SkipToken: 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.RoutingRuleListResult = armnetwork.RoutingRuleListResult{ - // Value: []*armnetwork.RoutingRule{ - // { - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), - // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleGet.json -func ExampleRoutingRulesClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRulePut.json +func ExampleRoutingRulesClient_CreateOrUpdate_createAnRoutingRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleRoutingRule", nil) + res, err := clientFactory.NewRoutingRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "SampleRoutingRule", armnetwork.RoutingRule{ + Properties: &armnetwork.RoutingRulePropertiesFormat{ + Description: to.Ptr("This is Sample Routing Rule"), + Destination: &armnetwork.RoutingRuleRouteDestination{ + Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), + DestinationAddress: to.Ptr("10.0.0.0/16"), + }, + NextHop: &armnetwork.RoutingRuleNextHop{ + NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + }, + }, + }, 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.RoutingRule = armnetwork.RoutingRule{ - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is a routing rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), + // res = armnetwork.RoutingRulesClientCreateOrUpdateResponse{ + // RoutingRule: armnetwork.RoutingRule{ + // Name: to.Ptr("SampleRoutingRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), + // Properties: &armnetwork.RoutingRulePropertiesFormat{ + // Description: to.Ptr("This is Sample Routing Rule"), + // Destination: &armnetwork.RoutingRuleRouteDestination{ + // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), + // DestinationAddress: to.Ptr("10.0.0.0/16"), + // }, + // NextHop: &armnetwork.RoutingRuleNextHop{ + // NextHopAddress: to.Ptr(""), + // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRulePut.json -func ExampleRoutingRulesClient_CreateOrUpdate_createADefaultRoutingRule() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRulePutEcmp.json +func ExampleRoutingRulesClient_CreateOrUpdate_createAnEcmpRoutingRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "SampleRoutingRule", armnetwork.RoutingRule{ + res, err := clientFactory.NewRoutingRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "SampleEcmpRoutingRule", armnetwork.RoutingRule{ Properties: &armnetwork.RoutingRulePropertiesFormat{ - Description: to.Ptr("This is Sample Routing Rule"), + Description: to.Ptr("This is a sample ECMP routing rule with multiple next hop IP addresses"), Destination: &armnetwork.RoutingRuleRouteDestination{ Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), DestinationAddress: to.Ptr("10.0.0.0/16"), }, NextHop: &armnetwork.RoutingRuleNextHop{ - NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualAppliance), + NextHopAddress: to.Ptr("10.1.0.4,10.1.0.5,10.1.0.6"), }, }, }, nil) @@ -146,108 +101,165 @@ func ExampleRoutingRulesClient_CreateOrUpdate_createADefaultRoutingRule() { // 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.RoutingRule = armnetwork.RoutingRule{ - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is Sample Routing Rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), + // res = armnetwork.RoutingRulesClientCreateOrUpdateResponse{ + // RoutingRule: armnetwork.RoutingRule{ + // Name: to.Ptr("SampleEcmpRoutingRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleEcmpRoutingRule"), + // Properties: &armnetwork.RoutingRulePropertiesFormat{ + // Description: to.Ptr("This is a sample ECMP routing rule with multiple next hop IP addresses"), + // Destination: &armnetwork.RoutingRuleRouteDestination{ + // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), + // DestinationAddress: to.Ptr("10.0.0.0/16"), + // }, + // NextHop: &armnetwork.RoutingRuleNextHop{ + // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualAppliance), + // NextHopAddress: to.Ptr("10.1.0.4,10.1.0.5,10.1.0.6"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRulePut.json -func ExampleRoutingRulesClient_CreateOrUpdate_createAnRoutingRule() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleDelete.json +func ExampleRoutingRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutingRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "SampleRoutingRule", armnetwork.RoutingRule{ - Properties: &armnetwork.RoutingRulePropertiesFormat{ - Description: to.Ptr("This is Sample Routing Rule"), - Destination: &armnetwork.RoutingRuleRouteDestination{ - Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - DestinationAddress: to.Ptr("10.0.0.0/16"), - }, - NextHop: &armnetwork.RoutingRuleNextHop{ - NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - }, - }, - }, nil) + poller, err := clientFactory.NewRoutingRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "sampleRule", &armnetwork.RoutingRulesClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.RoutingRule = armnetwork.RoutingRule{ - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is Sample Routing Rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), - // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.RoutingRulesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerRoutingRuleDelete.json -func ExampleRoutingRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleGet.json +func ExampleRoutingRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutingRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "sampleRule", &armnetwork.RoutingRulesClientBeginDeleteOptions{Force: to.Ptr(false)}) + res, err := clientFactory.NewRoutingRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleRoutingRule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + // 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 = armnetwork.RoutingRulesClientGetResponse{ + // RoutingRule: armnetwork.RoutingRule{ + // Name: to.Ptr("SampleRoutingRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), + // Properties: &armnetwork.RoutingRulePropertiesFormat{ + // Description: to.Ptr("This is a routing rule"), + // Destination: &armnetwork.RoutingRuleRouteDestination{ + // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), + // DestinationAddress: to.Ptr("10.0.0.0/16"), + // }, + // NextHop: &armnetwork.RoutingRuleNextHop{ + // NextHopAddress: to.Ptr(""), + // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkManagerRoutingRuleList.json +func ExampleRoutingRulesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewRoutingRulesClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", 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 = armnetwork.RoutingRulesClientListResponse{ + // RoutingRuleListResult: armnetwork.RoutingRuleListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkManagers/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.RoutingRule{ + // { + // Name: to.Ptr("SampleRoutingRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), + // Properties: &armnetwork.RoutingRulePropertiesFormat{ + // Description: to.Ptr("This is Sample Admin Rule"), + // Destination: &armnetwork.RoutingRuleRouteDestination{ + // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), + // DestinationAddress: to.Ptr("10.0.0.0/16"), + // }, + // NextHop: &armnetwork.RoutingRuleNextHop{ + // NextHopAddress: to.Ptr(""), + // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go index 61c44db3c8de..54948de17251 100644 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ScopeConnectionsClient contains the methods for the ScopeConnections group. // Don't use this type directly, use NewScopeConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type ScopeConnectionsClient struct { internal *arm.Client subscriptionID string } // NewScopeConnectionsClient creates a new instance of ScopeConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewScopeConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScopeConnectionsClient, error) { @@ -44,9 +44,7 @@ func NewScopeConnectionsClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or updates scope connection from Network Manager // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. // - parameters - Scope connection to be created/updated. @@ -98,9 +96,10 @@ func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,9 +117,7 @@ func (client *ScopeConnectionsClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Delete the pending scope connection created by this network manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. // - options - ScopeConnectionsClientDeleteOptions contains the optional parameters for the ScopeConnectionsClient.Delete method. @@ -169,17 +166,14 @@ func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get specified scope connection created by this Network Manager. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. // - options - ScopeConnectionsClientGetOptions contains the optional parameters for the ScopeConnectionsClient.Get method. @@ -229,8 +223,8 @@ func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -245,9 +239,7 @@ func (client *ScopeConnectionsClient) getHandleResponse(resp *http.Response) (Sc } // NewListPager - List all scope connections created by this network manager. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager // method. @@ -300,8 +292,8 @@ func (client *ScopeConnectionsClient) listCreateRequest(ctx context.Context, res if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go index d0302dae1c2e..98efafc1556a 100644 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerScopeConnectionPut.json +// Generated from example definition: 2025-07-01/NetworkManagerScopeConnectionPut.json func ExampleScopeConnectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,97 +36,104 @@ func ExampleScopeConnectionsClient_CreateOrUpdate() { // 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.ScopeConnection = armnetwork.ScopeConnection{ - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.ScopeConnectionsClientCreateOrUpdateResponse{ + // ScopeConnection: armnetwork.ScopeConnection{ + // Name: to.Ptr("TestScopeConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), + // Properties: &armnetwork.ScopeConnectionProperties{ + // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerScopeConnectionGet.json -func ExampleScopeConnectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerScopeConnectionDelete.json +func ExampleScopeConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScopeConnectionsClient().Get(ctx, "rg1", "testNetworkManager", "TestScopeConnection", nil) + res, err := clientFactory.NewScopeConnectionsClient().Delete(ctx, "rg1", "testNetworkManager", "TestScopeConnection", 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.ScopeConnection = armnetwork.ScopeConnection{ - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.ScopeConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerScopeConnectionDelete.json -func ExampleScopeConnectionsClient_Delete() { +// Generated from example definition: 2025-07-01/NetworkManagerScopeConnectionGet.json +func ExampleScopeConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewScopeConnectionsClient().Delete(ctx, "rg1", "testNetworkManager", "TestScopeConnection", nil) + res, err := clientFactory.NewScopeConnectionsClient().Get(ctx, "rg1", "testNetworkManager", "TestScopeConnection", 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 = armnetwork.ScopeConnectionsClientGetResponse{ + // ScopeConnection: armnetwork.ScopeConnection{ + // Name: to.Ptr("TestScopeConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), + // Properties: &armnetwork.ScopeConnectionProperties{ + // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerScopeConnectionList.json +// Generated from example definition: 2025-07-01/NetworkManagerScopeConnectionList.json func ExampleScopeConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewScopeConnectionsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.ScopeConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewScopeConnectionsClient().NewListPager("rg1", "testNetworkManager", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -140,27 +144,31 @@ func ExampleScopeConnectionsClient_NewListPager() { _ = 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.ScopeConnectionListResult = armnetwork.ScopeConnectionListResult{ - // Value: []*armnetwork.ScopeConnection{ - // { - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.ScopeConnectionsClientListResponse{ + // ScopeConnectionListResult: armnetwork.ScopeConnectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections?api-version=2021-02-01-preview&$skipToken=10"), + // Value: []*armnetwork.ScopeConnection{ + // { + // Name: to.Ptr("TestScopeConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), + // Properties: &armnetwork.ScopeConnectionProperties{ + // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go index 8afd74db097a..7b31c6074770 100644 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // SecurityAdminConfigurationsClient contains the methods for the SecurityAdminConfigurations group. // Don't use this type directly, use NewSecurityAdminConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityAdminConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewSecurityAdminConfigurationsClient creates a new instance of SecurityAdminConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityAdminConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityAdminConfigurationsClient, error) { @@ -44,9 +44,7 @@ func NewSecurityAdminConfigurationsClient(subscriptionID string, credential azco // CreateOrUpdate - Creates or updates a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - securityAdminConfiguration - The security admin configuration to create or update @@ -98,9 +96,10 @@ func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityAdminConfiguration); err != nil { return nil, err } @@ -118,9 +117,7 @@ func (client *SecurityAdminConfigurationsClient) createOrUpdateHandleResponse(re // BeginDelete - Deletes a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - options - SecurityAdminConfigurationsClientBeginDeleteOptions contains the optional parameters for the SecurityAdminConfigurationsClient.BeginDelete @@ -132,8 +129,7 @@ func (client *SecurityAdminConfigurationsClient) BeginDelete(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityAdminConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -145,8 +141,6 @@ func (client *SecurityAdminConfigurationsClient) BeginDelete(ctx context.Context // Delete - Deletes a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityAdminConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityAdminConfigurationsClient.BeginDelete" @@ -192,20 +186,17 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. // - options - SecurityAdminConfigurationsClientGetOptions contains the optional parameters for the SecurityAdminConfigurationsClient.Get @@ -256,8 +247,8 @@ func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -272,9 +263,7 @@ func (client *SecurityAdminConfigurationsClient) getHandleResponse(resp *http.Re } // NewListPager - Lists all the network manager security admin configurations in a network manager, in a paginated format. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.NewListPager // method. @@ -327,8 +316,8 @@ func (client *SecurityAdminConfigurationsClient) listCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go index ae21782cb80e..0669dfc337f2 100644 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go @@ -1,216 +1,231 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityAdminConfigurationList.json -func ExampleSecurityAdminConfigurationsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityAdminConfigurationPut.json +func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createNetworkManagerSecurityAdminConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityAdminConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.SecurityAdminConfigurationsClientListOptions{Top: nil, - SkipToken: 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.SecurityAdminConfigurationListResult = armnetwork.SecurityAdminConfigurationListResult{ - // Value: []*armnetwork.SecurityAdminConfiguration{ - // { - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewSecurityAdminConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityAdminConfiguration{ + Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + Description: to.Ptr("A sample policy"), + ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ + to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone), + }, + }, + }, 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 = armnetwork.SecurityAdminConfigurationsClientCreateOrUpdateResponse{ + // SecurityAdminConfiguration: armnetwork.SecurityAdminConfiguration{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ + // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityAdminConfigurationGet.json -func ExampleSecurityAdminConfigurationsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityAdminConfigurationPut_ManualAggregation.json +func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createManualModeSecurityAdminConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityAdminConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", nil) + res, err := clientFactory.NewSecurityAdminConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityAdminConfiguration{ + Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + Description: to.Ptr("A configuration which will update any network groups ip addresses at commit times."), + NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), + }, + }, 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.SecurityAdminConfiguration = armnetwork.SecurityAdminConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, + // res = armnetwork.SecurityAdminConfigurationsClientCreateOrUpdateResponse{ + // SecurityAdminConfiguration: armnetwork.SecurityAdminConfiguration{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityAdminConfigurationPut_ManualAggregation.json -func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createManualModeSecurityAdminConfiguration() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityAdminConfigurationDelete.json +func ExampleSecurityAdminConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityAdminConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityAdminConfiguration{ - Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - Description: to.Ptr("A configuration which will update any network groups ip addresses at commit times."), - NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), - }, - }, nil) + poller, err := clientFactory.NewSecurityAdminConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityAdminConfigurationsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.SecurityAdminConfiguration = armnetwork.SecurityAdminConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.SecurityAdminConfigurationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityAdminConfigurationPut.json -func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createNetworkManagerSecurityAdminConfiguration() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityAdminConfigurationGet.json +func ExampleSecurityAdminConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityAdminConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityAdminConfiguration{ - Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - Description: to.Ptr("A sample policy"), - ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - }, - }, nil) + res, err := clientFactory.NewSecurityAdminConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", 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.SecurityAdminConfiguration = armnetwork.SecurityAdminConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, + // res = armnetwork.SecurityAdminConfigurationsClientGetResponse{ + // SecurityAdminConfiguration: armnetwork.SecurityAdminConfiguration{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ + // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityAdminConfigurationDelete.json -func ExampleSecurityAdminConfigurationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityAdminConfigurationList.json +func ExampleSecurityAdminConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityAdminConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityAdminConfigurationsClientBeginDeleteOptions{Force: to.Ptr(false)}) - 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) + pager := clientFactory.NewSecurityAdminConfigurationsClient().NewListPager("rg1", "testNetworkManager", 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 = armnetwork.SecurityAdminConfigurationsClientListResponse{ + // SecurityAdminConfigurationListResult: armnetwork.SecurityAdminConfigurationListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityAdminConfiguration{ + // { + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ + // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go index 6a3290210df3..e02a0309018d 100644 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// SecurityGroupsClient contains the methods for the NetworkSecurityGroups group. +// SecurityGroupsClient contains the methods for the SecurityGroups group. // Don't use this type directly, use NewSecurityGroupsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityGroupsClient struct { internal *arm.Client subscriptionID string } // NewSecurityGroupsClient creates a new instance of SecurityGroupsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityGroupsClient, error) { @@ -43,9 +43,7 @@ func NewSecurityGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a network security group in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to the create or update network security group operation. // - options - SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *SecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *SecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a network security group in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *SecurityGroupsClient) createOrUpdate(ctx context.Context, resource // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, _ *SecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *SecurityGroupsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *SecurityGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, _ *SecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. func (client *SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (SecurityGroupsClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *SecurityGroupsClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,9 +255,7 @@ func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (Secu } // NewListPager - Gets all network security groups in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.NewListPager method. func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, options *SecurityGroupsClientListOptions) *runtime.Pager[SecurityGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SecurityGroupsClientListResponse]{ @@ -297,21 +283,21 @@ func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, optio // listCreateRequest creates the List request. func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *SecurityGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -326,8 +312,6 @@ func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (Sec } // NewListAllPager - Gets all network security groups in a subscription. -// -// Generated from API version 2025-05-01 // - options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager // method. func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { @@ -365,8 +349,8 @@ func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -382,9 +366,7 @@ func (client *SecurityGroupsClient) listAllHandleResponse(resp *http.Response) ( // UpdateTags - Updates a network security group tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to update network security group tags. // - options - SecurityGroupsClientUpdateTagsOptions contains the optional parameters for the SecurityGroupsClient.UpdateTags @@ -414,6 +396,10 @@ func (client *SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGrou // updateTagsCreateRequest creates the UpdateTags request. func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject, _ *SecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -422,18 +408,15 @@ func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go index bdc8a20aec6b..18f4dafaabd5 100644 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go @@ -1,191 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupDelete.json -func ExampleSecurityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginDelete(ctx, "rg1", "testnsg", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupGet.json -func ExampleSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityGroupsClient().Get(ctx, "rg1", "testnsg", &armnetwork.SecurityGroupsClientGetOptions{Expand: 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.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupCreate.json +// Generated from example definition: 2025-07-01/NetworkSecurityGroupCreate.json func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -197,130 +31,133 @@ func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroup( } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // res = armnetwork.SecurityGroupsClientCreateOrUpdateResponse{ + // SecurityGroup: armnetwork.SecurityGroup{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // FlushConnection: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // FlushConnection: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupCreateWithRule.json +// Generated from example definition: 2025-07-01/NetworkSecurityGroupCreateWithRule.json func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroupWithRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -340,7 +177,8 @@ func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroupW SourcePortRange: to.Ptr("*"), Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), }, - }}, + }, + }, }, }, nil) if err != nil { @@ -348,284 +186,323 @@ func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroupW } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // res = armnetwork.SecurityGroupsClientCreateOrUpdateResponse{ + // SecurityGroup: armnetwork.SecurityGroup{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("rule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("80"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](130), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupUpdateTags.json -func ExampleSecurityGroupsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupDelete.json +func ExampleSecurityGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityGroupsClient().UpdateTags(ctx, "rg1", "testnsg", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewSecurityGroupsClient().BeginDelete(ctx, "rg1", "testnsg", 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 poll 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.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // res = armnetwork.SecurityGroupsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NetworkSecurityGroupGet.json +func ExampleSecurityGroupsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSecurityGroupsClient().Get(ctx, "rg1", "testnsg", 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 = armnetwork.SecurityGroupsClientGetResponse{ + // SecurityGroup: armnetwork.SecurityGroup{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("rule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("80"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](130), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupListAll.json -func ExampleSecurityGroupsClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupList.json +func ExampleSecurityGroupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityGroupsClient().NewListAllPager(nil) + pager := clientFactory.NewSecurityGroupsClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -636,240 +513,245 @@ func ExampleSecurityGroupsClient_NewListAllPager() { _ = 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.SecurityGroupListResult = armnetwork.SecurityGroupListResult{ - // Value: []*armnetwork.SecurityGroup{ - // { - // Name: to.Ptr("nsg1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // page = armnetwork.SecurityGroupsClientListResponse{ + // SecurityGroupListResult: armnetwork.SecurityGroupListResult{ + // Value: []*armnetwork.SecurityGroup{ + // { + // Name: to.Ptr("nsg1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, - // }, - // { - // Name: to.Ptr("nsg3"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("nsg3"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupList.json -func ExampleSecurityGroupsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupListAll.json +func ExampleSecurityGroupsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityGroupsClient().NewListPager("rg1", nil) + pager := clientFactory.NewSecurityGroupsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -880,224 +762,369 @@ func ExampleSecurityGroupsClient_NewListPager() { _ = 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.SecurityGroupListResult = armnetwork.SecurityGroupListResult{ - // Value: []*armnetwork.SecurityGroup{ - // { - // Name: to.Ptr("nsg1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // page = armnetwork.SecurityGroupsClientListAllResponse{ + // SecurityGroupListResult: armnetwork.SecurityGroupListResult{ + // Value: []*armnetwork.SecurityGroup{ + // { + // Name: to.Ptr("nsg1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, - // }, - // { - // Name: to.Ptr("nsg3"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("nsg3"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/NetworkSecurityGroupUpdateTags.json +func ExampleSecurityGroupsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSecurityGroupsClient().UpdateTags(ctx, "rg1", "testnsg", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.SecurityGroupsClientUpdateTagsResponse{ + // SecurityGroup: armnetwork.SecurityGroup{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.SecurityGroupPropertiesFormat{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("AllowAzureLoadBalancerInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from azure load balancer"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("DenyAllInBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all inbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("AllowVnetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("AllowInternetOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("Internet"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65001), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // { + // Name: to.Ptr("DenyAllOutBound"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Deny all outbound traffic"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityRules: []*armnetwork.SecurityRule{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go index 36a91084f9f4..068473573bde 100644 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // SecurityPartnerProvidersClient contains the methods for the SecurityPartnerProviders group. // Don't use this type directly, use NewSecurityPartnerProvidersClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPartnerProvidersClient struct { internal *arm.Client subscriptionID string } // NewSecurityPartnerProvidersClient creates a new instance of SecurityPartnerProvidersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPartnerProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPartnerProvidersClient, error) { @@ -43,9 +43,7 @@ func NewSecurityPartnerProvidersClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Creates or updates the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to the create or update Security Partner Provider operation. // - options - SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *SecurityPartnerProvidersClient) BeginCreateOrUpdate(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPartnerProvidersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *SecurityPartnerProvidersClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Creates or updates the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPartnerProvidersClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *SecurityPartnerProvidersClient) createOrUpdate(ctx context.Context // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, _ *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co return nil, errors.New("parameter securityPartnerProviderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co // BeginDelete - Deletes the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *SecurityPartnerProvidersClient) BeginDelete(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPartnerProvidersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *SecurityPartnerProvidersClient) BeginDelete(ctx context.Context, r // Delete - Deletes the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Contex // deleteCreateRequest creates the Delete request. func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, _ *SecurityPartnerProvidersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co return nil, errors.New("parameter securityPartnerProviderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get // method. @@ -232,6 +220,10 @@ func (client *SecurityPartnerProvidersClient) Get(ctx context.Context, resourceG // getCreateRequest creates the Get request. func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, _ *SecurityPartnerProvidersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +232,13 @@ func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Conte return nil, errors.New("parameter securityPartnerProviderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,8 +253,6 @@ func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Respo } // NewListPager - Gets all the Security Partner Providers in a subscription. -// -// Generated from API version 2025-05-01 // - options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager // method. func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { @@ -304,8 +290,8 @@ func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -320,9 +306,7 @@ func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Resp } // NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager // method. func (client *SecurityPartnerProvidersClient) NewListByResourceGroupPager(resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) *runtime.Pager[SecurityPartnerProvidersClientListByResourceGroupResponse] { @@ -351,21 +335,21 @@ func (client *SecurityPartnerProvidersClient) NewListByResourceGroupPager(resour // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *SecurityPartnerProvidersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,9 +365,7 @@ func (client *SecurityPartnerProvidersClient) listByResourceGroupHandleResponse( // UpdateTags - Updates tags of a Security Partner Provider resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to update Security Partner Provider tags. // - options - SecurityPartnerProvidersClientUpdateTagsOptions contains the optional parameters for the SecurityPartnerProvidersClient.UpdateTags @@ -413,6 +395,10 @@ func (client *SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, re // updateTagsCreateRequest creates the UpdateTags request. func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject, _ *SecurityPartnerProvidersClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -421,18 +407,15 @@ func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx contex return nil, errors.New("parameter securityPartnerProviderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go index 7b55fad373a4..614f0f4891fa 100644 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go @@ -1,182 +1,149 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderDelete.json -func ExampleSecurityPartnerProvidersClient_BeginDelete() { +// Generated from example definition: 2025-07-01/SecurityPartnerProviderPut.json +func ExampleSecurityPartnerProvidersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginDelete(ctx, "rg1", "securityPartnerProvider", nil) + poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginCreateOrUpdate(ctx, "rg1", "securityPartnerProvider", armnetwork.SecurityPartnerProvider{ + Location: to.Ptr("West US"), + Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + VirtualHub: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderGet.json -func ExampleSecurityPartnerProvidersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPartnerProvidersClient().Get(ctx, "rg1", "securityPartnerProvider", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // res = armnetwork.SecurityPartnerProvidersClientCreateOrUpdateResponse{ + // SecurityPartnerProvider: armnetwork.SecurityPartnerProvider{ + // Name: to.Ptr("securityPartnerProvider"), + // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderPut.json -func ExampleSecurityPartnerProvidersClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/SecurityPartnerProviderDelete.json +func ExampleSecurityPartnerProvidersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginCreateOrUpdate(ctx, "rg1", "securityPartnerProvider", armnetwork.SecurityPartnerProvider{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - }, nil) + poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginDelete(ctx, "rg1", "securityPartnerProvider", 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) + log.Fatalf("failed to poll 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.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, + // res = armnetwork.SecurityPartnerProvidersClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderUpdateTags.json -func ExampleSecurityPartnerProvidersClient_UpdateTags() { +// Generated from example definition: 2025-07-01/SecurityPartnerProviderGet.json +func ExampleSecurityPartnerProvidersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPartnerProvidersClient().UpdateTags(ctx, "rg1", "securityPartnerProvider", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewSecurityPartnerProvidersClient().Get(ctx, "rg1", "securityPartnerProvider", 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.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("fw1"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/azfwtest/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // res = armnetwork.SecurityPartnerProvidersClientGetResponse{ + // SecurityPartnerProvider: armnetwork.SecurityPartnerProvider{ + // Name: to.Ptr("securityPartnerProvider"), + // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderListByResourceGroup.json -func ExampleSecurityPartnerProvidersClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/SecurityPartnerProviderListBySubscription.json +func ExampleSecurityPartnerProvidersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPartnerProvidersClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewSecurityPartnerProvidersClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -187,42 +154,45 @@ func ExampleSecurityPartnerProvidersClient_NewListByResourceGroupPager() { _ = 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.SecurityPartnerProviderListResult = armnetwork.SecurityPartnerProviderListResult{ - // Value: []*armnetwork.SecurityPartnerProvider{ - // { - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // page = armnetwork.SecurityPartnerProvidersClientListResponse{ + // SecurityPartnerProviderListResult: armnetwork.SecurityPartnerProviderListResult{ + // Value: []*armnetwork.SecurityPartnerProvider{ + // { + // Name: to.Ptr("securityPartnerProvider"), + // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SecurityPartnerProviderListBySubscription.json -func ExampleSecurityPartnerProvidersClient_NewListPager() { +// Generated from example definition: 2025-07-01/SecurityPartnerProviderListByResourceGroup.json +func ExampleSecurityPartnerProvidersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPartnerProvidersClient().NewListPager(nil) + pager := clientFactory.NewSecurityPartnerProvidersClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -233,26 +203,70 @@ func ExampleSecurityPartnerProvidersClient_NewListPager() { _ = 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.SecurityPartnerProviderListResult = armnetwork.SecurityPartnerProviderListResult{ - // Value: []*armnetwork.SecurityPartnerProvider{ - // { - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // page = armnetwork.SecurityPartnerProvidersClientListByResourceGroupResponse{ + // SecurityPartnerProviderListResult: armnetwork.SecurityPartnerProviderListResult{ + // Value: []*armnetwork.SecurityPartnerProvider{ + // { + // Name: to.Ptr("securityPartnerProvider"), + // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/SecurityPartnerProviderUpdateTags.json +func ExampleSecurityPartnerProvidersClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSecurityPartnerProvidersClient().UpdateTags(ctx, "rg1", "securityPartnerProvider", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.SecurityPartnerProvidersClientUpdateTagsResponse{ + // SecurityPartnerProvider: armnetwork.SecurityPartnerProvider{ + // Name: to.Ptr("fw1"), + // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azfwtest/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), + // Location: to.Ptr("brazilsouth"), + // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go index c079062614b6..676f2caa9fad 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimeterAccessRulesClient contains the methods for the NetworkSecurityPerimeterAccessRules group. +// SecurityPerimeterAccessRulesClient contains the methods for the SecurityPerimeterAccessRules group. // Don't use this type directly, use NewSecurityPerimeterAccessRulesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterAccessRulesClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterAccessRulesClient creates a new instance of SecurityPerimeterAccessRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterAccessRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAccessRulesClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimeterAccessRulesClient(subscriptionID string, credential azc // CreateOrUpdate - Creates or updates a network access rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - accessRuleName - The name of the NSP access rule. @@ -103,9 +101,10 @@ func (client *SecurityPerimeterAccessRulesClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -123,9 +122,7 @@ func (client *SecurityPerimeterAccessRulesClient) createOrUpdateHandleResponse(r // Delete - Deletes an NSP access rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - accessRuleName - The name of the NSP access rule. @@ -180,17 +177,14 @@ func (client *SecurityPerimeterAccessRulesClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified NSP access rule by name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - accessRuleName - The name of the NSP access rule. @@ -246,8 +240,8 @@ func (client *SecurityPerimeterAccessRulesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -262,9 +256,7 @@ func (client *SecurityPerimeterAccessRulesClient) getHandleResponse(resp *http.R } // NewListPager - Lists the NSP access rules in the specified NSP profile. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - options - SecurityPerimeterAccessRulesClientListOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.NewListPager @@ -322,8 +314,8 @@ func (client *SecurityPerimeterAccessRulesClient) listCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -339,9 +331,7 @@ func (client *SecurityPerimeterAccessRulesClient) listHandleResponse(resp *http. // Reconcile - Reconcile NSP access rules // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - accessRuleName - The name of the NSP access rule. @@ -398,9 +388,10 @@ func (client *SecurityPerimeterAccessRulesClient) reconcileCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client_example_test.go index 30347ac10789..7dd52ca4dc24 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client_example_test.go @@ -1,59 +1,58 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAccessRuleGet.json -func ExampleSecurityPerimeterAccessRulesClient_Get() { +// Generated from example definition: 2025-07-01/NspAccessRulePut.json +func ExampleSecurityPerimeterAccessRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterAccessRulesClient().Get(ctx, "rg1", "nsp1", "profile1", "accessRule1", nil) + res, err := clientFactory.NewSecurityPerimeterAccessRulesClient().CreateOrUpdate(ctx, "rg1", "nsp1", "profile1", "accessRule1", armnetwork.NspAccessRule{ + Properties: &armnetwork.NspAccessRuleProperties{ + AddressPrefixes: []*string{ + to.Ptr("10.11.0.0/16"), + to.Ptr("10.10.1.0/24"), + }, + Direction: to.Ptr(armnetwork.AccessRuleDirectionInbound), + }, + }, 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.NspAccessRule = armnetwork.NspAccessRule{ - // Name: to.Ptr("accessRule1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAccessRuleProperties{ - // AddressPrefixes: []*string{ - // }, - // Direction: to.Ptr(armnetwork.AccessRuleDirectionOutbound), - // EmailAddresses: []*string{ - // }, - // FullyQualifiedDomainNames: []*string{ - // to.Ptr("paasrp1.contoso.org"), - // to.Ptr("paasrp2.contoso.org")}, + // res = armnetwork.SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{ + // NspAccessRule: armnetwork.NspAccessRule{ + // Name: to.Ptr("accessRule1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), + // Properties: &armnetwork.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("10.11.0.0/16"), + // to.Ptr("10.10.1.0/24"), + // }, + // Direction: to.Ptr(armnetwork.AccessRuleDirectionInbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, // NetworkSecurityPerimeters: []*armnetwork.PerimeterBasedAccessRule{ // }, // PhoneNumbers: []*string{ @@ -64,54 +63,72 @@ func ExampleSecurityPerimeterAccessRulesClient_Get() { // Subscriptions: []*armnetwork.SubscriptionID{ // }, // }, - // } + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAccessRulePut.json -func ExampleSecurityPerimeterAccessRulesClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NspAccessRuleDelete.json +func ExampleSecurityPerimeterAccessRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterAccessRulesClient().CreateOrUpdate(ctx, "rg1", "nsp1", "profile1", "accessRule1", armnetwork.NspAccessRule{ - Properties: &armnetwork.NspAccessRuleProperties{ - AddressPrefixes: []*string{ - to.Ptr("10.11.0.0/16"), - to.Ptr("10.10.1.0/24")}, - Direction: to.Ptr(armnetwork.AccessRuleDirectionInbound), - }, - }, nil) + res, err := clientFactory.NewSecurityPerimeterAccessRulesClient().Delete(ctx, "rg1", "nsp1", "profile1", "accessRule1", 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.NspAccessRule = armnetwork.NspAccessRule{ - // Name: to.Ptr("accessRule1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("10.11.0.0/16"), - // to.Ptr("10.10.1.0/24")}, - // Direction: to.Ptr(armnetwork.AccessRuleDirectionInbound), + // res = armnetwork.SecurityPerimeterAccessRulesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NspAccessRuleGet.json +func ExampleSecurityPerimeterAccessRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSecurityPerimeterAccessRulesClient().Get(ctx, "rg1", "nsp1", "profile1", "accessRule1", 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 = armnetwork.SecurityPerimeterAccessRulesClientGetResponse{ + // NspAccessRule: armnetwork.NspAccessRule{ + // Name: to.Ptr("accessRule1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), + // Properties: &armnetwork.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // }, + // Direction: to.Ptr(armnetwork.AccessRuleDirectionOutbound), // EmailAddresses: []*string{ // }, // FullyQualifiedDomainNames: []*string{ + // to.Ptr("paasrp1.contoso.org"), + // to.Ptr("paasrp2.contoso.org"), // }, // NetworkSecurityPerimeters: []*armnetwork.PerimeterBasedAccessRule{ // }, @@ -123,40 +140,30 @@ func ExampleSecurityPerimeterAccessRulesClient_CreateOrUpdate() { // Subscriptions: []*armnetwork.SubscriptionID{ // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAccessRuleDelete.json -func ExampleSecurityPerimeterAccessRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSecurityPerimeterAccessRulesClient().Delete(ctx, "rg1", "nsp1", "profile1", "accessRule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAccessRuleList.json +// Generated from example definition: 2025-07-01/NspAccessRuleList.json func ExampleSecurityPerimeterAccessRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimeterAccessRulesClient().NewListPager("rg1", "nsp1", "profile1", &armnetwork.SecurityPerimeterAccessRulesClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimeterAccessRulesClient().NewListPager("rg1", "nsp1", "profile1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -167,24 +174,19 @@ func ExampleSecurityPerimeterAccessRulesClient_NewListPager() { _ = 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.NspAccessRuleListResult = armnetwork.NspAccessRuleListResult{ - // Value: []*armnetwork.NspAccessRule{ - // { - // Name: to.Ptr("accessRule1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), - // ID: to.Ptr("/subscriptions/rg1/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("10.11.0.0/16"), - // to.Ptr("10.10.1.0/24")}, + // page = armnetwork.SecurityPerimeterAccessRulesClientListResponse{ + // NspAccessRuleListResult: armnetwork.NspAccessRuleListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspAccessRule{ + // { + // Name: to.Ptr("accessRule1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), + // ID: to.Ptr("/subscriptions/rg1/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1"), + // Properties: &armnetwork.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("10.11.0.0/16"), + // to.Ptr("10.10.1.0/24"), + // }, // Direction: to.Ptr(armnetwork.AccessRuleDirectionInbound), // EmailAddresses: []*string{ // }, @@ -200,19 +202,19 @@ func ExampleSecurityPerimeterAccessRulesClient_NewListPager() { // Subscriptions: []*armnetwork.SubscriptionID{ // }, // }, - // }, - // { - // Name: to.Ptr("accessRule2"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule2"), // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), // CreatedBy: to.Ptr("user"), // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), // LastModifiedBy: to.Ptr("user"), // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, + // }, + // { + // Name: to.Ptr("accessRule2"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles/accessRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule2"), // Properties: &armnetwork.NspAccessRuleProperties{ // AddressPrefixes: []*string{ // }, @@ -221,30 +223,41 @@ func ExampleSecurityPerimeterAccessRulesClient_NewListPager() { // }, // FullyQualifiedDomainNames: []*string{ // to.Ptr("paasrp1.contoso.org"), - // to.Ptr("paasrp2.contoso.org")}, - // NetworkSecurityPerimeters: []*armnetwork.PerimeterBasedAccessRule{ - // }, - // PhoneNumbers: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // ServiceTags: []*string{ - // }, - // Subscriptions: []*armnetwork.SubscriptionID{ - // }, + // to.Ptr("paasrp2.contoso.org"), + // }, + // NetworkSecurityPerimeters: []*armnetwork.PerimeterBasedAccessRule{ + // }, + // PhoneNumbers: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // ServiceTags: []*string{ + // }, + // Subscriptions: []*armnetwork.SubscriptionID{ // }, - // }}, - // } + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAccessRuleReconcile.json +// Generated from example definition: 2025-07-01/NspAccessRuleReconcile.json func ExampleSecurityPerimeterAccessRulesClient_Reconcile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -257,6 +270,8 @@ func ExampleSecurityPerimeterAccessRulesClient_Reconcile() { // 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.Interface = map[string]any{ + // res = armnetwork.SecurityPerimeterAccessRulesClientReconcileResponse{ + // Interface: map[string]any{ + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go index 406a71f58c9c..33014c91090f 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,17 +16,17 @@ import ( "strings" ) -// SecurityPerimeterAssociableResourceTypesClient contains the methods for the NetworkSecurityPerimeterAssociableResourceTypes -// group. +// SecurityPerimeterAssociableResourceTypesClient contains the methods for the SecurityPerimeterAssociableResourceTypes group. // Don't use this type directly, use NewSecurityPerimeterAssociableResourceTypesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterAssociableResourceTypesClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterAssociableResourceTypesClient creates a new instance of SecurityPerimeterAssociableResourceTypesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterAssociableResourceTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAssociableResourceTypesClient, error) { @@ -44,9 +43,7 @@ func NewSecurityPerimeterAssociableResourceTypesClient(subscriptionID string, cr // NewListPager - Gets the list of resources that are onboarded with NSP. These resources can be associated with a network // security perimeter -// -// Generated from API version 2025-05-01 -// - location - The location of network security perimeter. +// - location - The location name. // - options - SecurityPerimeterAssociableResourceTypesClientListOptions contains the optional parameters for the SecurityPerimeterAssociableResourceTypesClient.NewListPager // method. func (client *SecurityPerimeterAssociableResourceTypesClient) NewListPager(location string, options *SecurityPerimeterAssociableResourceTypesClientListOptions) *runtime.Pager[SecurityPerimeterAssociableResourceTypesClientListResponse] { @@ -88,8 +85,8 @@ func (client *SecurityPerimeterAssociableResourceTypesClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client_example_test.go index 5e84827dc10f..533cc4f89e53 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/PerimeterAssociableResourcesList.json +// Generated from example definition: 2025-07-01/PerimeterAssociableResourcesList.json func ExampleSecurityPerimeterAssociableResourceTypesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,17 +33,26 @@ func ExampleSecurityPerimeterAssociableResourceTypesClient_NewListPager() { _ = 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.PerimeterAssociableResourcesListResult = armnetwork.PerimeterAssociableResourcesListResult{ - // Value: []*armnetwork.PerimeterAssociableResource{ - // { - // Name: to.Ptr("Microsoft.Sql.servers"), - // Type: to.Ptr("Microsoft.Network/PerimeterAssociableResourceTypes"), - // ID: to.Ptr("/subscriptions/{subscriptionID}/providers/Microsoft.Network/perimeterAssociableResourceTypes/Microsoft.Sql.servers"), - // Properties: &armnetwork.PerimeterAssociableResourceProperties{ - // DisplayName: to.Ptr("Microsoft.Sql/servers"), - // PublicDNSZones: []*string{ - // to.Ptr("database.windows.net")}, + // page = armnetwork.SecurityPerimeterAssociableResourceTypesClientListResponse{ + // PerimeterAssociableResourcesListResult: armnetwork.PerimeterAssociableResourcesListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/perimeterAssociableResourceTypes?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.PerimeterAssociableResource{ + // { + // Name: to.Ptr("Microsoft.Sql.servers"), + // Type: to.Ptr("Microsoft.Network/PerimeterAssociableResourceTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/perimeterAssociableResourceTypes/Microsoft.Sql.servers"), + // Properties: &armnetwork.PerimeterAssociableResourceProperties{ + // DisplayName: to.Ptr("Microsoft.Sql/servers"), + // PublicDNSZones: []*string{ + // to.Ptr("database.windows.net"), + // }, // ResourceType: to.Ptr("Microsoft.Sql/servers"), + // ServiceTags: []*string{ + // to.Ptr("Sql"), + // }, + // ReadinessState: to.Ptr(armnetwork.NspReadinessStateGA), + // OutboundSupported: to.Ptr(true), + // Description: to.Ptr(""), // }, // }, // { @@ -59,10 +65,19 @@ func ExampleSecurityPerimeterAssociableResourceTypesClient_NewListPager() { // to.Ptr("blob.core.windows.net"), // to.Ptr("table.core.windows.net"), // to.Ptr("queue.core.windows.net"), - // to.Ptr("file.core.windows.net")}, - // ResourceType: to.Ptr("Microsoft.Storage/accounts"), + // to.Ptr("file.core.windows.net"), // }, - // }}, - // } + // ResourceType: to.Ptr("Microsoft.Storage/accounts"), + // ServiceTags: []*string{ + // to.Ptr("Storage"), + // }, + // ReadinessState: to.Ptr(armnetwork.NspReadinessStateGA), + // OutboundSupported: to.Ptr(true), + // Description: to.Ptr(""), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go index 11b7e4005f9b..96a2485dfef9 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimeterAssociationsClient contains the methods for the NetworkSecurityPerimeterAssociations group. +// SecurityPerimeterAssociationsClient contains the methods for the SecurityPerimeterAssociations group. // Don't use this type directly, use NewSecurityPerimeterAssociationsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterAssociationsClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterAssociationsClient creates a new instance of SecurityPerimeterAssociationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterAssociationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAssociationsClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimeterAssociationsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates or updates a NSP resource association. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - associationName - The name of the NSP association. // - parameters - Parameters that hold the NspAssociation resource to be created/updated. @@ -59,8 +57,7 @@ func (client *SecurityPerimeterAssociationsClient) BeginCreateOrUpdate(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterAssociationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -72,8 +69,6 @@ func (client *SecurityPerimeterAssociationsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates or updates a NSP resource association. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPerimeterAssociationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters NspAssociation, options *SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityPerimeterAssociationsClient.BeginCreateOrUpdate" @@ -119,9 +114,10 @@ func (client *SecurityPerimeterAssociationsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -130,9 +126,7 @@ func (client *SecurityPerimeterAssociationsClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes an NSP association resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - associationName - The name of the NSP association. // - options - SecurityPerimeterAssociationsClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.BeginDelete @@ -144,8 +138,7 @@ func (client *SecurityPerimeterAssociationsClient) BeginDelete(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterAssociationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,8 +150,6 @@ func (client *SecurityPerimeterAssociationsClient) BeginDelete(ctx context.Conte // Delete - Deletes an NSP association resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPerimeterAssociationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, options *SecurityPerimeterAssociationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPerimeterAssociationsClient.BeginDelete" @@ -204,17 +195,14 @@ func (client *SecurityPerimeterAssociationsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified NSP association by name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - associationName - The name of the NSP association. // - options - SecurityPerimeterAssociationsClientGetOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.Get @@ -265,8 +253,8 @@ func (client *SecurityPerimeterAssociationsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -281,9 +269,7 @@ func (client *SecurityPerimeterAssociationsClient) getHandleResponse(resp *http. } // NewListPager - Lists the NSP resource associations. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimeterAssociationsClientListOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.NewListPager // method. @@ -336,8 +322,8 @@ func (client *SecurityPerimeterAssociationsClient) listCreateRequest(ctx context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -353,9 +339,7 @@ func (client *SecurityPerimeterAssociationsClient) listHandleResponse(resp *http // Reconcile - Reconcile NSP association // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - associationName - The name of the NSP association. // - parameters - Parameters for NSP association reconcile @@ -407,9 +391,10 @@ func (client *SecurityPerimeterAssociationsClient) reconcileCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client_example_test.go index c489a4ce3c91..f8e9c54d46ff 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client_example_test.go @@ -1,157 +1,161 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAssociationGet.json -func ExampleSecurityPerimeterAssociationsClient_Get() { +// Generated from example definition: 2025-07-01/NspAssociationPut.json +func ExampleSecurityPerimeterAssociationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterAssociationsClient().Get(ctx, "rg1", "nsp1", "association1", nil) + poller, err := clientFactory.NewSecurityPerimeterAssociationsClient().BeginCreateOrUpdate(ctx, "rg1", "nsp1", "association1", armnetwork.NspAssociation{ + Properties: &armnetwork.NspAssociationProperties{ + AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), + PrivateLinkResource: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + }, + Profile: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + }, + }, + }, 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 poll 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.NspAssociation = armnetwork.NspAssociation{ - // Name: to.Ptr("association1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAssociationProperties{ - // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), - // HasProvisioningIssues: to.Ptr("no"), - // PrivateLinkResource: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // res = armnetwork.SecurityPerimeterAssociationsClientCreateOrUpdateResponse{ + // NspAssociation: armnetwork.NspAssociation{ + // Name: to.Ptr("association1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), + // Properties: &armnetwork.NspAssociationProperties{ + // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), + // HasProvisioningIssues: to.Ptr("no"), + // PrivateLinkResource: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // }, + // Profile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, - // Profile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAssociationPut.json -func ExampleSecurityPerimeterAssociationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/NspAssociationDelete.json +func ExampleSecurityPerimeterAssociationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPerimeterAssociationsClient().BeginCreateOrUpdate(ctx, "rg1", "nsp1", "association1", armnetwork.NspAssociation{ - Properties: &armnetwork.NspAssociationProperties{ - AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), - PrivateLinkResource: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), - }, - Profile: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), - }, - }, - }, nil) + poller, err := clientFactory.NewSecurityPerimeterAssociationsClient().BeginDelete(ctx, "rg1", "nsp1", "association1", 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) + log.Fatalf("failed to poll 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.NspAssociation = armnetwork.NspAssociation{ - // Name: to.Ptr("association1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAssociationProperties{ - // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), - // HasProvisioningIssues: to.Ptr("no"), - // PrivateLinkResource: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), - // }, - // Profile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), - // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // }, + // res = armnetwork.SecurityPerimeterAssociationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAssociationDelete.json -func ExampleSecurityPerimeterAssociationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NspAssociationGet.json +func ExampleSecurityPerimeterAssociationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPerimeterAssociationsClient().BeginDelete(ctx, "rg1", "nsp1", "association1", nil) + res, err := clientFactory.NewSecurityPerimeterAssociationsClient().Get(ctx, "rg1", "nsp1", "association1", 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) - } + // 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 = armnetwork.SecurityPerimeterAssociationsClientGetResponse{ + // NspAssociation: armnetwork.NspAssociation{ + // Name: to.Ptr("association1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), + // Properties: &armnetwork.NspAssociationProperties{ + // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), + // HasProvisioningIssues: to.Ptr("no"), + // PrivateLinkResource: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // }, + // Profile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAssociationList.json +// Generated from example definition: 2025-07-01/NspAssociationList.json func ExampleSecurityPerimeterAssociationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimeterAssociationsClient().NewListPager("rg1", "nsp1", &armnetwork.SecurityPerimeterAssociationsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimeterAssociationsClient().NewListPager("rg1", "nsp1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -162,92 +166,96 @@ func ExampleSecurityPerimeterAssociationsClient_NewListPager() { _ = 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.NspAssociationsListResult = armnetwork.NspAssociationsListResult{ - // Value: []*armnetwork.NspAssociation{ - // { - // Name: to.Ptr("association1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAssociationProperties{ - // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), - // HasProvisioningIssues: to.Ptr("no"), - // PrivateLinkResource: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // page = armnetwork.SecurityPerimeterAssociationsClientListResponse{ + // NspAssociationsListResult: armnetwork.NspAssociationsListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspAssociation{ + // { + // Name: to.Ptr("association1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association1"), + // Properties: &armnetwork.NspAssociationProperties{ + // AccessMode: to.Ptr(armnetwork.AssociationAccessModeEnforced), + // HasProvisioningIssues: to.Ptr("no"), + // PrivateLinkResource: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // }, + // Profile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, - // Profile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("association2"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association2"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // Properties: &armnetwork.NspAssociationProperties{ - // AccessMode: to.Ptr(armnetwork.AssociationAccessModeAudit), - // HasProvisioningIssues: to.Ptr("no"), - // PrivateLinkResource: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // { + // Name: to.Ptr("association2"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association2"), + // Properties: &armnetwork.NspAssociationProperties{ + // AccessMode: to.Ptr(armnetwork.AssociationAccessModeAudit), + // HasProvisioningIssues: to.Ptr("no"), + // PrivateLinkResource: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // }, + // Profile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, - // Profile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, - // }, - // { - // Name: to.Ptr("association3"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association3"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspAssociationProperties{ - // AccessMode: to.Ptr(armnetwork.AssociationAccessModeLearning), - // HasProvisioningIssues: to.Ptr("yes"), - // PrivateLinkResource: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // { + // Name: to.Ptr("association3"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/resourceAssociations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/resourceAssociations/association3"), + // Properties: &armnetwork.NspAssociationProperties{ + // AccessMode: to.Ptr(armnetwork.AssociationAccessModeLearning), + // HasProvisioningIssues: to.Ptr("yes"), + // PrivateLinkResource: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/{paasSubscriptionId}/resourceGroups/{paasResourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}"), + // }, + // Profile: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateFailed), // }, - // Profile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/{profileName}"), + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), // }, - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspAssociationReconcile.json +// Generated from example definition: 2025-07-01/NspAssociationReconcile.json func ExampleSecurityPerimeterAssociationsClient_Reconcile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -260,6 +268,8 @@ func ExampleSecurityPerimeterAssociationsClient_Reconcile() { // 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.Interface = map[string]any{ + // res = armnetwork.SecurityPerimeterAssociationsClientReconcileResponse{ + // Interface: map[string]any{ + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go index d35771e3ec25..bbabc9688f76 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimeterLinkReferencesClient contains the methods for the NetworkSecurityPerimeterLinkReferences group. +// SecurityPerimeterLinkReferencesClient contains the methods for the SecurityPerimeterLinkReferences group. // Don't use this type directly, use NewSecurityPerimeterLinkReferencesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterLinkReferencesClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterLinkReferencesClient creates a new instance of SecurityPerimeterLinkReferencesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterLinkReferencesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLinkReferencesClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimeterLinkReferencesClient(subscriptionID string, credential // BeginDelete - Deletes an NSP LinkReference resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - linkReferenceName - The name of the NSP linkReference. // - options - SecurityPerimeterLinkReferencesClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.BeginDelete @@ -58,8 +56,7 @@ func (client *SecurityPerimeterLinkReferencesClient) BeginDelete(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterLinkReferencesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *SecurityPerimeterLinkReferencesClient) BeginDelete(ctx context.Con // Delete - Deletes an NSP LinkReference resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPerimeterLinkReferencesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, options *SecurityPerimeterLinkReferencesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPerimeterLinkReferencesClient.BeginDelete" @@ -118,17 +113,14 @@ func (client *SecurityPerimeterLinkReferencesClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified NSP linkReference resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - linkReferenceName - The name of the NSP linkReference. // - options - SecurityPerimeterLinkReferencesClientGetOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.Get @@ -179,8 +171,8 @@ func (client *SecurityPerimeterLinkReferencesClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -195,9 +187,7 @@ func (client *SecurityPerimeterLinkReferencesClient) getHandleResponse(resp *htt } // NewListPager - Lists the NSP LinkReference resources in the specified network security perimeter. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimeterLinkReferencesClientListOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.NewListPager // method. @@ -250,8 +240,8 @@ func (client *SecurityPerimeterLinkReferencesClient) listCreateRequest(ctx conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client_example_test.go index c22395842129..708bade879e9 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client_example_test.go @@ -1,103 +1,109 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkReferenceGet.json -func ExampleSecurityPerimeterLinkReferencesClient_Get() { +// Generated from example definition: 2025-07-01/NspLinkReferenceDelete.json +func ExampleSecurityPerimeterLinkReferencesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterLinkReferencesClient().Get(ctx, "rg1", "nsp2", "link1-guid", nil) + poller, err := clientFactory.NewSecurityPerimeterLinkReferencesClient().BeginDelete(ctx, "rg1", "nsp2", "link1-guid", 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 poll 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.NspLinkReference = armnetwork.NspLinkReference{ - // Name: to.Ptr("link1-guid"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/linkreferences"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2/linkreferences/link1-guid"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLinkReferenceProperties{ - // Description: to.Ptr("Auto Approved"), - // LocalInboundProfiles: []*string{ - // to.Ptr("*")}, - // LocalOutboundProfiles: []*string{ - // to.Ptr("*")}, - // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), - // RemoteInboundProfiles: []*string{ - // to.Ptr("*")}, - // RemoteOutboundProfiles: []*string{ - // to.Ptr("*")}, - // RemotePerimeterGUID: to.Ptr("guid"), - // RemotePerimeterLocation: to.Ptr("westus2"), - // RemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), - // Status: to.Ptr(armnetwork.NspLinkStatusApproved), - // }, - // } + // res = armnetwork.SecurityPerimeterLinkReferencesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkReferenceDelete.json -func ExampleSecurityPerimeterLinkReferencesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NspLinkReferenceGet.json +func ExampleSecurityPerimeterLinkReferencesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPerimeterLinkReferencesClient().BeginDelete(ctx, "rg1", "nsp2", "link1-guid", nil) + res, err := clientFactory.NewSecurityPerimeterLinkReferencesClient().Get(ctx, "rg1", "nsp2", "link1-guid", 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) - } + // 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 = armnetwork.SecurityPerimeterLinkReferencesClientGetResponse{ + // NspLinkReference: armnetwork.NspLinkReference{ + // Name: to.Ptr("link1-guid"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/linkreferences"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2/linkreferences/link1-guid"), + // Properties: &armnetwork.NspLinkReferenceProperties{ + // Description: to.Ptr("Auto Approved"), + // LocalInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // LocalOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), + // RemoteInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemoteOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemotePerimeterGUID: to.Ptr("guid"), + // RemotePerimeterLocation: to.Ptr("westus2"), + // RemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), + // Status: to.Ptr(armnetwork.NspLinkStatusApproved), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkReferenceList.json +// Generated from example definition: 2025-07-01/NspLinkReferenceList.json func ExampleSecurityPerimeterLinkReferencesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimeterLinkReferencesClient().NewListPager("rg1", "nsp2", &armnetwork.SecurityPerimeterLinkReferencesClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimeterLinkReferencesClient().NewListPager("rg1", "nsp2", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -108,37 +114,45 @@ func ExampleSecurityPerimeterLinkReferencesClient_NewListPager() { _ = 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.NspLinkReferenceListResult = armnetwork.NspLinkReferenceListResult{ - // Value: []*armnetwork.NspLinkReference{ - // { - // Name: to.Ptr("link1-guid"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/linkreferences"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2/linkreferences/link1-guid"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLinkReferenceProperties{ - // Description: to.Ptr("Auto Approved"), - // LocalInboundProfiles: []*string{ - // to.Ptr("*")}, + // page = armnetwork.SecurityPerimeterLinkReferencesClientListResponse{ + // NspLinkReferenceListResult: armnetwork.NspLinkReferenceListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2/linkreferences?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspLinkReference{ + // { + // Name: to.Ptr("link1-guid"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/linkreferences"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2/linkreferences/link1-guid"), + // Properties: &armnetwork.NspLinkReferenceProperties{ + // Description: to.Ptr("Auto Approved"), + // LocalInboundProfiles: []*string{ + // to.Ptr("*"), + // }, // LocalOutboundProfiles: []*string{ - // to.Ptr("*")}, - // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), - // RemoteInboundProfiles: []*string{ - // to.Ptr("*")}, - // RemoteOutboundProfiles: []*string{ - // to.Ptr("*")}, - // RemotePerimeterGUID: to.Ptr("guid"), - // RemotePerimeterLocation: to.Ptr("westus2"), - // RemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), - // Status: to.Ptr(armnetwork.NspLinkStatusApproved), - // }, - // }}, - // } + // to.Ptr("*"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), + // RemoteInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemoteOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemotePerimeterGUID: to.Ptr("guid"), + // RemotePerimeterLocation: to.Ptr("westus2"), + // RemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), + // Status: to.Ptr(armnetwork.NspLinkStatusApproved), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go index 8404c3f587e0..e8265b9f9393 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimeterLinksClient contains the methods for the NetworkSecurityPerimeterLinks group. +// SecurityPerimeterLinksClient contains the methods for the SecurityPerimeterLinks group. // Don't use this type directly, use NewSecurityPerimeterLinksClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterLinksClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterLinksClient creates a new instance of SecurityPerimeterLinksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLinksClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimeterLinksClient(subscriptionID string, credential azcore.To // CreateOrUpdate - Creates or updates NSP link resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - linkName - The name of the NSP link. // - parameters - Parameters that hold the NspLink resource to be created/updated. @@ -98,9 +96,10 @@ func (client *SecurityPerimeterLinksClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,9 +117,7 @@ func (client *SecurityPerimeterLinksClient) createOrUpdateHandleResponse(resp *h // BeginDelete - Deletes an NSP Link resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - linkName - The name of the NSP link. // - options - SecurityPerimeterLinksClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterLinksClient.BeginDelete @@ -132,8 +129,7 @@ func (client *SecurityPerimeterLinksClient) BeginDelete(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterLinksClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -145,8 +141,6 @@ func (client *SecurityPerimeterLinksClient) BeginDelete(ctx context.Context, res // Delete - Deletes an NSP Link resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPerimeterLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, options *SecurityPerimeterLinksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPerimeterLinksClient.BeginDelete" @@ -192,17 +186,14 @@ func (client *SecurityPerimeterLinksClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified NSP link resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - linkName - The name of the NSP link. // - options - SecurityPerimeterLinksClientGetOptions contains the optional parameters for the SecurityPerimeterLinksClient.Get @@ -253,8 +244,8 @@ func (client *SecurityPerimeterLinksClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -269,9 +260,7 @@ func (client *SecurityPerimeterLinksClient) getHandleResponse(resp *http.Respons } // NewListPager - Lists the NSP Link resources in the specified network security perimeter. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimeterLinksClientListOptions contains the optional parameters for the SecurityPerimeterLinksClient.NewListPager // method. @@ -324,8 +313,8 @@ func (client *SecurityPerimeterLinksClient) listCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client_example_test.go index beae5d6003ff..1b4306f85149 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client_example_test.go @@ -1,161 +1,175 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkGet.json -func ExampleSecurityPerimeterLinksClient_Get() { +// Generated from example definition: 2025-07-01/NspLinkPut.json +func ExampleSecurityPerimeterLinksClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterLinksClient().Get(ctx, "rg1", "nsp1", "link1", nil) + res, err := clientFactory.NewSecurityPerimeterLinksClient().CreateOrUpdate(ctx, "rg1", "nsp1", "link1", armnetwork.NspLink{ + Properties: &armnetwork.NspLinkProperties{ + AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), + LocalInboundProfiles: []*string{ + to.Ptr("*"), + }, + RemoteInboundProfiles: []*string{ + to.Ptr("*"), + }, + }, + }, 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.NspLink = armnetwork.NspLink{ - // Name: to.Ptr("link1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLinkProperties{ - // Description: to.Ptr("Auto Approved"), - // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), - // LocalInboundProfiles: []*string{ - // to.Ptr("*")}, + // res = armnetwork.SecurityPerimeterLinksClientCreateOrUpdateResponse{ + // NspLink: armnetwork.NspLink{ + // Name: to.Ptr("link1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), + // Properties: &armnetwork.NspLinkProperties{ + // Description: to.Ptr("Auto Approved"), + // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), + // LocalInboundProfiles: []*string{ + // to.Ptr("*"), + // }, // LocalOutboundProfiles: []*string{ - // to.Ptr("*")}, - // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), - // RemoteInboundProfiles: []*string{ - // to.Ptr("*")}, - // RemoteOutboundProfiles: []*string{ - // to.Ptr("*")}, - // RemotePerimeterGUID: to.Ptr("guid"), - // RemotePerimeterLocation: to.Ptr("westus2"), - // Status: to.Ptr(armnetwork.NspLinkStatusApproved), - // }, - // } + // to.Ptr("*"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), + // RemoteInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemoteOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemotePerimeterGUID: to.Ptr("guid"), + // RemotePerimeterLocation: to.Ptr("westus2"), + // Status: to.Ptr(armnetwork.NspLinkStatusApproved), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkPut.json -func ExampleSecurityPerimeterLinksClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NspLinkDelete.json +func ExampleSecurityPerimeterLinksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterLinksClient().CreateOrUpdate(ctx, "rg1", "nsp1", "link1", armnetwork.NspLink{ - Properties: &armnetwork.NspLinkProperties{ - AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), - LocalInboundProfiles: []*string{ - to.Ptr("*")}, - RemoteInboundProfiles: []*string{ - to.Ptr("*")}, - }, - }, nil) + poller, err := clientFactory.NewSecurityPerimeterLinksClient().BeginDelete(ctx, "rg1", "nsp1", "link1", 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 poll 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.NspLink = armnetwork.NspLink{ - // Name: to.Ptr("link1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLinkProperties{ - // Description: to.Ptr("Auto Approved"), - // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), - // LocalInboundProfiles: []*string{ - // to.Ptr("*")}, - // LocalOutboundProfiles: []*string{ - // to.Ptr("*")}, - // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), - // RemoteInboundProfiles: []*string{ - // to.Ptr("*")}, - // RemoteOutboundProfiles: []*string{ - // to.Ptr("*")}, - // RemotePerimeterGUID: to.Ptr("guid"), - // RemotePerimeterLocation: to.Ptr("westus2"), - // Status: to.Ptr(armnetwork.NspLinkStatusApproved), - // }, - // } + // res = armnetwork.SecurityPerimeterLinksClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkDelete.json -func ExampleSecurityPerimeterLinksClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NspLinkGet.json +func ExampleSecurityPerimeterLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPerimeterLinksClient().BeginDelete(ctx, "rg1", "nsp1", "link1", nil) + res, err := clientFactory.NewSecurityPerimeterLinksClient().Get(ctx, "rg1", "nsp1", "link1", 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) - } + // 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 = armnetwork.SecurityPerimeterLinksClientGetResponse{ + // NspLink: armnetwork.NspLink{ + // Name: to.Ptr("link1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), + // Properties: &armnetwork.NspLinkProperties{ + // Description: to.Ptr("Auto Approved"), + // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), + // LocalInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // LocalOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), + // RemoteInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemoteOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemotePerimeterGUID: to.Ptr("guid"), + // RemotePerimeterLocation: to.Ptr("westus2"), + // Status: to.Ptr(armnetwork.NspLinkStatusApproved), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLinkList.json +// Generated from example definition: 2025-07-01/NspLinkList.json func ExampleSecurityPerimeterLinksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimeterLinksClient().NewListPager("rg1", "nsp1", &armnetwork.SecurityPerimeterLinksClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimeterLinksClient().NewListPager("rg1", "nsp1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -166,37 +180,45 @@ func ExampleSecurityPerimeterLinksClient_NewListPager() { _ = 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.NspLinkListResult = armnetwork.NspLinkListResult{ - // Value: []*armnetwork.NspLink{ - // { - // Name: to.Ptr("link1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLinkProperties{ - // Description: to.Ptr("Auto Approved"), - // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), - // LocalInboundProfiles: []*string{ - // to.Ptr("*")}, + // page = armnetwork.SecurityPerimeterLinksClientListResponse{ + // NspLinkListResult: armnetwork.NspLinkListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspLink{ + // { + // Name: to.Ptr("link1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/links"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/links/link1"), + // Properties: &armnetwork.NspLinkProperties{ + // Description: to.Ptr("Auto Approved"), + // AutoApprovedRemotePerimeterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp2"), + // LocalInboundProfiles: []*string{ + // to.Ptr("*"), + // }, // LocalOutboundProfiles: []*string{ - // to.Ptr("*")}, - // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), - // RemoteInboundProfiles: []*string{ - // to.Ptr("*")}, - // RemoteOutboundProfiles: []*string{ - // to.Ptr("*")}, - // RemotePerimeterGUID: to.Ptr("guid"), - // RemotePerimeterLocation: to.Ptr("westus2"), - // Status: to.Ptr(armnetwork.NspLinkStatusApproved), - // }, - // }}, - // } + // to.Ptr("*"), + // }, + // ProvisioningState: to.Ptr(armnetwork.NspLinkProvisioningStateSucceeded), + // RemoteInboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemoteOutboundProfiles: []*string{ + // to.Ptr("*"), + // }, + // RemotePerimeterGUID: to.Ptr("guid"), + // RemotePerimeterLocation: to.Ptr("westus2"), + // Status: to.Ptr(armnetwork.NspLinkStatusApproved), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go index dedbce8d6b1a..d5daebdfda5d 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,17 +16,17 @@ import ( "strings" ) -// SecurityPerimeterLoggingConfigurationsClient contains the methods for the NetworkSecurityPerimeterLoggingConfigurations -// group. +// SecurityPerimeterLoggingConfigurationsClient contains the methods for the SecurityPerimeterLoggingConfigurations group. // Don't use this type directly, use NewSecurityPerimeterLoggingConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterLoggingConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterLoggingConfigurationsClient creates a new instance of SecurityPerimeterLoggingConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterLoggingConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLoggingConfigurationsClient, error) { @@ -44,9 +43,7 @@ func NewSecurityPerimeterLoggingConfigurationsClient(subscriptionID string, cred // CreateOrUpdate - Creates or updates NSP logging configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - loggingConfigurationName - The name of the NSP logging configuration. Accepts 'instance' as name. // - parameters - Parameters that hold the NspLoggingConfiguration to be created/updated. @@ -98,9 +95,10 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) createOrUpdateCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,9 +116,7 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) createOrUpdateHandle // Delete - Deletes an NSP Logging configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - loggingConfigurationName - The name of the NSP logging configuration. Accepts 'instance' as name. // - options - SecurityPerimeterLoggingConfigurationsClientDeleteOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.Delete @@ -170,17 +166,14 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) deleteCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the NSP logging configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - loggingConfigurationName - The name of the NSP logging configuration. Accepts 'instance' as name. // - options - SecurityPerimeterLoggingConfigurationsClientGetOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.Get @@ -231,8 +224,8 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -247,9 +240,7 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) getHandleResponse(re } // NewListPager - Lists the NSP logging configuration. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimeterLoggingConfigurationsClientListOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.NewListPager // method. @@ -296,8 +287,8 @@ func (client *SecurityPerimeterLoggingConfigurationsClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client_example_test.go index 8b455fd1675f..cdb6085e54f7 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client_example_test.go @@ -1,129 +1,138 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLoggingConfigurationGet.json -func ExampleSecurityPerimeterLoggingConfigurationsClient_Get() { +// Generated from example definition: 2025-07-01/NspLoggingConfigurationPut.json +func ExampleSecurityPerimeterLoggingConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().Get(ctx, "rg1", "nsp1", "instance", nil) + res, err := clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().CreateOrUpdate(ctx, "rg1", "nsp1", "instance", armnetwork.NspLoggingConfiguration{ + Properties: &armnetwork.NspLoggingConfigurationProperties{ + EnabledLogCategories: []*string{ + to.Ptr("NspPublicInboundPerimeterRulesDenied"), + to.Ptr("NspPublicOutboundPerimeterRulesDenied"), + }, + }, + }, 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.NspLoggingConfiguration = armnetwork.NspLoggingConfiguration{ - // Name: to.Ptr("instance"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLoggingConfigurationProperties{ - // EnabledLogCategories: []*string{ - // to.Ptr("NspPublicInboundPerimeterRulesDenied"), - // to.Ptr("NspPublicOutboundPerimeterRulesDenied")}, + // res = armnetwork.SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{ + // NspLoggingConfiguration: armnetwork.NspLoggingConfiguration{ + // Name: to.Ptr("instance"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), + // Properties: &armnetwork.NspLoggingConfigurationProperties{ + // EnabledLogCategories: []*string{ + // to.Ptr("NspPublicInboundPerimeterRulesDenied"), + // to.Ptr("NspPublicOutboundPerimeterRulesDenied"), + // }, // Version: to.Ptr("0"), // }, - // } + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLoggingConfigurationPut.json -func ExampleSecurityPerimeterLoggingConfigurationsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NspLoggingConfigurationDelete.json +func ExampleSecurityPerimeterLoggingConfigurationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().CreateOrUpdate(ctx, "rg1", "nsp1", "instance", armnetwork.NspLoggingConfiguration{ - Properties: &armnetwork.NspLoggingConfigurationProperties{ - EnabledLogCategories: []*string{ - to.Ptr("NspPublicInboundPerimeterRulesDenied"), - to.Ptr("NspPublicOutboundPerimeterRulesDenied")}, - }, - }, nil) + res, err := clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().Delete(ctx, "rg1", "nsp1", "instance", 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.NspLoggingConfiguration = armnetwork.NspLoggingConfiguration{ - // Name: to.Ptr("instance"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLoggingConfigurationProperties{ - // EnabledLogCategories: []*string{ - // to.Ptr("NspPublicInboundPerimeterRulesDenied"), - // to.Ptr("NspPublicOutboundPerimeterRulesDenied")}, - // Version: to.Ptr("0"), - // }, - // } + // res = armnetwork.SecurityPerimeterLoggingConfigurationsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLoggingConfigurationDelete.json -func ExampleSecurityPerimeterLoggingConfigurationsClient_Delete() { +// Generated from example definition: 2025-07-01/NspLoggingConfigurationGet.json +func ExampleSecurityPerimeterLoggingConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().Delete(ctx, "rg1", "nsp1", "instance", nil) + res, err := clientFactory.NewSecurityPerimeterLoggingConfigurationsClient().Get(ctx, "rg1", "nsp1", "instance", 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 = armnetwork.SecurityPerimeterLoggingConfigurationsClientGetResponse{ + // NspLoggingConfiguration: armnetwork.NspLoggingConfiguration{ + // Name: to.Ptr("instance"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), + // Properties: &armnetwork.NspLoggingConfigurationProperties{ + // EnabledLogCategories: []*string{ + // to.Ptr("NspPublicInboundPerimeterRulesDenied"), + // to.Ptr("NspPublicOutboundPerimeterRulesDenied"), + // }, + // Version: to.Ptr("0"), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspLoggingConfigurationList.json +// Generated from example definition: 2025-07-01/NspLoggingConfigurationList.json func ExampleSecurityPerimeterLoggingConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -138,27 +147,32 @@ func ExampleSecurityPerimeterLoggingConfigurationsClient_NewListPager() { _ = 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.NspLoggingConfigurationListResult = armnetwork.NspLoggingConfigurationListResult{ - // Value: []*armnetwork.NspLoggingConfiguration{ - // { - // Name: to.Ptr("instance"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspLoggingConfigurationProperties{ - // EnabledLogCategories: []*string{ - // to.Ptr("NspPublicInboundPerimeterRulesDenied"), - // to.Ptr("NspPublicOutboundPerimeterRulesDenied")}, + // page = armnetwork.SecurityPerimeterLoggingConfigurationsClientListResponse{ + // NspLoggingConfigurationListResult: armnetwork.NspLoggingConfigurationListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspLoggingConfiguration{ + // { + // Name: to.Ptr("instance"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/loggingConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/loggingConfigurations/instance"), + // Properties: &armnetwork.NspLoggingConfigurationProperties{ + // EnabledLogCategories: []*string{ + // to.Ptr("NspPublicInboundPerimeterRulesDenied"), + // to.Ptr("NspPublicOutboundPerimeterRulesDenied"), + // }, // Version: to.Ptr("0"), // }, - // }}, - // } + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go index 95e379e73234..8e12b2334aa5 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// SecurityPerimeterOperationStatusesClient contains the methods for the NetworkSecurityPerimeterOperationStatuses group. +// SecurityPerimeterOperationStatusesClient contains the methods for the SecurityPerimeterOperationStatuses group. // Don't use this type directly, use NewSecurityPerimeterOperationStatusesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterOperationStatusesClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterOperationStatusesClient creates a new instance of SecurityPerimeterOperationStatusesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterOperationStatusesClient, error) { @@ -43,9 +43,7 @@ func NewSecurityPerimeterOperationStatusesClient(subscriptionID string, credenti // Get - Gets the operation status for the given operation id. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The location of network security perimeter. +// - location - The name of the Azure region. // - operationID - The operation id of the async operation. // - options - SecurityPerimeterOperationStatusesClientGetOptions contains the optional parameters for the SecurityPerimeterOperationStatusesClient.Get // method. @@ -91,8 +89,8 @@ func (client *SecurityPerimeterOperationStatusesClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client_example_test.go index 8a05c7cf9712..e00ff6460c80 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspOperationStatusGet.json +// Generated from example definition: 2025-07-01/NspOperationStatusGet.json func ExampleSecurityPerimeterOperationStatusesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,11 +29,13 @@ func ExampleSecurityPerimeterOperationStatusesClient_Get() { // 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.OperationStatusResult = armnetwork.OperationStatusResult{ - // Name: to.Ptr("operationId1"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T10:46:55.094Z"); return t}()), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/locations/location1/networkSecurityPerimeterOperationStatuses/operationId1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T10:46:51.098Z"); return t}()), - // Status: to.Ptr("Succeeded"), + // res = armnetwork.SecurityPerimeterOperationStatusesClientGetResponse{ + // OperationStatusResult: armnetwork.OperationStatusResult{ + // Name: to.Ptr("operationId1"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T10:46:55.0948652Z"); return t}()), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/location1/networkSecurityPerimeterOperationStatuses/operationId1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T10:46:51.0988675Z"); return t}()), + // Status: to.Ptr("Succeeded"), + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go index c9437f5ee74a..032851ef0f29 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimeterProfilesClient contains the methods for the NetworkSecurityPerimeterProfiles group. +// SecurityPerimeterProfilesClient contains the methods for the SecurityPerimeterProfiles group. // Don't use this type directly, use NewSecurityPerimeterProfilesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterProfilesClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterProfilesClient creates a new instance of SecurityPerimeterProfilesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterProfilesClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimeterProfilesClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a network profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - parameters - Parameters that hold the NspProfile resource to be created/updated. @@ -98,9 +96,10 @@ func (client *SecurityPerimeterProfilesClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,9 +117,7 @@ func (client *SecurityPerimeterProfilesClient) createOrUpdateHandleResponse(resp // Delete - Deletes an NSP profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - options - SecurityPerimeterProfilesClientDeleteOptions contains the optional parameters for the SecurityPerimeterProfilesClient.Delete @@ -170,17 +167,14 @@ func (client *SecurityPerimeterProfilesClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified NSP profile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - profileName - The name of the NSP profile. // - options - SecurityPerimeterProfilesClientGetOptions contains the optional parameters for the SecurityPerimeterProfilesClient.Get @@ -231,8 +225,8 @@ func (client *SecurityPerimeterProfilesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -247,9 +241,7 @@ func (client *SecurityPerimeterProfilesClient) getHandleResponse(resp *http.Resp } // NewListPager - Lists the NSP profiles in the specified network security perimeter. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimeterProfilesClientListOptions contains the optional parameters for the SecurityPerimeterProfilesClient.NewListPager // method. @@ -302,8 +294,8 @@ func (client *SecurityPerimeterProfilesClient) listCreateRequest(ctx context.Con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client_example_test.go index c0ffc1c964ed..7767218a77b1 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client_example_test.go @@ -1,126 +1,130 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspProfileGet.json -func ExampleSecurityPerimeterProfilesClient_Get() { +// Generated from example definition: 2025-07-01/NspProfilePut.json +func ExampleSecurityPerimeterProfilesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterProfilesClient().Get(ctx, "rg1", "nsp1", "profile1", nil) + res, err := clientFactory.NewSecurityPerimeterProfilesClient().CreateOrUpdate(ctx, "rg1", "nsp1", "profile1", armnetwork.NspProfile{ + Properties: &armnetwork.NspProfileProperties{}, + }, 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.NspProfile = armnetwork.NspProfile{ - // Name: to.Ptr("nsp1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspProfileProperties{ - // AccessRulesVersion: to.Ptr("0"), - // DiagnosticSettingsVersion: to.Ptr("0"), + // res = armnetwork.SecurityPerimeterProfilesClientCreateOrUpdateResponse{ + // NspProfile: armnetwork.NspProfile{ + // Name: to.Ptr("profile1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), + // Properties: &armnetwork.NspProfileProperties{ + // AccessRulesVersion: to.Ptr("0"), + // DiagnosticSettingsVersion: to.Ptr("0"), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspProfilePut.json -func ExampleSecurityPerimeterProfilesClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NspProfileDelete.json +func ExampleSecurityPerimeterProfilesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimeterProfilesClient().CreateOrUpdate(ctx, "rg1", "nsp1", "profile1", armnetwork.NspProfile{ - Properties: &armnetwork.NspProfileProperties{}, - }, nil) + res, err := clientFactory.NewSecurityPerimeterProfilesClient().Delete(ctx, "rg1", "nsp1", "profile1", 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.NspProfile = armnetwork.NspProfile{ - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspProfileProperties{ - // AccessRulesVersion: to.Ptr("0"), - // DiagnosticSettingsVersion: to.Ptr("0"), - // }, + // res = armnetwork.SecurityPerimeterProfilesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspProfileDelete.json -func ExampleSecurityPerimeterProfilesClient_Delete() { +// Generated from example definition: 2025-07-01/NspProfileGet.json +func ExampleSecurityPerimeterProfilesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewSecurityPerimeterProfilesClient().Delete(ctx, "rg1", "nsp1", "profile1", nil) + res, err := clientFactory.NewSecurityPerimeterProfilesClient().Get(ctx, "rg1", "nsp1", "profile1", 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 = armnetwork.SecurityPerimeterProfilesClientGetResponse{ + // NspProfile: armnetwork.NspProfile{ + // Name: to.Ptr("nsp1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), + // Properties: &armnetwork.NspProfileProperties{ + // AccessRulesVersion: to.Ptr("0"), + // DiagnosticSettingsVersion: to.Ptr("0"), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspProfileList.json +// Generated from example definition: 2025-07-01/NspProfileList.json func ExampleSecurityPerimeterProfilesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimeterProfilesClient().NewListPager("rg1", "nsp1", &armnetwork.SecurityPerimeterProfilesClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimeterProfilesClient().NewListPager("rg1", "nsp1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -131,42 +135,46 @@ func ExampleSecurityPerimeterProfilesClient_NewListPager() { _ = 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.NspProfileListResult = armnetwork.NspProfileListResult{ - // Value: []*armnetwork.NspProfile{ - // { - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.SecurityPerimeterProfilesClientListResponse{ + // NspProfileListResult: armnetwork.NspProfileListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspProfile{ + // { + // Name: to.Ptr("profile1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1"), + // Properties: &armnetwork.NspProfileProperties{ + // AccessRulesVersion: to.Ptr("0"), + // DiagnosticSettingsVersion: to.Ptr("0"), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // Properties: &armnetwork.NspProfileProperties{ - // AccessRulesVersion: to.Ptr("0"), - // DiagnosticSettingsVersion: to.Ptr("0"), + // { + // Name: to.Ptr("profile2"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile2"), + // Properties: &armnetwork.NspProfileProperties{ + // AccessRulesVersion: to.Ptr("0"), + // DiagnosticSettingsVersion: to.Ptr("0"), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // }, - // { - // Name: to.Ptr("profile2"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters/profiles"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile2"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.NspProfileProperties{ - // AccessRulesVersion: to.Ptr("0"), - // DiagnosticSettingsVersion: to.Ptr("0"), - // }, - // }}, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go index 3a97e2a2f7d0..6098a8f805b6 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -18,16 +17,17 @@ import ( "strings" ) -// SecurityPerimetersClient contains the methods for the NetworkSecurityPerimeters group. +// SecurityPerimetersClient contains the methods for the SecurityPerimeters group. // Don't use this type directly, use NewSecurityPerimetersClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimetersClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimetersClient creates a new instance of SecurityPerimetersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimetersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimetersClient, error) { @@ -44,9 +44,7 @@ func NewSecurityPerimetersClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates or updates a Network Security Perimeter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - parameters - Parameter supplied to create or update the network security perimeter. // - options - SecurityPerimetersClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimetersClient.CreateOrUpdate @@ -93,9 +91,10 @@ func (client *SecurityPerimetersClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -113,9 +112,7 @@ func (client *SecurityPerimetersClient) createOrUpdateHandleResponse(resp *http. // BeginDelete - Deletes a network security perimeter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimetersClientBeginDeleteOptions contains the optional parameters for the SecurityPerimetersClient.BeginDelete // method. @@ -126,8 +123,7 @@ func (client *SecurityPerimetersClient) BeginDelete(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimetersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -139,8 +135,6 @@ func (client *SecurityPerimetersClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes a network security perimeter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityPerimetersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimetersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPerimetersClient.BeginDelete" @@ -182,20 +176,17 @@ func (client *SecurityPerimetersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.ForceDeletion != nil { reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified network security perimeter by the name. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - options - SecurityPerimetersClientGetOptions contains the optional parameters for the SecurityPerimetersClient.Get method. func (client *SecurityPerimetersClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimetersClientGetOptions) (SecurityPerimetersClientGetResponse, error) { @@ -240,8 +231,8 @@ func (client *SecurityPerimetersClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -256,9 +247,7 @@ func (client *SecurityPerimetersClient) getHandleResponse(resp *http.Response) ( } // NewListPager - List network security perimeters in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SecurityPerimetersClientListOptions contains the optional parameters for the SecurityPerimetersClient.NewListPager // method. func (client *SecurityPerimetersClient) NewListPager(resourceGroupName string, options *SecurityPerimetersClientListOptions) *runtime.Pager[SecurityPerimetersClientListResponse] { @@ -306,8 +295,8 @@ func (client *SecurityPerimetersClient) listCreateRequest(ctx context.Context, r if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -322,8 +311,6 @@ func (client *SecurityPerimetersClient) listHandleResponse(resp *http.Response) } // NewListBySubscriptionPager - List all network security perimeters in a subscription. -// -// Generated from API version 2025-05-01 // - options - SecurityPerimetersClientListBySubscriptionOptions contains the optional parameters for the SecurityPerimetersClient.NewListBySubscriptionPager // method. func (client *SecurityPerimetersClient) NewListBySubscriptionPager(options *SecurityPerimetersClientListBySubscriptionOptions) *runtime.Pager[SecurityPerimetersClientListBySubscriptionResponse] { @@ -367,8 +354,8 @@ func (client *SecurityPerimetersClient) listBySubscriptionCreateRequest(ctx cont if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -384,9 +371,7 @@ func (client *SecurityPerimetersClient) listBySubscriptionHandleResponse(resp *h // Patch - Patch Tags for a Network Security Perimeter. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityPerimeterName - The name of the network security perimeter. // - parameters - Parameter supplied to the network security perimeter. // - options - SecurityPerimetersClientPatchOptions contains the optional parameters for the SecurityPerimetersClient.Patch @@ -433,9 +418,10 @@ func (client *SecurityPerimetersClient) patchCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeters_client_example_test.go index b399e3215c39..329843235dd9 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeters_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeters_client_example_test.go @@ -1,68 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterGet.json -func ExampleSecurityPerimetersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPerimetersClient().Get(ctx, "rg1", "nsp1", 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.SecurityPerimeter = armnetwork.SecurityPerimeter{ - // Name: to.Ptr("nsp1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterPut.json +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterPut.json func ExampleSecurityPerimetersClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -76,108 +33,110 @@ func ExampleSecurityPerimetersClient_CreateOrUpdate() { // 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.SecurityPerimeter = armnetwork.SecurityPerimeter{ - // Name: to.Ptr("TestNetworkSecurityPerimeter"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // res = armnetwork.SecurityPerimetersClientCreateOrUpdateResponse{ + // SecurityPerimeter: armnetwork.SecurityPerimeter{ + // Name: to.Ptr("TestNetworkSecurityPerimeter"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterDelete.json +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterDelete.json func ExampleSecurityPerimetersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityPerimetersClient().BeginDelete(ctx, "rg1", "testNSP1", &armnetwork.SecurityPerimetersClientBeginDeleteOptions{ForceDeletion: nil}) + poller, err := clientFactory.NewSecurityPerimetersClient().BeginDelete(ctx, "rg1", "testNSP1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.SecurityPerimetersClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterPatch.json -func ExampleSecurityPerimetersClient_Patch() { +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterGet.json +func ExampleSecurityPerimetersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityPerimetersClient().Patch(ctx, "rg1", "nsp1", armnetwork.UpdateTagsRequest{ - Tags: map[string]*string{ - "description": to.Ptr("nsp1"), - }, - }, nil) + res, err := clientFactory.NewSecurityPerimetersClient().Get(ctx, "rg1", "nsp1", 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.SecurityPerimeter = armnetwork.SecurityPerimeter{ - // Name: to.Ptr("TestNetworkSecurityPerimeter"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // "description": to.Ptr("nsp1"), - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // res = armnetwork.SecurityPerimetersClientGetResponse{ + // SecurityPerimeter: armnetwork.SecurityPerimeter{ + // Name: to.Ptr("nsp1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterListAll.json -func ExampleSecurityPerimetersClient_NewListBySubscriptionPager() { +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterList.json +func ExampleSecurityPerimetersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimetersClient().NewListBySubscriptionPager(&armnetwork.SecurityPerimetersClientListBySubscriptionOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimetersClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -188,66 +147,68 @@ func ExampleSecurityPerimetersClient_NewListBySubscriptionPager() { _ = 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.SecurityPerimeterListResult = armnetwork.SecurityPerimeterListResult{ - // Value: []*armnetwork.SecurityPerimeter{ - // { - // Name: to.Ptr("testNSP1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ + // page = armnetwork.SecurityPerimetersClientListResponse{ + // SecurityPerimeterListResult: armnetwork.SecurityPerimeterListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityPerimeter{ + // { + // Name: to.Ptr("testNSP1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP1"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // { + // Name: to.Ptr("testNSP2"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP2"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, // }, - // { - // Name: to.Ptr("testNSP2"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP2"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // }, - // }}, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityPerimeterList.json -func ExampleSecurityPerimetersClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterListAll.json +func ExampleSecurityPerimetersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityPerimetersClient().NewListPager("rg1", &armnetwork.SecurityPerimetersClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSecurityPerimetersClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -258,48 +219,99 @@ func ExampleSecurityPerimetersClient_NewListPager() { _ = 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.SecurityPerimeterListResult = armnetwork.SecurityPerimeterListResult{ - // Value: []*armnetwork.SecurityPerimeter{ - // { - // Name: to.Ptr("testNSP1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP1"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.SecurityPerimetersClientListBySubscriptionResponse{ + // SecurityPerimeterListResult: armnetwork.SecurityPerimeterListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityPerimeter{ + // { + // Name: to.Ptr("testNSP1"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP1"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // { + // Name: to.Ptr("testNSP2"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP2"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // }, // }, // }, - // { - // Name: to.Ptr("testNSP2"), - // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/testNSP2"), - // SystemData: &armnetwork.SecurityPerimeterSystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // CreatedBy: to.Ptr("user"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.344Z"); return t}()), - // LastModifiedBy: to.Ptr("user"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US 2 EUAP"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.SecurityPerimeterProperties{ - // PerimeterGUID: to.Ptr("guid"), - // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), - // }, - // }}, + // }, // } } } + +// Generated from example definition: 2025-07-01/NetworkSecurityPerimeterPatch.json +func ExampleSecurityPerimetersClient_Patch() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSecurityPerimetersClient().Patch(ctx, "rg1", "nsp1", armnetwork.UpdateTagsRequest{ + Tags: map[string]*string{ + "description": to.Ptr("nsp1"), + }, + }, 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 = armnetwork.SecurityPerimetersClientPatchResponse{ + // SecurityPerimeter: armnetwork.SecurityPerimeter{ + // Name: to.Ptr("TestNetworkSecurityPerimeter"), + // Type: to.Ptr("Microsoft.Network/networkSecurityPerimeters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter"), + // Location: to.Ptr("East US 2 EUAP"), + // Properties: &armnetwork.SecurityPerimeterProperties{ + // PerimeterGUID: to.Ptr("guid"), + // ProvisioningState: to.Ptr(armnetwork.NspProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SecurityPerimeterSystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // CreatedBy: to.Ptr("user"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-07T18:07:36.3446713Z"); return t}()), + // LastModifiedBy: to.Ptr("user"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // "description": to.Ptr("nsp1"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client.go index e84171598e28..4db465c9836f 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// SecurityPerimeterServiceTagsClient contains the methods for the NetworkSecurityPerimeterServiceTags group. +// SecurityPerimeterServiceTagsClient contains the methods for the SecurityPerimeterServiceTags group. // Don't use this type directly, use NewSecurityPerimeterServiceTagsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityPerimeterServiceTagsClient struct { internal *arm.Client subscriptionID string } // NewSecurityPerimeterServiceTagsClient creates a new instance of SecurityPerimeterServiceTagsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityPerimeterServiceTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterServiceTagsClient, error) { @@ -43,9 +43,7 @@ func NewSecurityPerimeterServiceTagsClient(subscriptionID string, credential azc // NewListPager - Gets the list of service tags supported by NSP. These service tags can be used to create access rules in // NSP. -// -// Generated from API version 2025-05-01 -// - location - The location of network security perimeter. +// - location - The location name. // - options - SecurityPerimeterServiceTagsClientListOptions contains the optional parameters for the SecurityPerimeterServiceTagsClient.NewListPager // method. func (client *SecurityPerimeterServiceTagsClient) NewListPager(location string, options *SecurityPerimeterServiceTagsClientListOptions) *runtime.Pager[SecurityPerimeterServiceTagsClientListResponse] { @@ -87,8 +85,8 @@ func (client *SecurityPerimeterServiceTagsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client_example_test.go index 46d9ca6ae4bd..f6c78ca3586e 100644 --- a/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterservicetags_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NspServiceTagsList.json +// Generated from example definition: 2025-07-01/NspServiceTagsList.json func ExampleSecurityPerimeterServiceTagsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,18 +33,23 @@ func ExampleSecurityPerimeterServiceTagsClient_NewListPager() { _ = 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.NspServiceTagsListResult = armnetwork.NspServiceTagsListResult{ - // Value: []*armnetwork.NspServiceTagsResource{ - // { - // ServiceTags: []*string{ - // to.Ptr("ActionGroup"), - // to.Ptr("AppConfigurationInternal"), - // to.Ptr("AzureCloud"), - // to.Ptr("PRIVATE"), - // to.Ptr("ApiManagement"), - // to.Ptr("MicrosoftPublicIPSpace"), - // to.Ptr("MicrosoftPrivateIPSpace")}, - // }}, - // } + // page = armnetwork.SecurityPerimeterServiceTagsClientListResponse{ + // NspServiceTagsListResult: armnetwork.NspServiceTagsListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/nspServiceTags?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.NspServiceTagsResource{ + // { + // ServiceTags: []*string{ + // to.Ptr("ActionGroup"), + // to.Ptr("AppConfigurationInternal"), + // to.Ptr("AzureCloud"), + // to.Ptr("PRIVATE"), + // to.Ptr("ApiManagement"), + // to.Ptr("MicrosoftPublicIPSpace"), + // to.Ptr("MicrosoftPrivateIPSpace"), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityrules_client.go b/sdk/resourcemanager/network/armnetwork/securityrules_client.go index 65a4b2dda97d..232097928212 100644 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // SecurityRulesClient contains the methods for the SecurityRules group. // Don't use this type directly, use NewSecurityRulesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityRulesClient struct { internal *arm.Client subscriptionID string } // NewSecurityRulesClient creates a new instance of SecurityRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityRulesClient, error) { @@ -43,9 +43,7 @@ func NewSecurityRulesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a security rule in the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. // - securityRuleParameters - Parameters supplied to the create or update network security rule operation. @@ -58,8 +56,7 @@ func (client *SecurityRulesClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *SecurityRulesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a security rule in the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityRulesClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *SecurityRulesClient) createOrUpdate(ctx context.Context, resourceG // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, _ *SecurityRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter securityRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityRuleParameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. // - options - SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete @@ -143,8 +137,7 @@ func (client *SecurityRulesClient) BeginDelete(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *SecurityRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityRulesClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *SecurityRulesClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, _ *SecurityRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,26 +189,19 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, errors.New("parameter securityRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. // - options - SecurityRulesClientGetOptions contains the optional parameters for the SecurityRulesClient.Get method. @@ -242,6 +230,10 @@ func (client *SecurityRulesClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, _ *SecurityRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -254,17 +246,13 @@ func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter securityRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -279,9 +267,7 @@ func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (Secur } // NewListPager - Gets all security rules in a network security group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.NewListPager method. func (client *SecurityRulesClient) NewListPager(resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) *runtime.Pager[SecurityRulesClientListResponse] { @@ -310,6 +296,10 @@ func (client *SecurityRulesClient) NewListPager(resourceGroupName string, networ // listCreateRequest creates the List request. func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, _ *SecurityRulesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -318,17 +308,13 @@ func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resour return nil, errors.New("parameter networkSecurityGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go index 1a53121e918e..ecf327140c44 100644 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go @@ -1,134 +1,140 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupRuleDelete.json -func ExampleSecurityRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupRuleCreate.json +func ExampleSecurityRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityRulesClient().BeginDelete(ctx, "rg1", "testnsg", "rule1", nil) + poller, err := clientFactory.NewSecurityRulesClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", "rule1", armnetwork.SecurityRule{ + Properties: &armnetwork.SecurityRulePropertiesFormat{ + Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), + DestinationPortRange: to.Ptr("8080"), + Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + Priority: to.Ptr[int32](100), + SourceAddressPrefix: to.Ptr("10.0.0.0/8"), + SourcePortRange: to.Ptr("*"), + Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.SecurityRulesClientCreateOrUpdateResponse{ + // SecurityRule: armnetwork.SecurityRule{ + // Name: to.Ptr("rule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), + // DestinationPortRange: to.Ptr("8080"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](100), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("10.0.0.0/8"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupRuleGet.json -func ExampleSecurityRulesClient_Get() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupRuleDelete.json +func ExampleSecurityRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityRulesClient().Get(ctx, "rg1", "testnsg", "rule1", nil) + poller, err := clientFactory.NewSecurityRulesClient().BeginDelete(ctx, "rg1", "testnsg", "rule1", 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 poll 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.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, + // res = armnetwork.SecurityRulesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupRuleCreate.json -func ExampleSecurityRulesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkSecurityGroupRuleGet.json +func ExampleSecurityRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityRulesClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", "rule1", armnetwork.SecurityRule{ - Properties: &armnetwork.SecurityRulePropertiesFormat{ - Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), - DestinationPortRange: to.Ptr("8080"), - Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - Priority: to.Ptr[int32](100), - SourceAddressPrefix: to.Ptr("10.0.0.0/8"), - SourcePortRange: to.Ptr("*"), - Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - }, - }, nil) + res, err := clientFactory.NewSecurityRulesClient().Get(ctx, "rg1", "testnsg", "rule1", 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.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), - // DestinationPortRange: to.Ptr("8080"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("10.0.0.0/8"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // res = armnetwork.SecurityRulesClientGetResponse{ + // SecurityRule: armnetwork.SecurityRule{ + // Name: to.Ptr("rule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("80"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](130), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkSecurityGroupRuleList.json +// Generated from example definition: 2025-07-01/NetworkSecurityGroupRuleList.json func ExampleSecurityRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -143,23 +149,26 @@ func ExampleSecurityRulesClient_NewListPager() { _ = 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.SecurityRuleListResult = armnetwork.SecurityRuleListResult{ - // Value: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // page = armnetwork.SecurityRulesClientListResponse{ + // SecurityRuleListResult: armnetwork.SecurityRuleListResult{ + // Value: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("rule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("80"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](130), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go index 121802b407b9..abaa8884d78a 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // SecurityUserConfigurationsClient contains the methods for the SecurityUserConfigurations group. // Don't use this type directly, use NewSecurityUserConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityUserConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewSecurityUserConfigurationsClient creates a new instance of SecurityUserConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityUserConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityUserConfigurationsClient, error) { @@ -44,8 +44,6 @@ func NewSecurityUserConfigurationsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -98,9 +96,10 @@ func (client *SecurityUserConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserConfiguration); err != nil { return nil, err } @@ -118,8 +117,6 @@ func (client *SecurityUserConfigurationsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -132,8 +129,7 @@ func (client *SecurityUserConfigurationsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityUserConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -145,8 +141,6 @@ func (client *SecurityUserConfigurationsClient) BeginDelete(ctx context.Context, // Delete - Deletes a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityUserConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityUserConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserConfigurationsClient.BeginDelete" @@ -192,19 +186,16 @@ func (client *SecurityUserConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -256,8 +247,8 @@ func (client *SecurityUserConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -272,8 +263,6 @@ func (client *SecurityUserConfigurationsClient) getHandleResponse(resp *http.Res } // NewListPager - Lists all the network manager security user configurations in a network manager, in a paginated format. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - SecurityUserConfigurationsClientListOptions contains the optional parameters for the SecurityUserConfigurationsClient.NewListPager @@ -327,8 +316,8 @@ func (client *SecurityUserConfigurationsClient) listCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go index 8f51ee73dc17..2207cedf17a5 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go @@ -1,165 +1,174 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserConfigurationList.json -func ExampleSecurityUserConfigurationsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserConfigurationPut.json +func ExampleSecurityUserConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityUserConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.SecurityUserConfigurationsClientListOptions{Top: nil, - SkipToken: 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.SecurityUserConfigurationListResult = armnetwork.SecurityUserConfigurationListResult{ - // Value: []*armnetwork.SecurityUserConfiguration{ - // { - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewSecurityUserConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityUserConfiguration{ + Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ + Description: to.Ptr("A sample policy"), + }, + }, 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 = armnetwork.SecurityUserConfigurationsClientCreateOrUpdateResponse{ + // SecurityUserConfiguration: armnetwork.SecurityUserConfiguration{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("e74045ed-c817-48df-adb2-a06753ad4fff"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserConfigurationGet.json -func ExampleSecurityUserConfigurationsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserConfigurationDelete.json +func ExampleSecurityUserConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", nil) + poller, err := clientFactory.NewSecurityUserConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityUserConfigurationsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.SecurityUserConfiguration = armnetwork.SecurityUserConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.SecurityUserConfigurationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserConfigurationPut.json -func ExampleSecurityUserConfigurationsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserConfigurationGet.json +func ExampleSecurityUserConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityUserConfiguration{ - Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - Description: to.Ptr("A sample policy"), - }, - }, nil) + res, err := clientFactory.NewSecurityUserConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", 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.SecurityUserConfiguration = armnetwork.SecurityUserConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("e74045ed-c817-48df-adb2-a06753ad4fff"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.SecurityUserConfigurationsClientGetResponse{ + // SecurityUserConfiguration: armnetwork.SecurityUserConfiguration{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserConfigurationDelete.json -func ExampleSecurityUserConfigurationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserConfigurationList.json +func ExampleSecurityUserConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityUserConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityUserConfigurationsClientBeginDeleteOptions{Force: to.Ptr(false)}) - 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) + pager := clientFactory.NewSecurityUserConfigurationsClient().NewListPager("rg1", "testNetworkManager", 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 = armnetwork.SecurityUserConfigurationsClientListResponse{ + // SecurityUserConfigurationListResult: armnetwork.SecurityUserConfigurationListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityUserConfiguration{ + // { + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), + // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go index 0f0d18fa1b1f..3c0f96449f13 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // SecurityUserRuleCollectionsClient contains the methods for the SecurityUserRuleCollections group. // Don't use this type directly, use NewSecurityUserRuleCollectionsClient() instead. +// +// Generated from API version 2025-07-01 type SecurityUserRuleCollectionsClient struct { internal *arm.Client subscriptionID string } // NewSecurityUserRuleCollectionsClient creates a new instance of SecurityUserRuleCollectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityUserRuleCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityUserRuleCollectionsClient, error) { @@ -44,8 +44,6 @@ func NewSecurityUserRuleCollectionsClient(subscriptionID string, credential azco // CreateOrUpdate - Creates or updates a security user rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -103,9 +101,10 @@ func (client *SecurityUserRuleCollectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRuleCollection); err != nil { return nil, err } @@ -123,8 +122,6 @@ func (client *SecurityUserRuleCollectionsClient) createOrUpdateHandleResponse(re // BeginDelete - Deletes a Security User Rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -138,8 +135,7 @@ func (client *SecurityUserRuleCollectionsClient) BeginDelete(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityUserRuleCollectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -151,8 +147,6 @@ func (client *SecurityUserRuleCollectionsClient) BeginDelete(ctx context.Context // Delete - Deletes a Security User Rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityUserRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *SecurityUserRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserRuleCollectionsClient.BeginDelete" @@ -202,19 +196,16 @@ func (client *SecurityUserRuleCollectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a network manager security user configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -271,8 +262,8 @@ func (client *SecurityUserRuleCollectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -287,8 +278,6 @@ func (client *SecurityUserRuleCollectionsClient) getHandleResponse(resp *http.Re } // NewListPager - Lists all the security user rule collections in a security configuration, in a paginated format. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -347,8 +336,8 @@ func (client *SecurityUserRuleCollectionsClient) listCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go index bb6c48fbca0c..40c02183addd 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go @@ -1,181 +1,194 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleCollectionList.json -func ExampleSecurityUserRuleCollectionsClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleCollectionPut.json +func ExampleSecurityUserRuleCollectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityUserRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityUserRuleCollectionsClientListOptions{Top: nil, - SkipToken: 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.SecurityUserRuleCollectionListResult = armnetwork.SecurityUserRuleCollectionListResult{ - // Value: []*armnetwork.SecurityUserRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewSecurityUserRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.SecurityUserRuleCollection{ + Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ + Description: to.Ptr("A sample policy"), + AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ + { + NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + }, + }, + }, + }, 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 = armnetwork.SecurityUserRuleCollectionsClientCreateOrUpdateResponse{ + // SecurityUserRuleCollection: armnetwork.SecurityUserRuleCollection{ + // Name: to.Ptr("myTestSecurityConfig"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample policy"), + // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleCollectionGet.json -func ExampleSecurityUserRuleCollectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleCollectionDelete.json +func ExampleSecurityUserRuleCollectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", nil) + poller, err := clientFactory.NewSecurityUserRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.SecurityUserRuleCollectionsClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.SecurityUserRuleCollection = armnetwork.SecurityUserRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.SecurityUserRuleCollectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleCollectionPut.json -func ExampleSecurityUserRuleCollectionsClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleCollectionGet.json +func ExampleSecurityUserRuleCollectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.SecurityUserRuleCollection{ - Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - { - NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - }}, - }, - }, nil) + res, err := clientFactory.NewSecurityUserRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", 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.SecurityUserRuleCollection = armnetwork.SecurityUserRuleCollection{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.SecurityUserRuleCollectionsClientGetResponse{ + // SecurityUserRuleCollection: armnetwork.SecurityUserRuleCollection{ + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleCollectionDelete.json -func ExampleSecurityUserRuleCollectionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleCollectionList.json +func ExampleSecurityUserRuleCollectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityUserRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.SecurityUserRuleCollectionsClientBeginDeleteOptions{Force: to.Ptr(false)}) - 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) + pager := clientFactory.NewSecurityUserRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", 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 = armnetwork.SecurityUserRuleCollectionsClientListResponse{ + // SecurityUserRuleCollectionListResult: armnetwork.SecurityUserRuleCollectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityUserRuleCollection{ + // { + // Name: to.Ptr("testRuleCollection"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), + // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ + // Description: to.Ptr("A sample rule collection"), + // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ + // { + // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go index bdd70de81b18..40a841223054 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // SecurityUserRulesClient contains the methods for the SecurityUserRules group. // Don't use this type directly, use NewSecurityUserRulesClient() instead. +// +// Generated from API version 2025-07-01 type SecurityUserRulesClient struct { internal *arm.Client subscriptionID string } // NewSecurityUserRulesClient creates a new instance of SecurityUserRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSecurityUserRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityUserRulesClient, error) { @@ -44,8 +44,6 @@ func NewSecurityUserRulesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates a security user rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -108,9 +106,10 @@ func (client *SecurityUserRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRule); err != nil { return nil, err } @@ -128,8 +127,6 @@ func (client *SecurityUserRulesClient) createOrUpdateHandleResponse(resp *http.R // BeginDelete - Deletes a security user rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -144,8 +141,7 @@ func (client *SecurityUserRulesClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityUserRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,8 +153,6 @@ func (client *SecurityUserRulesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a security user rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SecurityUserRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *SecurityUserRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserRulesClient.BeginDelete" @@ -212,19 +206,16 @@ func (client *SecurityUserRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets a security user rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -285,8 +276,8 @@ func (client *SecurityUserRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -301,8 +292,6 @@ func (client *SecurityUserRulesClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists all Security User Rules in a rule collection. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -366,8 +355,8 @@ func (client *SecurityUserRulesClient) listCreateRequest(ctx context.Context, re if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go index 7e7336395048..b0526971ab94 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go @@ -1,229 +1,254 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleList.json -func ExampleSecurityUserRulesClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRulePut.json +func ExampleSecurityUserRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSecurityUserRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.SecurityUserRulesClientListOptions{Top: nil, - SkipToken: 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.SecurityUserRuleListResult = armnetwork.SecurityUserRuleListResult{ - // Value: []*armnetwork.SecurityUserRule{ - // { - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } + res, err := clientFactory.NewSecurityUserRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", armnetwork.SecurityUserRule{ + Properties: &armnetwork.SecurityUserRulePropertiesFormat{ + Description: to.Ptr("Sample User Rule"), + DestinationPortRanges: []*string{ + to.Ptr("22"), + }, + Destinations: []*armnetwork.AddressPrefixItem{ + { + AddressPrefix: to.Ptr("*"), + AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + }, + }, + Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + SourcePortRanges: []*string{ + to.Ptr("0-65535"), + }, + Sources: []*armnetwork.AddressPrefixItem{ + { + AddressPrefix: to.Ptr("*"), + AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + }, + }, + Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + }, + }, 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 = armnetwork.SecurityUserRulesClientCreateOrUpdateResponse{ + // SecurityUserRule: armnetwork.SecurityUserRule{ + // Name: to.Ptr("SampleUserRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/Policy1/ruleCollections/testRuleCollection/rules/SampleUserRule"), + // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ + // Description: to.Ptr("Sample User Rule"), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleGet.json -func ExampleSecurityUserRulesClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleDelete.json +func ExampleSecurityUserRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", nil) + poller, err := clientFactory.NewSecurityUserRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", &armnetwork.SecurityUserRulesClientBeginDeleteOptions{ + Force: to.Ptr(false)}) 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 poll 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.SecurityUserRule = armnetwork.SecurityUserRule{ - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } + // res = armnetwork.SecurityUserRulesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRulePut.json -func ExampleSecurityUserRulesClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleGet.json +func ExampleSecurityUserRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSecurityUserRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", armnetwork.SecurityUserRule{ - Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - Description: to.Ptr("Sample User Rule"), - DestinationPortRanges: []*string{ - to.Ptr("22")}, - Destinations: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - SourcePortRanges: []*string{ - to.Ptr("0-65535")}, - Sources: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - }, - }, nil) + res, err := clientFactory.NewSecurityUserRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", 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.SecurityUserRule = armnetwork.SecurityUserRule{ - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/Policy1/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, + // res = armnetwork.SecurityUserRulesClientGetResponse{ + // SecurityUserRule: armnetwork.SecurityUserRule{ + // Name: to.Ptr("SampleUserRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), + // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ + // Description: to.Ptr("Sample User Rule"), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), + // }, // Destinations: []*armnetwork.AddressPrefixItem{ // { // AddressPrefix: to.Ptr("*"), // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, + // }, + // }, // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // to.Ptr("0-65535"), // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, // }, - // } + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerSecurityUserRuleDelete.json -func ExampleSecurityUserRulesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkManagerSecurityUserRuleList.json +func ExampleSecurityUserRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSecurityUserRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", &armnetwork.SecurityUserRulesClientBeginDeleteOptions{Force: to.Ptr(false)}) - 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) + pager := clientFactory.NewSecurityUserRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", 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 = armnetwork.SecurityUserRulesClientListResponse{ + // SecurityUserRuleListResult: armnetwork.SecurityUserRuleListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.SecurityUserRule{ + // { + // Name: to.Ptr("SampleUserRule"), + // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations/ruleCollections/rules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), + // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ + // Description: to.Ptr("Sample User Rule"), + // DestinationPortRanges: []*string{ + // to.Ptr("22"), + // }, + // Destinations: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), + // SourcePortRanges: []*string{ + // to.Ptr("0-65535"), + // }, + // Sources: []*armnetwork.AddressPrefixItem{ + // { + // AddressPrefix: to.Ptr("*"), + // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), + // }, + // }, + // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go index 41688735c2c5..8770c7e80b2a 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ServiceAssociationLinksClient contains the methods for the ServiceAssociationLinks group. // Don't use this type directly, use NewServiceAssociationLinksClient() instead. +// +// Generated from API version 2025-07-01 type ServiceAssociationLinksClient struct { internal *arm.Client subscriptionID string } // NewServiceAssociationLinksClient creates a new instance of ServiceAssociationLinksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceAssociationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceAssociationLinksClient, error) { @@ -43,9 +43,7 @@ func NewServiceAssociationLinksClient(subscriptionID string, credential azcore.T // List - Gets a list of service association links for a subnet. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - options - ServiceAssociationLinksClientListOptions contains the optional parameters for the ServiceAssociationLinksClient.List @@ -74,7 +72,11 @@ func (client *ServiceAssociationLinksClient) List(ctx context.Context, resourceG // listCreateRequest creates the List request. func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, _ *ServiceAssociationLinksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/serviceAssociationLinks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -87,17 +89,13 @@ func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Conte return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go index e530255a0a06..354a151b2a5c 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGetServiceAssociationLinks.json +// Generated from example definition: 2025-07-01/VirtualNetworkGetServiceAssociationLinks.json func ExampleServiceAssociationLinksClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,20 +29,24 @@ func ExampleServiceAssociationLinksClient_List() { // 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.ServiceAssociationLinksListResult = armnetwork.ServiceAssociationLinksListResult{ - // Value: []*armnetwork.ServiceAssociationLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/serviceAssociationLinks/acisal"), - // Name: to.Ptr("acisal"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/serviceAssociationLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ - // AllowDelete: to.Ptr(true), - // LinkedResourceType: to.Ptr("Microsoft.ContainerInstance/containerGroups"), - // Locations: []*string{ - // to.Ptr("westus")}, + // res = armnetwork.ServiceAssociationLinksClientListResponse{ + // ServiceAssociationLinksListResult: armnetwork.ServiceAssociationLinksListResult{ + // Value: []*armnetwork.ServiceAssociationLink{ + // { + // Name: to.Ptr("acisal"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/serviceAssociationLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/serviceAssociationLinks/acisal"), + // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ + // AllowDelete: to.Ptr(true), + // LinkedResourceType: to.Ptr("Microsoft.ContainerInstance/containerGroups"), + // Locations: []*string{ + // to.Ptr("westus"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // } + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go b/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go index 6f046daddf56..22c2db917ed6 100644 --- a/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go index f57cf22cf2e7..400580da8a81 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ServiceEndpointPoliciesClient contains the methods for the ServiceEndpointPolicies group. // Don't use this type directly, use NewServiceEndpointPoliciesClient() instead. +// +// Generated from API version 2025-07-01 type ServiceEndpointPoliciesClient struct { internal *arm.Client subscriptionID string } // NewServiceEndpointPoliciesClient creates a new instance of ServiceEndpointPoliciesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceEndpointPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPoliciesClient, error) { @@ -43,9 +43,7 @@ func NewServiceEndpointPoliciesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates or updates a service Endpoint Policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to the create or update service endpoint policy operation. // - options - ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *ServiceEndpointPoliciesClient) BeginCreateOrUpdate(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ServiceEndpointPoliciesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates or updates a service Endpoint Policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceEndpointPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdate(ctx context.Context, // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, _ *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *ServiceEndpointPoliciesClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *ServiceEndpointPoliciesClient) BeginDelete(ctx context.Context, re // Delete - Deletes the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context // deleteCreateRequest creates the Delete request. func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, _ *ServiceEndpointPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified service Endpoint Policies in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get // method. @@ -232,6 +220,10 @@ func (client *ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGr // getCreateRequest creates the Get request. func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,10 +232,6 @@ func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Contex return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -252,8 +240,8 @@ func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -268,8 +256,6 @@ func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Respon } // NewListPager - Gets all the service endpoint policies in a subscription. -// -// Generated from API version 2025-05-01 // - options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager // method. func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { @@ -297,7 +283,7 @@ func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpoi // listCreateRequest creates the List request. func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Context, _ *ServiceEndpointPoliciesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies" + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/serviceEndpointPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -307,8 +293,8 @@ func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -323,9 +309,7 @@ func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Respo } // NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager // method. func (client *ServiceEndpointPoliciesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPoliciesClientListByResourceGroupResponse] { @@ -354,21 +338,21 @@ func (client *ServiceEndpointPoliciesClient) NewListByResourceGroupPager(resourc // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ServiceEndpointPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -384,9 +368,7 @@ func (client *ServiceEndpointPoliciesClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates tags of a service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to update service endpoint policy tags. // - options - ServiceEndpointPoliciesClientUpdateTagsOptions contains the optional parameters for the ServiceEndpointPoliciesClient.UpdateTags @@ -416,6 +398,10 @@ func (client *ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, res // updateTagsCreateRequest creates the UpdateTags request. func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject, _ *ServiceEndpointPoliciesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -424,18 +410,15 @@ func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go index 19149a1bff32..9faabd6f9d43 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go @@ -1,252 +1,213 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyDelete.json -func ExampleServiceEndpointPoliciesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyCreate.json +func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginDelete(ctx, "rg1", "serviceEndpointPolicy1", nil) + poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", armnetwork.ServiceEndpointPolicy{ + Location: to.Ptr("westus"), + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyGet.json -func ExampleServiceEndpointPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceEndpointPoliciesClient().Get(ctx, "rg1", "testServiceEndpointPolicy", &armnetwork.ServiceEndpointPoliciesClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testServiceEndpointPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, + // res = armnetwork.ServiceEndpointPoliciesClientCreateOrUpdateResponse{ + // ServiceEndpointPolicy: armnetwork.ServiceEndpointPolicy{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // }, // Subnets: []*armnetwork.Subnet{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyCreate.json -func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicy() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyCreateWithDefinition.json +func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicyWithDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", armnetwork.ServiceEndpointPolicy{ Location: to.Ptr("westus"), + Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + { + Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), + Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + Description: to.Ptr("Storage Service EndpointPolicy Definition"), + Service: to.Ptr("Microsoft.Storage"), + ServiceResources: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + }, + }, + }, + }, + }, }, 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) + log.Fatalf("failed to poll 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.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // }, - // Subnets: []*armnetwork.Subnet{ + // res = armnetwork.ServiceEndpointPoliciesClientCreateOrUpdateResponse{ + // ServiceEndpointPolicy: armnetwork.ServiceEndpointPolicy{ + // Name: to.Ptr("testnsg"), + // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, + // }, + // }, + // }, + // Subnets: []*armnetwork.Subnet{ + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyCreateWithDefinition.json -func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicyWithDefinition() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyDelete.json +func ExampleServiceEndpointPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", armnetwork.ServiceEndpointPolicy{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - { - Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - Description: to.Ptr("Storage Service EndpointPolicy Definition"), - Service: to.Ptr("Microsoft.Storage"), - ServiceResources: []*string{ - to.Ptr("/subscriptions/subid1"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - }, - }}, - }, - }, nil) + poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginDelete(ctx, "rg1", "serviceEndpointPolicy1", 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) + log.Fatalf("failed to poll 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.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } + // res = armnetwork.ServiceEndpointPoliciesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyUpdateTags.json -func ExampleServiceEndpointPoliciesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyGet.json +func ExampleServiceEndpointPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceEndpointPoliciesClient().UpdateTags(ctx, "rg1", "testServiceEndpointPolicy", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewServiceEndpointPoliciesClient().Get(ctx, "rg1", "testServiceEndpointPolicy", 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.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testServiceEndpointPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // res = armnetwork.ServiceEndpointPoliciesClientGetResponse{ + // ServiceEndpointPolicy: armnetwork.ServiceEndpointPolicy{ + // Name: to.Ptr("testServiceEndpointPolicy"), + // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, // }, - // }}, + // }, + // }, // Subnets: []*armnetwork.Subnet{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyListAll.json +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyListAll.json func ExampleServiceEndpointPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -261,29 +222,32 @@ func ExampleServiceEndpointPoliciesClient_NewListPager() { _ = 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.ServiceEndpointPolicyListResult = armnetwork.ServiceEndpointPolicyListResult{ - // Value: []*armnetwork.ServiceEndpointPolicy{ - // { - // Name: to.Ptr("testPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition1"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // page = armnetwork.ServiceEndpointPoliciesClientListResponse{ + // ServiceEndpointPolicyListResult: armnetwork.ServiceEndpointPolicyListResult{ + // Value: []*armnetwork.ServiceEndpointPolicy{ + // { + // Name: to.Ptr("testPolicy"), + // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("StorageServiceEndpointPolicyDefinition1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, // }, - // }}, + // }, + // }, // Subnets: []*armnetwork.Subnet{ // }, // }, @@ -291,40 +255,44 @@ func ExampleServiceEndpointPoliciesClient_NewListPager() { // { // Name: to.Ptr("testPolicy1"), // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy2"), // Location: to.Ptr("westus"), // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition2"), // Name: to.Ptr("StorageServiceEndpointPolicyDefinition2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition2"), // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ // Description: to.Ptr("Storage Service EndpointPolicy Definition"), // Service: to.Ptr("Microsoft.Storage"), // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), // }, - // }}, - // Subnets: []*armnetwork.Subnet{ + // }, // }, // }, - // }}, - // } + // Subnets: []*armnetwork.Subnet{ + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyList.json +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyList.json func ExampleServiceEndpointPoliciesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -339,56 +307,120 @@ func ExampleServiceEndpointPoliciesClient_NewListByResourceGroupPager() { _ = 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.ServiceEndpointPolicyListResult = armnetwork.ServiceEndpointPolicyListResult{ - // Value: []*armnetwork.ServiceEndpointPolicy{ - // { - // Name: to.Ptr("testServiceEndpointPolicy"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // page = armnetwork.ServiceEndpointPoliciesClientListByResourceGroupResponse{ + // ServiceEndpointPolicyListResult: armnetwork.ServiceEndpointPolicyListResult{ + // Value: []*armnetwork.ServiceEndpointPolicy{ + // { + // Name: to.Ptr("testServiceEndpointPolicy"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, // }, - // }}, + // }, + // }, // Subnets: []*armnetwork.Subnet{ // }, // }, // }, // { // Name: to.Ptr("testServiceEndpointPolicy1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1"), // Location: to.Ptr("westus"), // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), // Name: to.Ptr("StorageServiceEndpointPolicyDefinition1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ // Description: to.Ptr("Storage Service EndpointPolicy Definition"), // Service: to.Ptr("Microsoft.Storage"), // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), // }, - // }}, - // Subnets: []*armnetwork.Subnet{ + // }, // }, // }, - // }}, - // } + // Subnets: []*armnetwork.Subnet{ + // }, + // }, + // }, + // }, + // }, + // } } } + +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyUpdateTags.json +func ExampleServiceEndpointPoliciesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceEndpointPoliciesClient().UpdateTags(ctx, "rg1", "testServiceEndpointPolicy", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.ServiceEndpointPoliciesClientUpdateTagsResponse{ + // ServiceEndpointPolicy: armnetwork.ServiceEndpointPolicy{ + // Name: to.Ptr("testServiceEndpointPolicy"), + // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, + // }, + // }, + // }, + // Subnets: []*armnetwork.Subnet{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go index 7e5b33a5f13a..4acc7ee1504c 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go index 08081a6abf48..6cf9b8df2f5f 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ServiceEndpointPolicyDefinitionsClient contains the methods for the ServiceEndpointPolicyDefinitions group. // Don't use this type directly, use NewServiceEndpointPolicyDefinitionsClient() instead. +// +// Generated from API version 2025-07-01 type ServiceEndpointPolicyDefinitionsClient struct { internal *arm.Client subscriptionID string } // NewServiceEndpointPolicyDefinitionsClient creates a new instance of ServiceEndpointPolicyDefinitionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPolicyDefinitionsClient, error) { @@ -43,11 +43,10 @@ func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceEndpointPolicyName - The name of the service endpoint policy. -// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. +// - serviceEndpointPolicyDefinitionName - The name of the resource that is unique within a resource group. This name can be +// used to access the resource. // - serviceEndpointPolicyDefinitions - Parameters supplied to the create or update service endpoint policy operation. // - options - ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate // method. @@ -58,8 +57,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginCreateOrUpdate(ctx co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +69,6 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate" @@ -97,6 +93,10 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdate(ctx context // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, _ *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +109,15 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions); err != nil { return nil, err } @@ -129,11 +126,10 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques // BeginDelete - Deletes the specified ServiceEndpoint policy definitions. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - serviceEndpointPolicyName - The name of the Service Endpoint Policy. -// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - serviceEndpointPolicyDefinitionName - The name of the resource that is unique within a resource group. This name can be +// used to access the resource. // - options - ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete // method. func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*runtime.Poller[ServiceEndpointPolicyDefinitionsClientDeleteResponse], error) { @@ -143,8 +139,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +151,6 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Co // Delete - Deletes the specified ServiceEndpoint policy definitions. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPolicyDefinitionsClient.BeginDelete" @@ -182,6 +175,10 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx contex // deleteCreateRequest creates the Delete request. func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, _ *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +191,22 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } -// Get - Get the specified service endpoint policy definitions from service endpoint policy. +// Get - Get a ServiceEndpointPolicyDefinition // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - serviceEndpointPolicyName - The name of the service endpoint policy name. -// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - serviceEndpointPolicyDefinitionName - The name of the resource that is unique within a resource group. This name can be +// used to access the resource. // - options - ServiceEndpointPolicyDefinitionsClientGetOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.Get // method. func (client *ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (ServiceEndpointPolicyDefinitionsClientGetResponse, error) { @@ -243,6 +234,10 @@ func (client *ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, r // getCreateRequest creates the Get request. func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, _ *ServiceEndpointPolicyDefinitionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +250,13 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx conte return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +271,8 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *ht } // NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - serviceEndpointPolicyName - The name of the service endpoint policy name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager // method. func (client *ServiceEndpointPolicyDefinitionsClient) NewListByResourceGroupPager(resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse] { @@ -312,6 +301,10 @@ func (client *ServiceEndpointPolicyDefinitionsClient) NewListByResourceGroupPage // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, _ *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +313,13 @@ func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateR return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go index e8d17e7e610e..03f2ffbd2130 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go @@ -1,126 +1,135 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyDefinitionDelete.json -func ExampleServiceEndpointPolicyDefinitionsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyDefinitionCreate.json +func ExampleServiceEndpointPolicyDefinitionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginDelete(ctx, "rg1", "testPolicy", "testDefinition", nil) + poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", "testDefinition", armnetwork.ServiceEndpointPolicyDefinition{ + Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + Description: to.Ptr("Storage Service EndpointPolicy Definition"), + Service: to.Ptr("Microsoft.Storage"), + ServiceResources: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse{ + // ServiceEndpointPolicyDefinition: armnetwork.ServiceEndpointPolicyDefinition{ + // Name: to.Ptr("testDefinition"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyDefinitionGet.json -func ExampleServiceEndpointPolicyDefinitionsClient_Get() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyDefinitionDelete.json +func ExampleServiceEndpointPolicyDefinitionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().Get(ctx, "rg1", "testPolicy", "testDefinition", nil) + poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginDelete(ctx, "rg1", "testPolicy", "testDefinition", 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 poll 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.ServiceEndpointPolicyDefinition = armnetwork.ServiceEndpointPolicyDefinition{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), - // Name: to.Ptr("testDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // } + // res = armnetwork.ServiceEndpointPolicyDefinitionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyDefinitionCreate.json -func ExampleServiceEndpointPolicyDefinitionsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyDefinitionGet.json +func ExampleServiceEndpointPolicyDefinitionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", "testDefinition", armnetwork.ServiceEndpointPolicyDefinition{ - Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - Description: to.Ptr("Storage Service EndpointPolicy Definition"), - Service: to.Ptr("Microsoft.Storage"), - ServiceResources: []*string{ - to.Ptr("/subscriptions/subid1"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - }, - }, nil) + res, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().Get(ctx, "rg1", "testPolicy", "testDefinition", 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.ServiceEndpointPolicyDefinition = armnetwork.ServiceEndpointPolicyDefinition{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), - // Name: to.Ptr("testDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // res = armnetwork.ServiceEndpointPolicyDefinitionsClientGetResponse{ + // ServiceEndpointPolicyDefinition: armnetwork.ServiceEndpointPolicyDefinition{ + // Name: to.Ptr("testDefinition"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceEndpointPolicyDefinitionList.json +// Generated from example definition: 2025-07-01/ServiceEndpointPolicyDefinitionList.json func ExampleServiceEndpointPolicyDefinitionsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -135,20 +144,24 @@ func ExampleServiceEndpointPolicyDefinitionsClient_NewListByResourceGroupPager() _ = 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.ServiceEndpointPolicyDefinitionListResult = armnetwork.ServiceEndpointPolicyDefinitionListResult{ - // Value: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDef"), - // Name: to.Ptr("testDef"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, + // page = armnetwork.ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{ + // ServiceEndpointPolicyDefinitionListResult: armnetwork.ServiceEndpointPolicyDefinitionListResult{ + // Value: []*armnetwork.ServiceEndpointPolicyDefinition{ + // { + // Name: to.Ptr("testDef"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDef"), + // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ + // Description: to.Ptr("Storage Service EndpointPolicy Definition"), + // Service: to.Ptr("Microsoft.Storage"), + // ServiceResources: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount"), + // }, // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/servicegateways_client.go b/sdk/resourcemanager/network/armnetwork/servicegateways_client.go index e06b99cb676c..fcc9b2d8eeff 100644 --- a/sdk/resourcemanager/network/armnetwork/servicegateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicegateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ServiceGatewaysClient contains the methods for the ServiceGateways group. // Don't use this type directly, use NewServiceGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type ServiceGatewaysClient struct { internal *arm.Client subscriptionID string } // NewServiceGatewaysClient creates a new instance of ServiceGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceGatewaysClient, error) { @@ -43,8 +43,6 @@ func NewServiceGatewaysClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates a service gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - parameters - Parameters supplied to the create or update service gateway operation. @@ -57,8 +55,7 @@ func (client *ServiceGatewaysClient) BeginCreateOrUpdate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *ServiceGatewaysClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a service gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGateway, options *ServiceGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceGatewaysClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *ServiceGatewaysClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ServiceGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGateway, _ *ServiceGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *ServiceGatewaysClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,8 +120,6 @@ func (client *ServiceGatewaysClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the specified service gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - options - ServiceGatewaysClientBeginDeleteOptions contains the optional parameters for the ServiceGatewaysClient.BeginDelete @@ -137,8 +131,7 @@ func (client *ServiceGatewaysClient) BeginDelete(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *ServiceGatewaysClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the specified service gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceGatewayName string, options *ServiceGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceGatewaysClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *ServiceGatewaysClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *ServiceGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, _ *ServiceGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,25 +179,18 @@ func (client *ServiceGatewaysClient) deleteCreateRequest(ctx context.Context, re return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified service gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - options - ServiceGatewaysClientGetOptions contains the optional parameters for the ServiceGatewaysClient.Get method. @@ -231,6 +219,10 @@ func (client *ServiceGatewaysClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *ServiceGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, _ *ServiceGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *ServiceGatewaysClient) getCreateRequest(ctx context.Context, resou return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,8 +252,6 @@ func (client *ServiceGatewaysClient) getHandleResponse(resp *http.Response) (Ser } // NewGetAddressLocationsPager - Get address locations in service gateway. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - options - ServiceGatewaysClientGetAddressLocationsOptions contains the optional parameters for the ServiceGatewaysClient.NewGetAddressLocationsPager @@ -296,6 +282,10 @@ func (client *ServiceGatewaysClient) NewGetAddressLocationsPager(resourceGroupNa // getAddressLocationsCreateRequest creates the GetAddressLocations request. func (client *ServiceGatewaysClient) getAddressLocationsCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, _ *ServiceGatewaysClientGetAddressLocationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}/addressLocations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -304,17 +294,13 @@ func (client *ServiceGatewaysClient) getAddressLocationsCreateRequest(ctx contex return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -329,8 +315,6 @@ func (client *ServiceGatewaysClient) getAddressLocationsHandleResponse(resp *htt } // NewGetServicesPager - Get Services in service gateway. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - options - ServiceGatewaysClientGetServicesOptions contains the optional parameters for the ServiceGatewaysClient.NewGetServicesPager @@ -361,6 +345,10 @@ func (client *ServiceGatewaysClient) NewGetServicesPager(resourceGroupName strin // getServicesCreateRequest creates the GetServices request. func (client *ServiceGatewaysClient) getServicesCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, _ *ServiceGatewaysClientGetServicesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}/services" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -369,17 +357,13 @@ func (client *ServiceGatewaysClient) getServicesCreateRequest(ctx context.Contex return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -394,8 +378,6 @@ func (client *ServiceGatewaysClient) getServicesHandleResponse(resp *http.Respon } // NewListPager - Gets all the service gateways in a resource group. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServiceGatewaysClientListOptions contains the optional parameters for the ServiceGatewaysClient.NewListPager // method. @@ -425,21 +407,21 @@ func (client *ServiceGatewaysClient) NewListPager(resourceGroupName string, opti // listCreateRequest creates the List request. func (client *ServiceGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *ServiceGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -454,8 +436,6 @@ func (client *ServiceGatewaysClient) listHandleResponse(resp *http.Response) (Se } // NewListAllPager - Gets all the service gateways in a subscription. -// -// Generated from API version 2025-05-01 // - options - ServiceGatewaysClientListAllOptions contains the optional parameters for the ServiceGatewaysClient.NewListAllPager // method. func (client *ServiceGatewaysClient) NewListAllPager(options *ServiceGatewaysClientListAllOptions) *runtime.Pager[ServiceGatewaysClientListAllResponse] { @@ -493,8 +473,8 @@ func (client *ServiceGatewaysClient) listAllCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -515,8 +495,6 @@ func (client *ServiceGatewaysClient) listAllHandleResponse(resp *http.Response) // For location-level partial updates, if no address is provided, the existing address will be deleted. // For address-level partial updates, if no services are provided, the existing services will be considered for deletion. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - parameters - Parameters supplied to the create or updates address locations in service gateway operation. @@ -529,8 +507,7 @@ func (client *ServiceGatewaysClient) BeginUpdateAddressLocations(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceGatewaysClientUpdateAddressLocationsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -547,8 +524,6 @@ func (client *ServiceGatewaysClient) BeginUpdateAddressLocations(ctx context.Con // For location-level partial updates, if no address is provided, the existing address will be deleted. // For address-level partial updates, if no services are provided, the existing services will be considered for deletion. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceGatewaysClient) updateAddressLocations(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGatewayUpdateAddressLocationsRequest, options *ServiceGatewaysClientBeginUpdateAddressLocationsOptions) (*http.Response, error) { var err error const operationName = "ServiceGatewaysClient.BeginUpdateAddressLocations" @@ -573,6 +548,10 @@ func (client *ServiceGatewaysClient) updateAddressLocations(ctx context.Context, // updateAddressLocationsCreateRequest creates the UpdateAddressLocations request. func (client *ServiceGatewaysClient) updateAddressLocationsCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGatewayUpdateAddressLocationsRequest, _ *ServiceGatewaysClientBeginUpdateAddressLocationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}/updateAddressLocations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -581,31 +560,25 @@ func (client *ServiceGatewaysClient) updateAddressLocationsCreateRequest(ctx con return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } return req, nil } -// BeginUpdateServices - Creates, updates, or deletes services within the service gateway. The request supports both full -// and partial update modes at the service level. -// Full update replaces all existing services with the new list provided in the request. Partial update modifies only the -// specified services. +// BeginUpdateServices - Creates, updates, or deletes services within the service gateway. +// The request supports both full and partial update modes at the service level. +// Full update replaces all existing services with the new list provided in the request. +// Partial update modifies only the specified services. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - parameters - Parameters supplied to the create or updates services in service gateway operation. @@ -618,8 +591,7 @@ func (client *ServiceGatewaysClient) BeginUpdateServices(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceGatewaysClientUpdateServicesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -629,13 +601,11 @@ func (client *ServiceGatewaysClient) BeginUpdateServices(ctx context.Context, re } } -// UpdateServices - Creates, updates, or deletes services within the service gateway. The request supports both full and partial -// update modes at the service level. -// Full update replaces all existing services with the new list provided in the request. Partial update modifies only the -// specified services. +// UpdateServices - Creates, updates, or deletes services within the service gateway. +// The request supports both full and partial update modes at the service level. +// Full update replaces all existing services with the new list provided in the request. +// Partial update modifies only the specified services. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *ServiceGatewaysClient) updateServices(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGatewayUpdateServicesRequest, options *ServiceGatewaysClientBeginUpdateServicesOptions) (*http.Response, error) { var err error const operationName = "ServiceGatewaysClient.BeginUpdateServices" @@ -660,6 +630,10 @@ func (client *ServiceGatewaysClient) updateServices(ctx context.Context, resourc // updateServicesCreateRequest creates the UpdateServices request. func (client *ServiceGatewaysClient) updateServicesCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters ServiceGatewayUpdateServicesRequest, _ *ServiceGatewaysClientBeginUpdateServicesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}/updateServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -668,18 +642,14 @@ func (client *ServiceGatewaysClient) updateServicesCreateRequest(ctx context.Con return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -688,8 +658,6 @@ func (client *ServiceGatewaysClient) updateServicesCreateRequest(ctx context.Con // UpdateTags - Updates a service gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceGatewayName - The name of the service gateway. // - parameters - Parameters supplied to update service gateway tags. @@ -720,6 +688,10 @@ func (client *ServiceGatewaysClient) UpdateTags(ctx context.Context, resourceGro // updateTagsCreateRequest creates the UpdateTags request. func (client *ServiceGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serviceGatewayName string, parameters TagsObject, _ *ServiceGatewaysClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceGateways/{serviceGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -728,18 +700,15 @@ func (client *ServiceGatewaysClient) updateTagsCreateRequest(ctx context.Context return nil, errors.New("parameter serviceGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serviceGatewayName}", url.PathEscape(serviceGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/servicegateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicegateways_client_example_test.go index b8f8e79bf08f..de20dd3e76a5 100644 --- a/sdk/resourcemanager/network/armnetwork/servicegateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicegateways_client_example_test.go @@ -1,90 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayDelete.json -func ExampleServiceGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceGatewaysClient().BeginDelete(ctx, "rg1", "sg", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayGet.json -func ExampleServiceGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceGatewaysClient().Get(ctx, "rg1", "sg", 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.ServiceGateway = armnetwork.ServiceGateway{ - // Name: to.Ptr("sg"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), - // }, - // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayCreate.json +// Generated from example definition: 2025-07-01/ServiceGatewayCreate.json func ExampleServiceGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -108,94 +43,112 @@ func ExampleServiceGatewaysClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ServiceGateway = armnetwork.ServiceGateway{ - // Name: to.Ptr("sg"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // res = armnetwork.ServiceGatewaysClientCreateOrUpdateResponse{ + // ServiceGateway: armnetwork.ServiceGateway{ + // Name: to.Ptr("sg"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, - // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayUpdateTags.json -func ExampleServiceGatewaysClient_UpdateTags() { +// Generated from example definition: 2025-07-01/ServiceGatewayDelete.json +func ExampleServiceGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceGatewaysClient().UpdateTags(ctx, "rg1", "sg", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewServiceGatewaysClient().BeginDelete(ctx, "rg1", "sg", 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 poll the result: %v", err) + } +} + +// Generated from example definition: 2025-07-01/ServiceGatewayGet.json +func ExampleServiceGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceGatewaysClient().Get(ctx, "rg1", "sg", 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.ServiceGateway = armnetwork.ServiceGateway{ - // Name: to.Ptr("sg"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // res = armnetwork.ServiceGatewaysClientGetResponse{ + // ServiceGateway: armnetwork.ServiceGateway{ + // Name: to.Ptr("sg"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, - // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayListAll.json -func ExampleServiceGatewaysClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/ServiceGatewayGetAddressLocationsResponse.json +func ExampleServiceGatewaysClient_NewGetAddressLocationsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServiceGatewaysClient().NewListAllPager(nil) + pager := clientFactory.NewServiceGatewaysClient().NewGetAddressLocationsPager("rg1", "sg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -206,62 +159,102 @@ func ExampleServiceGatewaysClient_NewListAllPager() { _ = 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.ServiceGatewayListResult = armnetwork.ServiceGatewayListResult{ - // Value: []*armnetwork.ServiceGateway{ - // { - // Name: to.Ptr("sg"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // page = armnetwork.ServiceGatewaysClientGetAddressLocationsResponse{ + // GetServiceGatewayAddressLocationsResult: armnetwork.GetServiceGatewayAddressLocationsResult{ + // Value: []*armnetwork.ServiceGatewayAddressLocationResponse{ + // { + // AddressLocation: to.Ptr("192.0.0.1"), + // Addresses: []*armnetwork.ServiceGatewayAddress{ + // { + // Address: to.Ptr("10.0.0.4"), + // Services: []*string{ + // to.Ptr("Service1"), + // }, // }, // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, + // { + // AddressLocation: to.Ptr("192.0.0.2"), + // Addresses: []*armnetwork.ServiceGatewayAddress{ + // { + // Address: to.Ptr("10.0.0.5"), + // Services: []*string{ + // to.Ptr("Service2"), + // }, + // }, // }, // }, // }, - // { - // Name: to.Ptr("sg2"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/ServiceGatewayGetServicesResponse.json +func ExampleServiceGatewaysClient_NewGetServicesPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServiceGatewaysClient().NewGetServicesPager("rg1", "sg", 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 = armnetwork.ServiceGatewaysClientGetServicesResponse{ + // GetServiceGatewayServicesResult: armnetwork.GetServiceGatewayServicesResult{ + // Value: []*armnetwork.ServiceGatewayService{ + // { + // Name: to.Ptr("Service1"), + // Properties: &armnetwork.ServiceGatewayServicePropertiesFormat{ + // IsDefault: to.Ptr(true), + // LoadBalancerBackendPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), + // }, // }, + // PublicNatGatewayID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // ServiceType: to.Ptr(armnetwork.ServiceTypeInbound), // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, + // { + // Name: to.Ptr("Service2"), + // Properties: &armnetwork.ServiceGatewayServicePropertiesFormat{ + // IsDefault: to.Ptr(false), + // LoadBalancerBackendPools: []*armnetwork.BackendAddressPool{ + // { + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), + // }, + // }, + // PublicNatGatewayID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + // ServiceType: to.Ptr(armnetwork.ServiceTypeOutbound), // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayList.json +// Generated from example definition: 2025-07-01/ServiceGatewayList.json func ExampleServiceGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -276,62 +269,138 @@ func ExampleServiceGatewaysClient_NewListPager() { _ = 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.ServiceGatewayListResult = armnetwork.ServiceGatewayListResult{ - // Value: []*armnetwork.ServiceGateway{ - // { - // Name: to.Ptr("sg"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // page = armnetwork.ServiceGatewaysClientListResponse{ + // ServiceGatewayListResult: armnetwork.ServiceGatewayListResult{ + // Value: []*armnetwork.ServiceGateway{ + // { + // Name: to.Ptr("sg"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, + // { + // Name: to.Ptr("sg2"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, // }, // }, // }, - // { - // Name: to.Ptr("sg2"), - // Type: to.Ptr("Microsoft.Network/serviceGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/ServiceGatewayListAll.json +func ExampleServiceGatewaysClient_NewListAllPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServiceGatewaysClient().NewListAllPager(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 = armnetwork.ServiceGatewaysClientListAllResponse{ + // ServiceGatewayListResult: armnetwork.ServiceGatewayListResult{ + // Value: []*armnetwork.ServiceGateway{ + // { + // Name: to.Ptr("sg"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), // }, // }, - // VirtualNetwork: &armnetwork.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, + // { + // Name: to.Ptr("sg2"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayFullUpdateAddressLocationsRequest.json +// Generated from example definition: 2025-07-01/ServiceGatewayFullUpdateAddressLocationsRequest.json func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_fullUpdateCreateUpdateOrDeleteAddressLocationsInTheServiceGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -345,8 +414,10 @@ func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_fullUpdateCreateUp { Address: to.Ptr("10.0.0.4"), Services: []*string{ - to.Ptr("Service1")}, - }}, + to.Ptr("Service1"), + }, + }, + }, }, { AddressLocation: to.Ptr("192.0.0.2"), @@ -355,30 +426,33 @@ func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_fullUpdateCreateUp { Address: to.Ptr("10.0.0.5"), Services: []*string{ - to.Ptr("Service2")}, + to.Ptr("Service2"), + }, }, { Address: to.Ptr("10.0.0.6"), - }}, - }}, + }, + }, + }, + }, }, 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) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayPartialUpdateAddressLocationsRequest.json +// Generated from example definition: 2025-07-01/ServiceGatewayPartialUpdateAddressLocationsRequest.json func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_partialUpdateCreateUpdateOrDeleteAddressLocationsInTheServiceGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -392,8 +466,10 @@ func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_partialUpdateCreat { Address: to.Ptr("10.0.0.4"), Services: []*string{ - to.Ptr("Service1")}, - }}, + to.Ptr("Service1"), + }, + }, + }, }, { AddressLocation: to.Ptr("192.0.0.2"), @@ -402,33 +478,36 @@ func ExampleServiceGatewaysClient_BeginUpdateAddressLocations_partialUpdateCreat { Address: to.Ptr("10.0.0.5"), Services: []*string{ - to.Ptr("Service2")}, + to.Ptr("Service2"), + }, }, { Address: to.Ptr("10.0.0.6"), - }}, + }, + }, }, { AddressLocation: to.Ptr("192.0.0.3"), - }}, + }, + }, }, 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) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayUpdateServicesRequest.json +// Generated from example definition: 2025-07-01/ServiceGatewayUpdateServicesRequest.json func ExampleServiceGatewaysClient_BeginUpdateServices() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -442,9 +521,10 @@ func ExampleServiceGatewaysClient_BeginUpdateServices() { IsDefault: to.Ptr(true), LoadBalancerBackendPools: []*armnetwork.BackendAddressPool{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), - }}, - PublicNatGatewayID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), + }, + }, + PublicNatGatewayID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), ServiceType: to.Ptr(armnetwork.ServiceTypeInbound), }, }, @@ -458,111 +538,64 @@ func ExampleServiceGatewaysClient_BeginUpdateServices() { ServiceType: to.Ptr(armnetwork.ServiceTypeOutbound), }, }, - }}, + }, + }, }, 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) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayGetAddressLocationsResponse.json -func ExampleServiceGatewaysClient_NewGetAddressLocationsPager() { +// Generated from example definition: 2025-07-01/ServiceGatewayUpdateTags.json +func ExampleServiceGatewaysClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServiceGatewaysClient().NewGetAddressLocationsPager("rg1", "sg", 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.GetServiceGatewayAddressLocationsResult = armnetwork.GetServiceGatewayAddressLocationsResult{ - // Value: []*armnetwork.ServiceGatewayAddressLocationResponse{ - // { - // AddressLocation: to.Ptr("192.0.0.1"), - // Addresses: []*armnetwork.ServiceGatewayAddress{ - // { - // Address: to.Ptr("10.0.0.4"), - // Services: []*string{ - // to.Ptr("Service1")}, - // }}, - // }, - // { - // AddressLocation: to.Ptr("192.0.0.2"), - // Addresses: []*armnetwork.ServiceGatewayAddress{ - // { - // Address: to.Ptr("10.0.0.5"), - // Services: []*string{ - // to.Ptr("Service2")}, - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceGatewayGetServicesResponse.json -func ExampleServiceGatewaysClient_NewGetServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := clientFactory.NewServiceGatewaysClient().UpdateTags(ctx, "rg1", "sg", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceGatewaysClient().NewGetServicesPager("rg1", "sg", 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.GetServiceGatewayServicesResult = armnetwork.GetServiceGatewayServicesResult{ - // Value: []*armnetwork.ServiceGatewayService{ - // { - // Name: to.Ptr("Service1"), - // Properties: &armnetwork.ServiceGatewayServicePropertiesFormat{ - // IsDefault: to.Ptr(true), - // LoadBalancerBackendPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), - // }}, - // PublicNatGatewayID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // ServiceType: to.Ptr(armnetwork.ServiceTypeInbound), - // }, - // }, - // { - // Name: to.Ptr("Service2"), - // Properties: &armnetwork.ServiceGatewayServicePropertiesFormat{ - // IsDefault: to.Ptr(false), - // LoadBalancerBackendPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/be1"), - // }}, - // PublicNatGatewayID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // ServiceType: to.Ptr(armnetwork.ServiceTypeOutbound), - // }, - // }}, - // } + 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 = armnetwork.ServiceGatewaysClientUpdateTagsResponse{ + // ServiceGateway: armnetwork.ServiceGateway{ + // Name: to.Ptr("sg"), + // Type: to.Ptr("Microsoft.Network/serviceGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/sg"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.ServiceGatewayPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RouteTargetAddress: &armnetwork.RouteTargetAddressPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet"), + // }, + // }, + // VirtualNetwork: &armnetwork.VirtualNetwork{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet"), + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go index aabe0f302047..2a1eead80756 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // ServiceTagInformationClient contains the methods for the ServiceTagInformation group. // Don't use this type directly, use NewServiceTagInformationClient() instead. +// +// Generated from API version 2025-07-01 type ServiceTagInformationClient struct { internal *arm.Client subscriptionID string } // NewServiceTagInformationClient creates a new instance of ServiceTagInformationClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceTagInformationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagInformationClient, error) { @@ -43,11 +43,7 @@ func NewServiceTagInformationClient(subscriptionID string, credential azcore.Tok } // NewListPager - Gets a list of service tag information resources with pagination. -// -// Generated from API version 2025-05-01 -// - location - The location that will be used as a reference for cloud (not as a filter based on location, you will get the -// list of service tags with prefix details across all regions but limited to the cloud that -// your subscription belongs to). +// - location - The location name. // - options - ServiceTagInformationClientListOptions contains the optional parameters for the ServiceTagInformationClient.NewListPager // method. func (client *ServiceTagInformationClient) NewListPager(location string, options *ServiceTagInformationClientListOptions) *runtime.Pager[ServiceTagInformationClientListResponse] { @@ -76,27 +72,27 @@ func (client *ServiceTagInformationClient) NewListPager(location string, options // listCreateRequest creates the List request. func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagInformationClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.NoAddressPrefixes != nil { reqQP.Set("noAddressPrefixes", strconv.FormatBool(*options.NoAddressPrefixes)) } if options != nil && options.TagName != nil { reqQP.Set("tagName", *options.TagName) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go index 8d3e480b0b60..cfa9f5ea2068 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go @@ -1,34 +1,29 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceTagInformationListResult.json +// Generated from example definition: 2025-07-01/ServiceTagInformationListResult.json func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: nil, - }) + pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -39,16 +34,18 @@ func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTags() { _ = 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.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // page = armnetwork.ServiceTagInformationClientListResponse{ + // ServiceTagInformationListResult: armnetwork.ServiceTagInformationListResult{ + // Value: []*armnetwork.ServiceTagInformation{ + // { + // Name: to.Ptr("ApiManagement"), + // ID: to.Ptr("ApiManagement"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ChangeNumber: to.Ptr("7"), // Region: to.Ptr(""), // SystemService: to.Ptr("AzureApiManagement"), @@ -60,30 +57,32 @@ func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTags() { // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ // AddressPrefixes: []*string{ // to.Ptr("20.36.106.68/31"), - // to.Ptr("20.36.107.176/28")}, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), + // to.Ptr("20.36.107.176/28"), // }, - // }}, - // } + // ChangeNumber: to.Ptr("2"), + // Region: to.Ptr("australiacentral"), + // SystemService: to.Ptr("AzureApiManagement"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceTagInformationListResultWithNoAddressPrefixes.json +// Generated from example definition: 2025-07-01/ServiceTagInformationListResultWithNoAddressPrefixes.json func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithNoAddressPrefixes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: to.Ptr(true), - TagName: nil, - }) + pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{ + NoAddressPrefixes: to.Ptr(true)}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -94,48 +93,50 @@ func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithNoA _ = 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.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ + // page = armnetwork.ServiceTagInformationClientListResponse{ + // ServiceTagInformationListResult: armnetwork.ServiceTagInformationListResult{ + // Value: []*armnetwork.ServiceTagInformation{ + // { + // Name: to.Ptr("ApiManagement"), + // ID: to.Ptr("ApiManagement"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // }, + // ChangeNumber: to.Ptr("7"), + // Region: to.Ptr(""), + // SystemService: to.Ptr("AzureApiManagement"), // }, - // ChangeNumber: to.Ptr("7"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureApiManagement"), // }, - // }, - // { - // Name: to.Ptr("ApiManagement.AustraliaCentral"), - // ID: to.Ptr("ApiManagement.AustraliaCentral"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ + // { + // Name: to.Ptr("ApiManagement.AustraliaCentral"), + // ID: to.Ptr("ApiManagement.AustraliaCentral"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // }, + // ChangeNumber: to.Ptr("2"), + // Region: to.Ptr("australiacentral"), + // SystemService: to.Ptr("AzureApiManagement"), // }, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceTagInformationListResultWithTagname.json +// Generated from example definition: 2025-07-01/ServiceTagInformationListResultWithTagname.json func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithTagName() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: to.Ptr("ApiManagement"), - }) + pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{ + TagName: to.Ptr("ApiManagement")}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -146,21 +147,25 @@ func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithTag _ = 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.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // page = armnetwork.ServiceTagInformationClientListResponse{ + // ServiceTagInformationListResult: armnetwork.ServiceTagInformationListResult{ + // Value: []*armnetwork.ServiceTagInformation{ + // { + // Name: to.Ptr("ApiManagement"), + // ID: to.Ptr("ApiManagement"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ChangeNumber: to.Ptr("7"), // Region: to.Ptr(""), // SystemService: to.Ptr("AzureApiManagement"), // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_client.go b/sdk/resourcemanager/network/armnetwork/servicetags_client.go index 564b7971181c..e114c3e5288b 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // ServiceTagsClient contains the methods for the ServiceTags group. // Don't use this type directly, use NewServiceTagsClient() instead. +// +// Generated from API version 2025-07-01 type ServiceTagsClient struct { internal *arm.Client subscriptionID string } // NewServiceTagsClient creates a new instance of ServiceTagsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewServiceTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagsClient, error) { @@ -43,11 +43,7 @@ func NewServiceTagsClient(subscriptionID string, credential azcore.TokenCredenti // List - Gets a list of service tag information resources. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - location - The location that will be used as a reference for version (not as a filter based on location, you will get the -// list of service tags with prefix details across all regions but limited to the cloud that -// your subscription belongs to). +// - location - The location name. // - options - ServiceTagsClientListOptions contains the optional parameters for the ServiceTagsClient.List method. func (client *ServiceTagsClient) List(ctx context.Context, location string, options *ServiceTagsClientListOptions) (ServiceTagsClientListResponse, error) { var err error @@ -74,21 +70,21 @@ func (client *ServiceTagsClient) List(ctx context.Context, location string, opti // listCreateRequest creates the List request. func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location string, _ *ServiceTagsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go index 96e086247052..0105b4ab1d51 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/ServiceTagsList.json +// Generated from example definition: 2025-07-01/ServiceTagsList.json func ExampleServiceTagsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,21 +29,24 @@ func ExampleServiceTagsClient_List() { // 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.ServiceTagsListResult = armnetwork.ServiceTagsListResult{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.Network/serviceTags"), - // ChangeNumber: to.Ptr("63"), - // Cloud: to.Ptr("Public"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/serviceTags/public"), - // Values: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, + // res = armnetwork.ServiceTagsClientListResponse{ + // ServiceTagsListResult: armnetwork.ServiceTagsListResult{ + // Name: to.Ptr("public"), + // Type: to.Ptr("Microsoft.Network/serviceTags"), + // ChangeNumber: to.Ptr("63"), + // Cloud: to.Ptr("Public"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/serviceTags/public"), + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/serviceTags?api-version=2020-06-01&changenumber=changenumber&$skipToken={skipToken}"), + // Values: []*armnetwork.ServiceTagInformation{ + // { + // Name: to.Ptr("ApiManagement"), + // ID: to.Ptr("ApiManagement"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("13.64.39.16/32"), + // to.Ptr("40.74.146.80/31"), + // to.Ptr("40.74.147.32/28"), + // }, // ChangeNumber: to.Ptr("7"), // Region: to.Ptr(""), // SystemService: to.Ptr("AzureApiManagement"), @@ -58,49 +58,55 @@ func ExampleServiceTagsClient_List() { // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ // AddressPrefixes: []*string{ // to.Ptr("20.36.106.68/31"), - // to.Ptr("20.36.107.176/28")}, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), + // to.Ptr("20.36.107.176/28"), + // }, + // ChangeNumber: to.Ptr("2"), + // Region: to.Ptr("australiacentral"), + // SystemService: to.Ptr("AzureApiManagement"), + // }, + // }, + // { + // Name: to.Ptr("AppService"), + // ID: to.Ptr("AppService"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("13.64.73.110/32"), + // to.Ptr("191.235.208.12/32"), + // to.Ptr("191.235.215.184/32"), // }, + // ChangeNumber: to.Ptr("13"), + // Region: to.Ptr(""), + // SystemService: to.Ptr("AzureAppService"), + // }, + // }, + // { + // Name: to.Ptr("ServiceBus"), + // ID: to.Ptr("ServiceBus"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("23.98.82.96/29"), + // to.Ptr("40.68.127.68/32"), + // to.Ptr("40.70.146.64/29"), + // }, + // ChangeNumber: to.Ptr("10"), + // Region: to.Ptr(""), + // SystemService: to.Ptr("AzureServiceBus"), // }, - // { - // Name: to.Ptr("AppService"), - // ID: to.Ptr("AppService"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.73.110/32"), - // to.Ptr("191.235.208.12/32"), - // to.Ptr("191.235.215.184/32")}, - // ChangeNumber: to.Ptr("13"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureAppService"), - // }, + // }, + // { + // Name: to.Ptr("ServiceBus.EastUS2"), + // ID: to.Ptr("ServiceBus.EastUS2"), + // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ + // AddressPrefixes: []*string{ + // to.Ptr("13.68.110.36/32"), + // to.Ptr("40.70.146.64/29"), // }, - // { - // Name: to.Ptr("ServiceBus"), - // ID: to.Ptr("ServiceBus"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("23.98.82.96/29"), - // to.Ptr("40.68.127.68/32"), - // to.Ptr("40.70.146.64/29")}, - // ChangeNumber: to.Ptr("10"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureServiceBus"), - // }, - // }, - // { - // Name: to.Ptr("ServiceBus.EastUS2"), - // ID: to.Ptr("ServiceBus.EastUS2"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.68.110.36/32"), - // to.Ptr("40.70.146.64/29")}, - // ChangeNumber: to.Ptr("1"), - // Region: to.Ptr("eastus2"), - // SystemService: to.Ptr("AzureServiceBus"), - // }, - // }}, - // } + // ChangeNumber: to.Ptr("1"), + // Region: to.Ptr("eastus2"), + // SystemService: to.Ptr("AzureServiceBus"), + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go index bb1ebd97db8d..89ae17afd4c2 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go index 36ae3f852737..8ee6f753b01c 100644 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // StaticCidrsClient contains the methods for the StaticCidrs group. // Don't use this type directly, use NewStaticCidrsClient() instead. +// +// Generated from API version 2025-07-01 type StaticCidrsClient struct { internal *arm.Client subscriptionID string } // NewStaticCidrsClient creates a new instance of StaticCidrsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewStaticCidrsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StaticCidrsClient, error) { @@ -43,21 +43,21 @@ func NewStaticCidrsClient(subscriptionID string, credential azcore.TokenCredenti } // Create - Creates/Updates the Static CIDR resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkManagerName - The name of the network manager. -// - poolName - IP Address Manager Pool resource name. -// - staticCidrName - Static Cidr allocation name. +// Creates/Updates the Static CIDR resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - poolName - The name of the IPAM pool. +// - staticCidrName - Name for the static CIDR. +// - body - StaticCidr resource object to create/update. // - options - StaticCidrsClientCreateOptions contains the optional parameters for the StaticCidrsClient.Create method. -func (client *StaticCidrsClient) Create(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientCreateOptions) (StaticCidrsClientCreateResponse, error) { +func (client *StaticCidrsClient) Create(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, body StaticCidr, options *StaticCidrsClientCreateOptions) (StaticCidrsClientCreateResponse, error) { var err error const operationName = "StaticCidrsClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, networkManagerName, poolName, staticCidrName, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, networkManagerName, poolName, staticCidrName, body, options) if err != nil { return StaticCidrsClientCreateResponse{}, err } @@ -74,7 +74,7 @@ func (client *StaticCidrsClient) Create(ctx context.Context, resourceGroupName s } // createCreateRequest creates the Create request. -func (client *StaticCidrsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientCreateOptions) (*policy.Request, error) { +func (client *StaticCidrsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, body StaticCidr, _ *StaticCidrsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/ipamPools/{poolName}/staticCidrs/{staticCidrName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,14 +101,12 @@ func (client *StaticCidrsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Body != nil { - if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { - return nil, err - } - return req, nil + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err } return req, nil } @@ -123,13 +121,13 @@ func (client *StaticCidrsClient) createHandleResponse(resp *http.Response) (Stat } // BeginDelete - Delete the Static CIDR resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Delete the Static CIDR resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. -// - staticCidrName - StaticCidr resource name to delete. +// - staticCidrName - StaticCidr resource name to retrieve. // - options - StaticCidrsClientBeginDeleteOptions contains the optional parameters for the StaticCidrsClient.BeginDelete method. func (client *StaticCidrsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientBeginDeleteOptions) (*runtime.Poller[StaticCidrsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -138,8 +136,7 @@ func (client *StaticCidrsClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StaticCidrsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,9 +147,9 @@ func (client *StaticCidrsClient) BeginDelete(ctx context.Context, resourceGroupN } // Delete - Delete the Static CIDR resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 +// Delete the Static CIDR resource. +// If the operation fails it returns an *azcore.ResponseError type. func (client *StaticCidrsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "StaticCidrsClient.BeginDelete" @@ -202,17 +199,16 @@ func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specific Static CIDR resource. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets the specific Static CIDR resource. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - staticCidrName - StaticCidr resource name to retrieve. @@ -267,8 +263,8 @@ func (client *StaticCidrsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -284,8 +280,8 @@ func (client *StaticCidrsClient) getHandleResponse(resp *http.Response) (StaticC // NewListPager - Gets list of Static CIDR resources at Network Manager level. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets list of Static CIDR resources at Network Manager level. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. // - options - StaticCidrsClientListOptions contains the optional parameters for the StaticCidrsClient.NewListPager method. @@ -336,7 +332,7 @@ func (client *StaticCidrsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -352,7 +348,7 @@ func (client *StaticCidrsClient) listCreateRequest(ctx context.Context, resource if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go index bf83f9415698..b86f20376a00 100644 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go @@ -1,121 +1,88 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/StaticCidrs_List.json -func ExampleStaticCidrsClient_NewListPager() { +// Generated from example definition: 2025-07-01/StaticCidrs_Create.json +func ExampleStaticCidrsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewStaticCidrsClient().NewListPager("rg1", "TestNetworkManager", "TestPool", &armnetwork.StaticCidrsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.StaticCidrList = armnetwork.StaticCidrList{ - // Value: []*armnetwork.StaticCidr{ - // { - // Name: to.Ptr("TestStaticCidr"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // NumberOfIPAddressesToAllocate: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TotalNumberOfIPAddresses: to.Ptr("256"), - // }, - // }}, - // } + res, err := clientFactory.NewStaticCidrsClient().Create(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", armnetwork.StaticCidr{}, 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 = armnetwork.StaticCidrsClientCreateResponse{ + // StaticCidr: armnetwork.StaticCidr{ + // Name: to.Ptr("OnPremResources"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/TestStaticCidr"), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), + // Properties: &armnetwork.StaticCidrProperties{ + // Description: to.Ptr("test description"), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // NumberOfIPAddressesToAllocate: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/StaticCidrs_Create.json -func ExampleStaticCidrsClient_Create() { +// Generated from example definition: 2025-07-01/StaticCidrs_Delete.json +func ExampleStaticCidrsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewStaticCidrsClient().Create(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", &armnetwork.StaticCidrsClientCreateOptions{Body: nil}) + poller, err := clientFactory.NewStaticCidrsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", 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.StaticCidr = armnetwork.StaticCidr{ - // Name: to.Ptr("OnPremResources"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/TestStaticCidr"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // NumberOfIPAddressesToAllocate: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/StaticCidrs_Get.json +// Generated from example definition: 2025-07-01/StaticCidrs_Get.json func ExampleStaticCidrsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -126,46 +93,82 @@ func ExampleStaticCidrsClient_Get() { // 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.StaticCidr = armnetwork.StaticCidr{ - // Name: to.Ptr("TestStaticCidr"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.StaticCidrsClientGetResponse{ + // StaticCidr: armnetwork.StaticCidr{ + // Name: to.Ptr("TestStaticCidr"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), + // Properties: &armnetwork.StaticCidrProperties{ + // Description: to.Ptr("test description"), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, // NumberOfIPAddressesToAllocate: to.Ptr(""), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // TotalNumberOfIPAddresses: to.Ptr("256"), // }, - // } + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/StaticCidrs_Delete.json -func ExampleStaticCidrsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/StaticCidrs_List.json +func ExampleStaticCidrsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewStaticCidrsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", 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) + pager := clientFactory.NewStaticCidrsClient().NewListPager("rg1", "TestNetworkManager", "TestPool", 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 = armnetwork.StaticCidrsClientListResponse{ + // StaticCidrList: armnetwork.StaticCidrList{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.StaticCidr{ + // { + // Name: to.Ptr("TestStaticCidr"), + // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), + // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), + // Properties: &armnetwork.StaticCidrProperties{ + // Description: to.Ptr("test description"), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/24"), + // }, + // NumberOfIPAddressesToAllocate: to.Ptr(""), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // TotalNumberOfIPAddresses: to.Ptr("256"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go index a9c38988af26..22561db0ffaa 100644 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // StaticMembersClient contains the methods for the StaticMembers group. // Don't use this type directly, use NewStaticMembersClient() instead. +// +// Generated from API version 2025-07-01 type StaticMembersClient struct { internal *arm.Client subscriptionID string } // NewStaticMembersClient creates a new instance of StaticMembersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewStaticMembersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StaticMembersClient, error) { @@ -44,9 +44,7 @@ func NewStaticMembersClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates a static member. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - staticMemberName - The name of the static member. @@ -103,9 +101,10 @@ func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -123,9 +122,7 @@ func (client *StaticMembersClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a static member. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - staticMemberName - The name of the static member. @@ -179,17 +176,14 @@ func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified static member. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - staticMemberName - The name of the static member. @@ -244,8 +238,8 @@ func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -260,9 +254,7 @@ func (client *StaticMembersClient) getHandleResponse(resp *http.Response) (Stati } // NewListPager - Lists the specified static member. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. // - options - StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.NewListPager method. @@ -319,8 +311,8 @@ func (client *StaticMembersClient) listCreateRequest(ctx context.Context, resour if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go index 2ea0a2892258..54eb0252bebf 100644 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go @@ -1,129 +1,133 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerStaticMemberGet.json -func ExampleStaticMembersClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerStaticMemberPut.json +func ExampleStaticMembersClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewStaticMembersClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", nil) + res, err := clientFactory.NewStaticMembersClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", armnetwork.StaticMember{ + Properties: &armnetwork.StaticMemberProperties{ + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), + }, + }, 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.StaticMember = armnetwork.StaticMember{ - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.StaticMembersClientCreateOrUpdateResponse{ + // StaticMember: armnetwork.StaticMember{ + // Name: to.Ptr("testStaticMember"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), + // Properties: &armnetwork.StaticMemberProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Region: to.Ptr("useast2"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerStaticMemberPut.json -func ExampleStaticMembersClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkManagerStaticMemberDelete.json +func ExampleStaticMembersClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewStaticMembersClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", armnetwork.StaticMember{ - Properties: &armnetwork.StaticMemberProperties{ - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - }, - }, nil) + res, err := clientFactory.NewStaticMembersClient().Delete(ctx, "SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", 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.StaticMember = armnetwork.StaticMember{ - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Region: to.Ptr("useast2"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.StaticMembersClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerStaticMemberDelete.json -func ExampleStaticMembersClient_Delete() { +// Generated from example definition: 2025-07-01/NetworkManagerStaticMemberGet.json +func ExampleStaticMembersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewStaticMembersClient().Delete(ctx, "SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", nil) + res, err := clientFactory.NewStaticMembersClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", 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 = armnetwork.StaticMembersClientGetResponse{ + // StaticMember: armnetwork.StaticMember{ + // Name: to.Ptr("testStaticMember"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), + // Properties: &armnetwork.StaticMemberProperties{ + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerStaticMemberList.json +// Generated from example definition: 2025-07-01/NetworkManagerStaticMemberList.json func ExampleStaticMembersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewStaticMembersClient().NewListPager("rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.StaticMembersClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewStaticMembersClient().NewListPager("rg1", "testNetworkManager", "testNetworkGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -134,26 +138,30 @@ func ExampleStaticMembersClient_NewListPager() { _ = 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.StaticMemberListResult = armnetwork.StaticMemberListResult{ - // Value: []*armnetwork.StaticMember{ - // { - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Region: to.Ptr("useast2"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.StaticMembersClientListResponse{ + // StaticMemberListResult: armnetwork.StaticMemberListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.StaticMember{ + // { + // Name: to.Ptr("testStaticMember"), + // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), + // Properties: &armnetwork.StaticMemberProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Region: to.Ptr("useast2"), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/subgroups_client.go b/sdk/resourcemanager/network/armnetwork/subgroups_client.go new file mode 100644 index 000000000000..be1e19b3287b --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/subgroups_client.go @@ -0,0 +1,171 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SubgroupsClient contains the methods for the Subgroups group. +// Don't use this type directly, use NewSubgroupsClient() instead. +// +// Generated from API version 2025-07-01 +type SubgroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSubgroupsClient creates a new instance of SubgroupsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewSubgroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubgroupsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SubgroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified subgroup in an interconnect group. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - subgroupName - The name of the subgroup. +// - options - SubgroupsClientGetOptions contains the optional parameters for the SubgroupsClient.Get method. +func (client *SubgroupsClient) Get(ctx context.Context, resourceGroupName string, interconnectGroupName string, subgroupName string, options *SubgroupsClientGetOptions) (SubgroupsClientGetResponse, error) { + var err error + const operationName = "SubgroupsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, interconnectGroupName, subgroupName, options) + if err != nil { + return SubgroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubgroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubgroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SubgroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, subgroupName string, _ *SubgroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}/subgroups/{subgroupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + if subgroupName == "" { + return nil, errors.New("parameter subgroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subgroupName}", url.PathEscape(subgroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SubgroupsClient) getHandleResponse(resp *http.Response) (SubgroupsClientGetResponse, error) { + result := SubgroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Subgroup); err != nil { + return SubgroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all subgroups in an interconnect group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - interconnectGroupName - The name of the interconnect group. +// - options - SubgroupsClientListOptions contains the optional parameters for the SubgroupsClient.NewListPager method. +func (client *SubgroupsClient) NewListPager(resourceGroupName string, interconnectGroupName string, options *SubgroupsClientListOptions) *runtime.Pager[SubgroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SubgroupsClientListResponse]{ + More: func(page SubgroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SubgroupsClientListResponse) (SubgroupsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SubgroupsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, interconnectGroupName, options) + }, nil) + if err != nil { + return SubgroupsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SubgroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, interconnectGroupName string, _ *SubgroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interconnectGroups/{interconnectGroupName}/subgroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if interconnectGroupName == "" { + return nil, errors.New("parameter interconnectGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{interconnectGroupName}", url.PathEscape(interconnectGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SubgroupsClient) listHandleResponse(resp *http.Response) (SubgroupsClientListResponse, error) { + result := SubgroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SubgroupListResult); err != nil { + return SubgroupsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/subgroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subgroups_client_example_test.go new file mode 100644 index 000000000000..fec51f227756 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/subgroups_client_example_test.go @@ -0,0 +1,97 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armnetwork_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" +) + +// Generated from example definition: 2025-07-01/SubgroupGet.json +func ExampleSubgroupsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewSubgroupsClient().Get(ctx, "rg1", "test-ig", "subgroup0", 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 = armnetwork.SubgroupsClientGetResponse{ + // Subgroup: armnetwork.Subgroup{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig/subgroups/subgroup0"), + // Name: to.Ptr("subgroup0"), + // Properties: &armnetwork.SubgroupProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // InternalSubgroupID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // InterconnectBlock: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/interconnectBlocks/test-block"), + // }, + // VirtualMachines: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/SubgroupList.json +func ExampleSubgroupsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewSubgroupsClient().NewListPager("rg1", "test-ig", 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 = armnetwork.SubgroupsClientListResponse{ + // SubgroupListResult: armnetwork.SubgroupListResult{ + // Value: []*armnetwork.Subgroup{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/interconnectGroups/test-ig/subgroups/subgroup0"), + // Name: to.Ptr("subgroup0"), + // Properties: &armnetwork.SubgroupProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // InternalSubgroupID: to.Ptr("00000000-0000-0000-0000-000000000001"), + // InterconnectBlock: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/interconnectBlocks/test-block"), + // }, + // VirtualMachines: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), + // }, + // }, + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client.go b/sdk/resourcemanager/network/armnetwork/subnets_client.go index 4c203681282d..689396681a55 100644 --- a/sdk/resourcemanager/network/armnetwork/subnets_client.go +++ b/sdk/resourcemanager/network/armnetwork/subnets_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // SubnetsClient contains the methods for the Subnets group. // Don't use this type directly, use NewSubnetsClient() instead. +// +// Generated from API version 2025-07-01 type SubnetsClient struct { internal *arm.Client subscriptionID string } // NewSubnetsClient creates a new instance of SubnetsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSubnetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubnetsClient, error) { @@ -43,9 +43,7 @@ func NewSubnetsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates a subnet in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - subnetParameters - Parameters supplied to the create or update subnet operation. @@ -58,8 +56,7 @@ func (client *SubnetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *SubnetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a subnet in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SubnetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *SubnetsClient) createOrUpdate(ctx context.Context, resourceGroupNa // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, _ *SubnetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, subnetParameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes the specified subnet. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - options - SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. @@ -142,8 +136,7 @@ func (client *SubnetsClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,8 +148,6 @@ func (client *SubnetsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified subnet. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SubnetsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginDelete" @@ -181,6 +172,10 @@ func (client *SubnetsClient) deleteOperation(ctx context.Context, resourceGroupN // deleteCreateRequest creates the Delete request. func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, _ *SubnetsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -193,26 +188,19 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified subnet by virtual network and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - options - SubnetsClientGetOptions contains the optional parameters for the SubnetsClient.Get method. @@ -241,6 +229,10 @@ func (client *SubnetsClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -253,10 +245,6 @@ func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -265,8 +253,8 @@ func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -281,9 +269,7 @@ func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClie } // NewListPager - Gets all subnets in a virtual network. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - SubnetsClientListOptions contains the optional parameters for the SubnetsClient.NewListPager method. func (client *SubnetsClient) NewListPager(resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) *runtime.Pager[SubnetsClientListResponse] { @@ -312,6 +298,10 @@ func (client *SubnetsClient) NewListPager(resourceGroupName string, virtualNetwo // listCreateRequest creates the List request. func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, _ *SubnetsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -346,9 +332,7 @@ func (client *SubnetsClient) listHandleResponse(resp *http.Response) (SubnetsCli // BeginPrepareNetworkPolicies - Prepares a subnet by applying network intent policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - prepareNetworkPoliciesRequestParameters - Parameters supplied to prepare subnet by applying network intent policies. @@ -361,8 +345,7 @@ func (client *SubnetsClient) BeginPrepareNetworkPolicies(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientPrepareNetworkPoliciesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -374,8 +357,6 @@ func (client *SubnetsClient) BeginPrepareNetworkPolicies(ctx context.Context, re // PrepareNetworkPolicies - Prepares a subnet by applying network intent policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SubnetsClient) prepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginPrepareNetworkPolicies" @@ -399,7 +380,11 @@ func (client *SubnetsClient) prepareNetworkPolicies(ctx context.Context, resourc // prepareNetworkPoliciesCreateRequest creates the PrepareNetworkPolicies request. func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, _ *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/prepareNetworkPolicies" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -412,18 +397,14 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters); err != nil { return nil, err } @@ -432,9 +413,7 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con // BeginUnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. // - unprepareNetworkPoliciesRequestParameters - Parameters supplied to unprepare subnet to remove network intent policies. @@ -447,8 +426,7 @@ func (client *SubnetsClient) BeginUnprepareNetworkPolicies(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientUnprepareNetworkPoliciesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -460,8 +438,6 @@ func (client *SubnetsClient) BeginUnprepareNetworkPolicies(ctx context.Context, // UnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *SubnetsClient) unprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginUnprepareNetworkPolicies" @@ -485,7 +461,11 @@ func (client *SubnetsClient) unprepareNetworkPolicies(ctx context.Context, resou // unprepareNetworkPoliciesCreateRequest creates the UnprepareNetworkPolicies request. func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, _ *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/unprepareNetworkPolicies" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -498,18 +478,14 @@ func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.C return nil, errors.New("parameter subnetName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, unprepareNetworkPoliciesRequestParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go index 58bc923f201b..6141a6285d48 100644 --- a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go @@ -1,147 +1,226 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetDelete.json -func ExampleSubnetsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/SubnetCreate.json +func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginDelete(ctx, "subnet-test", "vnetname", "subnet1", nil) + poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetGet.json -func ExampleSubnetsClient_Get_getSubnet() { +// Generated from example definition: 2025-07-01/SubnetCreateServiceEndpoint.json +func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", &armnetwork.SubnetsClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + { + Service: to.Ptr("Microsoft.Storage"), + }, + }, + }, + }, 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 poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // { + // Locations: []*string{ + // to.Ptr("eastus2(stage)"), + // to.Ptr("usnorth(stage)"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Service: to.Ptr("Microsoft.Storage"), + // }, + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetGetWithDelegation.json -func ExampleSubnetsClient_Get_getSubnetWithADelegation() { +// Generated from example definition: 2025-07-01/SubnetCreateServiceEndpointNetworkIdentifier.json +func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpointsWithNetworkIdentifier() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", &armnetwork.SubnetsClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + { + NetworkIdentifier: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), + }, + Service: to.Ptr("Microsoft.Storage"), + }, + }, + }, + }, 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 poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ + // res = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // { + // Locations: []*string{ + // to.Ptr("eastus2(stage)"), + // to.Ptr("usnorth(stage)"), + // }, + // NetworkIdentifier: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), + // Service: to.Ptr("Microsoft.Storage"), // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetGetWithSharingScope.json -func ExampleSubnetsClient_Get_getSubnetWithSharingScope() { +// Generated from example definition: 2025-07-01/SubnetCreateWithDelegation.json +func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithADelegation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", &armnetwork.SubnetsClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + }, + }, 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 poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // DefaultOutboundAccess: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), + // res = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // Delegations: []*armnetwork.Delegation{ + // { + // Name: to.Ptr("myDelegation"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1/delegations/myDelegation"), + // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ + // Actions: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Purpose: to.Ptr(""), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreateWithServiceGateway.json +// Generated from example definition: 2025-07-01/SubnetCreateWithServiceGateway.json func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -149,7 +228,7 @@ func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceGateway() { Properties: &armnetwork.SubnetPropertiesFormat{ AddressPrefix: to.Ptr("10.0.0.0/16"), ServiceGateway: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), }, }, }, nil) @@ -158,32 +237,34 @@ func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceGateway() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // res = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceGateways/SG1"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreate.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnet() { +// Generated from example definition: 2025-07-01/SubnetCreateWithSharingScope.json +func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithSharingScope() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -197,295 +278,255 @@ func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnet() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.SubnetsClientCreateOrUpdateResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // DefaultOutboundAccess: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreateWithDelegation.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithADelegation() { +// Generated from example definition: 2025-07-01/SubnetDelete.json +func ExampleSubnetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - }, - }, nil) + poller, err := clientFactory.NewSubnetsClient().BeginDelete(ctx, "subnet-test", "vnetname", "subnet1", 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) + log.Fatalf("failed to poll 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), - // }, + // res = armnetwork.SubnetsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreateServiceEndpoint.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpoints() { +// Generated from example definition: 2025-07-01/SubnetGet.json +func ExampleSubnetsClient_Get_getSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }, nil) + res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, + // res = armnetwork.SubnetsClientGetResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreateServiceEndpointNetworkIdentifier.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpointsWithNetworkIdentifier() { +// Generated from example definition: 2025-07-01/SubnetGetWithDelegation.json +func ExampleSubnetsClient_Get_getSubnetWithADelegation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - NetworkIdentifier: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }, nil) + res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // NetworkIdentifier: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), + // res = armnetwork.SubnetsClientGetResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // Delegations: []*armnetwork.Delegation{ + // { + // Name: to.Ptr("myDelegation"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), + // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ + // Actions: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Purpose: to.Ptr(""), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetCreateWithSharingScope.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithSharingScope() { +// Generated from example definition: 2025-07-01/SubnetGetWithSharingScope.json +func ExampleSubnetsClient_Get_getSubnetWithSharingScope() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - }, - }, nil) + res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", 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.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // DefaultOutboundAccess: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), + // res = armnetwork.SubnetsClientGetResponse{ + // Subnet: armnetwork.Subnet{ + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // DefaultOutboundAccess: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetPrepareNetworkPolicies.json -func ExampleSubnetsClient_BeginPrepareNetworkPolicies() { +// Generated from example definition: 2025-07-01/SubnetList.json +func ExampleSubnetsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginPrepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.PrepareNetworkPoliciesRequest{ - ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), - }, 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) + pager := clientFactory.NewSubnetsClient().NewListPager("subnet-test", "vnetname", 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 = armnetwork.SubnetsClientListResponse{ + // SubnetListResult: armnetwork.SubnetListResult{ + // Value: []*armnetwork.Subnet{ + // { + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("subnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet2"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetUnprepareNetworkPolicies.json -func ExampleSubnetsClient_BeginUnprepareNetworkPolicies() { +// Generated from example definition: 2025-07-01/SubnetPrepareNetworkPolicies.json +func ExampleSubnetsClient_BeginPrepareNetworkPolicies() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewSubnetsClient().BeginUnprepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.UnprepareNetworkPoliciesRequest{ + poller, err := clientFactory.NewSubnetsClient().BeginPrepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.PrepareNetworkPoliciesRequest{ ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.SubnetsClientPrepareNetworkPoliciesResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/SubnetList.json -func ExampleSubnetsClient_NewListPager() { +// Generated from example definition: 2025-07-01/SubnetUnprepareNetworkPolicies.json +func ExampleSubnetsClient_BeginUnprepareNetworkPolicies() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSubnetsClient().NewListPager("subnet-test", "vnetname", 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.SubnetListResult = armnetwork.SubnetListResult{ - // Value: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet2"), - // Name: to.Ptr("subnet2"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewSubnetsClient().BeginUnprepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.UnprepareNetworkPoliciesRequest{ + ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), + }, 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 poll 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 = armnetwork.SubnetsClientUnprepareNetworkPoliciesResponse{ + // } } diff --git a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go index d1c62c5bc507..7c8e3aad8dcc 100644 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // SubscriptionNetworkManagerConnectionsClient contains the methods for the SubscriptionNetworkManagerConnections group. // Don't use this type directly, use NewSubscriptionNetworkManagerConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type SubscriptionNetworkManagerConnectionsClient struct { internal *arm.Client subscriptionID string } // NewSubscriptionNetworkManagerConnectionsClient creates a new instance of SubscriptionNetworkManagerConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionNetworkManagerConnectionsClient, error) { @@ -44,8 +44,6 @@ func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string, crede // CreateOrUpdate - Create a network manager connection on this subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - parameters - Network manager connection to be created/updated. // - options - SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate @@ -88,9 +86,10 @@ func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -108,8 +107,6 @@ func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateHandleR // Delete - Delete specified connection created by this subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete // method. @@ -150,16 +147,13 @@ func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Get a specified connection created by this subscription. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get // method. @@ -201,8 +195,8 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -217,8 +211,6 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getHandleResponse(res } // NewListPager - List all network manager connections created by this subscription. -// -// Generated from API version 2025-05-01 // - options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager // method. func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { @@ -262,8 +254,8 @@ func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go index 930cb92ac51b..a52d075f0fa0 100644 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go @@ -1,34 +1,31 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionSubscriptionPut.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectionSubscriptionPut.json func ExampleSubscriptionNetworkManagerConnectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().CreateOrUpdate(ctx, "TestNMConnection", armnetwork.ManagerConnection{ Properties: &armnetwork.ManagerConnectionProperties{ - NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + NetworkManagerID: to.Ptr("/subscriptions/22222222-2222-2222-2222-222222222222/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), }, }, nil) if err != nil { @@ -37,95 +34,102 @@ func ExampleSubscriptionNetworkManagerConnectionsClient_CreateOrUpdate() { // 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.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // res = armnetwork.SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{ + // ManagerConnection: armnetwork.ManagerConnection{ + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionSubscriptionGet.json -func ExampleSubscriptionNetworkManagerConnectionsClient_Get() { +// Generated from example definition: 2025-07-01/NetworkManagerConnectionSubscriptionDelete.json +func ExampleSubscriptionNetworkManagerConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Get(ctx, "TestNMConnection", nil) + res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Delete(ctx, "TestNMConnection", 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.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, + // res = armnetwork.SubscriptionNetworkManagerConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionSubscriptionDelete.json -func ExampleSubscriptionNetworkManagerConnectionsClient_Delete() { +// Generated from example definition: 2025-07-01/NetworkManagerConnectionSubscriptionGet.json +func ExampleSubscriptionNetworkManagerConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Delete(ctx, "TestNMConnection", nil) + res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Get(ctx, "TestNMConnection", 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 = armnetwork.SubscriptionNetworkManagerConnectionsClientGetResponse{ + // ManagerConnection: armnetwork.ManagerConnection{ + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkManagerConnectionSubscriptionList.json +// Generated from example definition: 2025-07-01/NetworkManagerConnectionSubscriptionList.json func ExampleSubscriptionNetworkManagerConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().NewListPager(&armnetwork.SubscriptionNetworkManagerConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) + pager := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -136,26 +140,30 @@ func ExampleSubscriptionNetworkManagerConnectionsClient_NewListPager() { _ = 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.ManagerConnectionListResult = armnetwork.ManagerConnectionListResult{ - // Value: []*armnetwork.ManagerConnection{ - // { - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // page = armnetwork.SubscriptionNetworkManagerConnectionsClientListResponse{ + // ManagerConnectionListResult: armnetwork.ManagerConnectionListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections?api-version=2025-07-01&$skipToken=10"), + // Value: []*armnetwork.ManagerConnection{ + // { + // Name: to.Ptr("TestNMConnection"), + // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), + // Properties: &armnetwork.ManagerConnectionProperties{ + // Description: to.Ptr("This is a network manager connection to testNetworkManager."), + // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), + // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/testdata/_metadata.json b/sdk/resourcemanager/network/armnetwork/testdata/_metadata.json new file mode 100644 index 000000000000..757f7037903a --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/testdata/_metadata.json @@ -0,0 +1,7 @@ +{ + "apiVersions": { + "Microsoft.Network": "2025-07-01", + "Microsoft.Compute": "2018-10-01" + }, + "emitterVersion": "0.14.0" +} diff --git a/sdk/resourcemanager/network/armnetwork/time_rfc3339.go b/sdk/resourcemanager/network/armnetwork/time_rfc3339.go deleted file mode 100644 index 5be5b3637577..000000000000 --- a/sdk/resourcemanager/network/armnetwork/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// 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 armnetwork - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/network/armnetwork/tsp-location.yaml b/sdk/resourcemanager/network/armnetwork/tsp-location.yaml new file mode 100644 index 000000000000..0efbc61da61b --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/network/resource-manager/Microsoft.Network/Network +commit: b26c3c253cff26dd05361e882dbcf1b324f27dfd +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/network/armnetwork/usage_live_test.go b/sdk/resourcemanager/network/armnetwork/usage_live_test.go index e3367065bdd8..d606ec55e9d3 100644 --- a/sdk/resourcemanager/network/armnetwork/usage_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/usage_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/usages_client.go b/sdk/resourcemanager/network/armnetwork/usages_client.go index 35edfb061fb5..739cb0fc0a80 100644 --- a/sdk/resourcemanager/network/armnetwork/usages_client.go +++ b/sdk/resourcemanager/network/armnetwork/usages_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // UsagesClient contains the methods for the Usages group. // Don't use this type directly, use NewUsagesClient() instead. +// +// Generated from API version 2025-07-01 type UsagesClient struct { internal *arm.Client subscriptionID string } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { @@ -42,9 +42,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListPager - List network usages for a subscription. -// -// Generated from API version 2025-05-01 -// - location - The location where resource usage is queried. +// - location - The location name. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[UsagesClientListResponse]{ @@ -72,21 +70,21 @@ func (client *UsagesClient) NewListPager(location string, options *UsagesClientL // listCreateRequest creates the List request. func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, _ *UsagesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go b/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go index f2ab28fb81b0..48dedeafcef4 100644 --- a/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/UsageList.json +// Generated from example definition: 2025-07-01/UsageList.json func ExampleUsagesClient_NewListPager_listUsages() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,270 +33,273 @@ func ExampleUsagesClient_NewListPager_listUsages() { _ = 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.UsagesListResult = armnetwork.UsagesListResult{ - // Value: []*armnetwork.Usage{ - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Virtual Networks"), - // Value: to.Ptr("VirtualNetworks"), - // }, - // CurrentValue: to.Ptr[int64](8), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/VirtualNetworks"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Static Public IP Addresses"), - // Value: to.Ptr("StaticPublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/StaticPublicIPAddresses"), - // Limit: to.Ptr[int64](20), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Security Groups"), - // Value: to.Ptr("NetworkSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkSecurityGroups"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public IP Addresses"), - // Value: to.Ptr("PublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](8), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PublicIPAddresses"), - // Limit: to.Ptr[int64](60), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Interfaces"), - // Value: to.Ptr("NetworkInterfaces"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkInterfaces"), - // Limit: to.Ptr[int64](350), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Load Balancers"), - // Value: to.Ptr("LoadBalancers"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/LoadBalancers"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Gateways"), - // Value: to.Ptr("ApplicationGateways"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/ApplicationGateways"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Tables"), - // Value: to.Ptr("RouteTables"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteTables"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Filters"), - // Value: to.Ptr("RouteFilters"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFilters"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Watchers"), - // Value: to.Ptr("NetworkWatchers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkWatchers"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Packet Captures"), - // Value: to.Ptr("PacketCaptures"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PacketCaptures"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), - // Value: to.Ptr("DnsServersPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/DnsServersPerVirtualNetwork"), - // Limit: to.Ptr[int64](9), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Subnets per Virtual Network"), - // Value: to.Ptr("SubnetsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SubnetsPerVirtualNetwork"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), - // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/IPConfigurationsPerVirtualNetwork"), - // Limit: to.Ptr[int64](4096), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Peerings per Virtual Network"), - // Value: to.Ptr("PeeringsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PeeringsPerVirtualNetwork"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Security Group"), - // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecurityRulesPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), - // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](2000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), - // Value: to.Ptr("InboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](150), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), - // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/FrontendIPConfigurationPerLoadBalancer"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), - // Value: to.Ptr("outboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/outboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](5), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Route Table"), - // Value: to.Ptr("RoutesPerRouteTable"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RoutesPerRouteTable"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), - // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecondaryIPConfigurationsPerNetworkInterface"), - // Limit: to.Ptr[int64](256), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), - // Value: to.Ptr("InboundRulesPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerNetworkInterface"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), - // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFilterRulesPerRouteFilter"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), - // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFiltersPerExpressRouteBgpPeering"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }}, + // page = armnetwork.UsagesClientListResponse{ + // UsagesListResult: armnetwork.UsagesListResult{ + // Value: []*armnetwork.Usage{ + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Virtual Networks"), + // Value: to.Ptr("VirtualNetworks"), + // }, + // CurrentValue: to.Ptr[int64](8), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/VirtualNetworks"), + // Limit: to.Ptr[int64](50), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Static Public IP Addresses"), + // Value: to.Ptr("StaticPublicIPAddresses"), + // }, + // CurrentValue: to.Ptr[int64](3), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/StaticPublicIPAddresses"), + // Limit: to.Ptr[int64](20), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Security Groups"), + // Value: to.Ptr("NetworkSecurityGroups"), + // }, + // CurrentValue: to.Ptr[int64](1), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/NetworkSecurityGroups"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Public IP Addresses"), + // Value: to.Ptr("PublicIPAddresses"), + // }, + // CurrentValue: to.Ptr[int64](8), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/PublicIPAddresses"), + // Limit: to.Ptr[int64](60), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Interfaces"), + // Value: to.Ptr("NetworkInterfaces"), + // }, + // CurrentValue: to.Ptr[int64](2), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/NetworkInterfaces"), + // Limit: to.Ptr[int64](350), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Load Balancers"), + // Value: to.Ptr("LoadBalancers"), + // }, + // CurrentValue: to.Ptr[int64](2), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/LoadBalancers"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Application Gateways"), + // Value: to.Ptr("ApplicationGateways"), + // }, + // CurrentValue: to.Ptr[int64](1), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/ApplicationGateways"), + // Limit: to.Ptr[int64](50), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route Tables"), + // Value: to.Ptr("RouteTables"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/RouteTables"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route Filters"), + // Value: to.Ptr("RouteFilters"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/RouteFilters"), + // Limit: to.Ptr[int64](1000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Watchers"), + // Value: to.Ptr("NetworkWatchers"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/NetworkWatchers"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Packet Captures"), + // Value: to.Ptr("PacketCaptures"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/PacketCaptures"), + // Limit: to.Ptr[int64](10), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), + // Value: to.Ptr("DnsServersPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/DnsServersPerVirtualNetwork"), + // Limit: to.Ptr[int64](9), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Subnets per Virtual Network"), + // Value: to.Ptr("SubnetsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/SubnetsPerVirtualNetwork"), + // Limit: to.Ptr[int64](1000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), + // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/IPConfigurationsPerVirtualNetwork"), + // Limit: to.Ptr[int64](4096), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Peerings per Virtual Network"), + // Value: to.Ptr("PeeringsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/PeeringsPerVirtualNetwork"), + // Limit: to.Ptr[int64](10), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Security rules per Network Security Group"), + // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/SecurityRulesPerNetworkSecurityGroup"), + // Limit: to.Ptr[int64](200), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), + // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), + // Limit: to.Ptr[int64](2000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), + // Value: to.Ptr("InboundRulesPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerLoadBalancer"), + // Limit: to.Ptr[int64](150), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), + // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/FrontendIPConfigurationPerLoadBalancer"), + // Limit: to.Ptr[int64](10), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), + // Value: to.Ptr("outboundRulesPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/outboundRulesPerLoadBalancer"), + // Limit: to.Ptr[int64](5), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Routes per Route Table"), + // Value: to.Ptr("RoutesPerRouteTable"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/RoutesPerRouteTable"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), + // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/SecondaryIPConfigurationsPerNetworkInterface"), + // Limit: to.Ptr[int64](256), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), + // Value: to.Ptr("InboundRulesPerNetworkInterface"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerNetworkInterface"), + // Limit: to.Ptr[int64](500), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), + // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/RouteFilterRulesPerRouteFilter"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), + // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/usages/RouteFiltersPerExpressRouteBgpPeering"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/UsageListSpacedLocation.json +// Generated from example definition: 2025-07-01/UsageListSpacedLocation.json func ExampleUsagesClient_NewListPager_listUsagesSpacedLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -314,328 +314,331 @@ func ExampleUsagesClient_NewListPager_listUsagesSpacedLocation() { _ = 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.UsagesListResult = armnetwork.UsagesListResult{ - // Value: []*armnetwork.Usage{ - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Virtual Networks"), - // Value: to.Ptr("VirtualNetworks"), - // }, - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/VirtualNetworks"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Static Public IP Addresses"), - // Value: to.Ptr("StaticPublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/StaticPublicIPAddresses"), - // Limit: to.Ptr[int64](20), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Security Groups"), - // Value: to.Ptr("NetworkSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkSecurityGroups"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public IP Addresses"), - // Value: to.Ptr("PublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PublicIPAddresses"), - // Limit: to.Ptr[int64](60), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public Ip Prefixes"), - // Value: to.Ptr("PublicIpPrefixes"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PublicIpPrefixes"), - // Limit: to.Ptr[int64](2147483647), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Interfaces"), - // Value: to.Ptr("NetworkInterfaces"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkInterfaces"), - // Limit: to.Ptr[int64](24000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Load Balancers"), - // Value: to.Ptr("LoadBalancers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/LoadBalancers"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Gateways"), - // Value: to.Ptr("ApplicationGateways"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ApplicationGateways"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Tables"), - // Value: to.Ptr("RouteTables"), - // }, - // CurrentValue: to.Ptr[int64](5), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteTables"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Filters"), - // Value: to.Ptr("RouteFilters"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFilters"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Watchers"), - // Value: to.Ptr("NetworkWatchers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkWatchers"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Packet Captures"), - // Value: to.Ptr("PacketCaptures"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PacketCaptures"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Security Groups."), - // Value: to.Ptr("ApplicationSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ApplicationSecurityGroups"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DDoS Protection Plans."), - // Value: to.Ptr("DdosProtectionPlans"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/DdosProtectionPlans"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Service Endpoint Policies"), - // Value: to.Ptr("ServiceEndpointPolicies"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ServiceEndpointPolicies"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Intent Policies"), - // Value: to.Ptr("NetworkIntentPolicies"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkIntentPolicies"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), - // Value: to.Ptr("DnsServersPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/DnsServersPerVirtualNetwork"), - // Limit: to.Ptr[int64](9), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Subnets per Virtual Network"), - // Value: to.Ptr("SubnetsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SubnetsPerVirtualNetwork"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), - // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/IPConfigurationsPerVirtualNetwork"), - // Limit: to.Ptr[int64](16384), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Peerings per Virtual Network"), - // Value: to.Ptr("PeeringsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PeeringsPerVirtualNetwork"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Security Group"), - // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Intent Policy"), - // Value: to.Ptr("SecurityRulesPerNetworkIntentPolicy"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkIntentPolicy"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Network Intent Policy"), - // Value: to.Ptr("RoutesPerNetworkIntentPolicy"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RoutesPerNetworkIntentPolicy"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), - // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](2000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), - // Value: to.Ptr("InboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](150), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), - // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/FrontendIPConfigurationPerLoadBalancer"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), - // Value: to.Ptr("OutboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/OutboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](5), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Route Table"), - // Value: to.Ptr("RoutesPerRouteTable"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RoutesPerRouteTable"), - // Limit: to.Ptr[int64](400), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), - // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecondaryIPConfigurationsPerNetworkInterface"), - // Limit: to.Ptr[int64](256), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), - // Value: to.Ptr("InboundRulesPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerNetworkInterface"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), - // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFilterRulesPerRouteFilter"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), - // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFiltersPerExpressRouteBgpPeering"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }}, + // page = armnetwork.UsagesClientListResponse{ + // UsagesListResult: armnetwork.UsagesListResult{ + // Value: []*armnetwork.Usage{ + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Virtual Networks"), + // Value: to.Ptr("VirtualNetworks"), + // }, + // CurrentValue: to.Ptr[int64](12), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/VirtualNetworks"), + // Limit: to.Ptr[int64](50), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Static Public IP Addresses"), + // Value: to.Ptr("StaticPublicIPAddresses"), + // }, + // CurrentValue: to.Ptr[int64](1), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/StaticPublicIPAddresses"), + // Limit: to.Ptr[int64](20), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Security Groups"), + // Value: to.Ptr("NetworkSecurityGroups"), + // }, + // CurrentValue: to.Ptr[int64](3), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/NetworkSecurityGroups"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Public IP Addresses"), + // Value: to.Ptr("PublicIPAddresses"), + // }, + // CurrentValue: to.Ptr[int64](12), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/PublicIPAddresses"), + // Limit: to.Ptr[int64](60), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Public Ip Prefixes"), + // Value: to.Ptr("PublicIpPrefixes"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/PublicIpPrefixes"), + // Limit: to.Ptr[int64](2147483647), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Interfaces"), + // Value: to.Ptr("NetworkInterfaces"), + // }, + // CurrentValue: to.Ptr[int64](2), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/NetworkInterfaces"), + // Limit: to.Ptr[int64](24000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Load Balancers"), + // Value: to.Ptr("LoadBalancers"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/LoadBalancers"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Application Gateways"), + // Value: to.Ptr("ApplicationGateways"), + // }, + // CurrentValue: to.Ptr[int64](3), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/ApplicationGateways"), + // Limit: to.Ptr[int64](50), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route Tables"), + // Value: to.Ptr("RouteTables"), + // }, + // CurrentValue: to.Ptr[int64](5), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RouteTables"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route Filters"), + // Value: to.Ptr("RouteFilters"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RouteFilters"), + // Limit: to.Ptr[int64](1000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Watchers"), + // Value: to.Ptr("NetworkWatchers"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/NetworkWatchers"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Packet Captures"), + // Value: to.Ptr("PacketCaptures"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/PacketCaptures"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Application Security Groups."), + // Value: to.Ptr("ApplicationSecurityGroups"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/ApplicationSecurityGroups"), + // Limit: to.Ptr[int64](500), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("DDoS Protection Plans."), + // Value: to.Ptr("DdosProtectionPlans"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/DdosProtectionPlans"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Service Endpoint Policies"), + // Value: to.Ptr("ServiceEndpointPolicies"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/ServiceEndpointPolicies"), + // Limit: to.Ptr[int64](200), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Network Intent Policies"), + // Value: to.Ptr("NetworkIntentPolicies"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/NetworkIntentPolicies"), + // Limit: to.Ptr[int64](200), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), + // Value: to.Ptr("DnsServersPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/DnsServersPerVirtualNetwork"), + // Limit: to.Ptr[int64](9), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Subnets per Virtual Network"), + // Value: to.Ptr("SubnetsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/SubnetsPerVirtualNetwork"), + // Limit: to.Ptr[int64](1000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), + // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/IPConfigurationsPerVirtualNetwork"), + // Limit: to.Ptr[int64](16384), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Peerings per Virtual Network"), + // Value: to.Ptr("PeeringsPerVirtualNetwork"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/PeeringsPerVirtualNetwork"), + // Limit: to.Ptr[int64](50), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Security rules per Network Security Group"), + // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkSecurityGroup"), + // Limit: to.Ptr[int64](1000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Security rules per Network Intent Policy"), + // Value: to.Ptr("SecurityRulesPerNetworkIntentPolicy"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkIntentPolicy"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Routes per Network Intent Policy"), + // Value: to.Ptr("RoutesPerNetworkIntentPolicy"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RoutesPerNetworkIntentPolicy"), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), + // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), + // Limit: to.Ptr[int64](2000), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), + // Value: to.Ptr("InboundRulesPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerLoadBalancer"), + // Limit: to.Ptr[int64](150), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), + // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/FrontendIPConfigurationPerLoadBalancer"), + // Limit: to.Ptr[int64](10), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), + // Value: to.Ptr("OutboundRulesPerLoadBalancer"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/OutboundRulesPerLoadBalancer"), + // Limit: to.Ptr[int64](5), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Routes per Route Table"), + // Value: to.Ptr("RoutesPerRouteTable"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RoutesPerRouteTable"), + // Limit: to.Ptr[int64](400), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), + // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/SecondaryIPConfigurationsPerNetworkInterface"), + // Limit: to.Ptr[int64](256), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), + // Value: to.Ptr("InboundRulesPerNetworkInterface"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerNetworkInterface"), + // Limit: to.Ptr[int64](500), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), + // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RouteFilterRulesPerRouteFilter"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // { + // Name: &armnetwork.UsageName{ + // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), + // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/West US/usages/RouteFiltersPerExpressRouteBgpPeering"), + // Limit: to.Ptr[int64](1), + // Unit: to.Ptr(armnetwork.UsageUnitCount), + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go index 0903aa17870c..916398946b70 100644 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // VerifierWorkspacesClient contains the methods for the VerifierWorkspaces group. // Don't use this type directly, use NewVerifierWorkspacesClient() instead. +// +// Generated from API version 2025-07-01 type VerifierWorkspacesClient struct { internal *arm.Client subscriptionID string } // NewVerifierWorkspacesClient creates a new instance of VerifierWorkspacesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVerifierWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VerifierWorkspacesClient, error) { @@ -43,12 +43,12 @@ func NewVerifierWorkspacesClient(subscriptionID string, credential azcore.TokenC } // Create - Creates Verifier Workspace. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Creates Verifier Workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - body - Verifier Workspace object to create/update. // - options - VerifierWorkspacesClientCreateOptions contains the optional parameters for the VerifierWorkspacesClient.Create // method. @@ -98,12 +98,13 @@ func (client *VerifierWorkspacesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { return nil, err } @@ -120,12 +121,12 @@ func (client *VerifierWorkspacesClient) createHandleResponse(resp *http.Response } // BeginDelete - Deletes Verifier Workspace. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Deletes Verifier Workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - options - VerifierWorkspacesClientBeginDeleteOptions contains the optional parameters for the VerifierWorkspacesClient.BeginDelete // method. func (client *VerifierWorkspacesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientBeginDeleteOptions) (*runtime.Poller[VerifierWorkspacesClientDeleteResponse], error) { @@ -135,8 +136,7 @@ func (client *VerifierWorkspacesClient) BeginDelete(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VerifierWorkspacesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -147,9 +147,9 @@ func (client *VerifierWorkspacesClient) BeginDelete(ctx context.Context, resourc } // Delete - Deletes Verifier Workspace. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 +// Deletes Verifier Workspace. +// If the operation fails it returns an *azcore.ResponseError type. func (client *VerifierWorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VerifierWorkspacesClient.BeginDelete" @@ -195,9 +195,8 @@ func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } @@ -205,12 +204,12 @@ func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, } // Get - Gets Verifier Workspace. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets Verifier Workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource // - options - VerifierWorkspacesClientGetOptions contains the optional parameters for the VerifierWorkspacesClient.Get method. func (client *VerifierWorkspacesClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientGetOptions) (VerifierWorkspacesClientGetResponse, error) { var err error @@ -258,8 +257,8 @@ func (client *VerifierWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -275,8 +274,8 @@ func (client *VerifierWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Verifier Workspaces. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Gets list of Verifier Workspaces. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - VerifierWorkspacesClientListOptions contains the optional parameters for the VerifierWorkspacesClient.NewListPager // method. @@ -323,7 +322,7 @@ func (client *VerifierWorkspacesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -339,7 +338,7 @@ func (client *VerifierWorkspacesClient) listCreateRequest(ctx context.Context, r if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -354,21 +353,22 @@ func (client *VerifierWorkspacesClient) listHandleResponse(resp *http.Response) } // Update - Updates Verifier Workspace. -// If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// Updates Verifier Workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. -// - workspaceName - Workspace name. +// - workspaceName - The name of the resource +// - body - Verifier Workspace object to create/update. // - options - VerifierWorkspacesClientUpdateOptions contains the optional parameters for the VerifierWorkspacesClient.Update // method. -func (client *VerifierWorkspacesClient) Update(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientUpdateOptions) (VerifierWorkspacesClientUpdateResponse, error) { +func (client *VerifierWorkspacesClient) Update(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body VerifierWorkspaceUpdate, options *VerifierWorkspacesClientUpdateOptions) (VerifierWorkspacesClientUpdateResponse, error) { var err error const operationName = "VerifierWorkspacesClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, networkManagerName, workspaceName, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkManagerName, workspaceName, body, options) if err != nil { return VerifierWorkspacesClientUpdateResponse{}, err } @@ -385,7 +385,7 @@ func (client *VerifierWorkspacesClient) Update(ctx context.Context, resourceGrou } // updateCreateRequest creates the Update request. -func (client *VerifierWorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientUpdateOptions) (*policy.Request, error) { +func (client *VerifierWorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body VerifierWorkspaceUpdate, options *VerifierWorkspacesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -408,17 +408,15 @@ func (client *VerifierWorkspacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - if options != nil && options.Body != nil { - if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { - return nil, err - } - return req, nil + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err } return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go index cce1c385312b..ecb398f8d228 100644 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go @@ -1,216 +1,216 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VerifierWorkspaceList.json -func ExampleVerifierWorkspacesClient_NewListPager() { +// Generated from example definition: 2025-07-01/VerifierWorkspacePut.json +func ExampleVerifierWorkspacesClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVerifierWorkspacesClient().NewListPager("rg1", "testNetworkManager", &armnetwork.VerifierWorkspacesClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.VerifierWorkspaceListResult = armnetwork.VerifierWorkspaceListResult{ - // Value: []*armnetwork.VerifierWorkspace{ - // { - // Name: to.Ptr("testVerifierWorkspace1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample verfier workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + res, err := clientFactory.NewVerifierWorkspacesClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", armnetwork.VerifierWorkspace{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.VerifierWorkspaceProperties{ + Description: to.Ptr("A sample workspace"), + }, + }, 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 = armnetwork.VerifierWorkspacesClientCreateResponse{ + // VerifierWorkspace: armnetwork.VerifierWorkspace{ + // Name: to.Ptr("testWorkspace"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VerifierWorkspaceProperties{ + // Description: to.Ptr("A sample workspace"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VerifierWorkspaceGet.json -func ExampleVerifierWorkspacesClient_Get() { +// Generated from example definition: 2025-07-01/VerifierWorkspaceDelete.json +func ExampleVerifierWorkspacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVerifierWorkspacesClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", nil) + poller, err := clientFactory.NewVerifierWorkspacesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VerifierWorkspacePut.json -func ExampleVerifierWorkspacesClient_Create() { +// Generated from example definition: 2025-07-01/VerifierWorkspaceGet.json +func ExampleVerifierWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVerifierWorkspacesClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", armnetwork.VerifierWorkspace{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VerifierWorkspaceProperties{ - Description: to.Ptr("A sample workspace"), - }, - }, &armnetwork.VerifierWorkspacesClientCreateOptions{IfMatch: nil}) + res, err := clientFactory.NewVerifierWorkspacesClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VerifierWorkspacesClientGetResponse{ + // VerifierWorkspace: armnetwork.VerifierWorkspace{ + // Name: to.Ptr("testWorkspace"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VerifierWorkspaceProperties{ + // Description: to.Ptr("A sample workspace"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VerifierWorkspacePatch.json -func ExampleVerifierWorkspacesClient_Update() { +// Generated from example definition: 2025-07-01/VerifierWorkspaceList.json +func ExampleVerifierWorkspacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVerifierWorkspacesClient().Update(ctx, "rg1", "testNetworkManager", "testWorkspace", &armnetwork.VerifierWorkspacesClientUpdateOptions{IfMatch: nil, - Body: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewVerifierWorkspacesClient().NewListPager("rg1", "testNetworkManager", 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 = armnetwork.VerifierWorkspacesClientListResponse{ + // VerifierWorkspaceListResult: armnetwork.VerifierWorkspaceListResult{ + // NextLink: to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces?api-version=2024-04-01-preview&$skipToken=10"), + // Value: []*armnetwork.VerifierWorkspace{ + // { + // Name: to.Ptr("testVerifierWorkspace1"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VerifierWorkspaceProperties{ + // Description: to.Ptr("A sample verfier workspace"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } } - // 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "color": to.Ptr("blue"), - // }, - // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VerifierWorkspaceDelete.json -func ExampleVerifierWorkspacesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VerifierWorkspacePatch.json +func ExampleVerifierWorkspacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVerifierWorkspacesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", &armnetwork.VerifierWorkspacesClientBeginDeleteOptions{IfMatch: nil}) + res, err := clientFactory.NewVerifierWorkspacesClient().Update(ctx, "rg1", "testNetworkManager", "testWorkspace", armnetwork.VerifierWorkspaceUpdate{}, 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) - } + // 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 = armnetwork.VerifierWorkspacesClientUpdateResponse{ + // VerifierWorkspace: armnetwork.VerifierWorkspace{ + // Name: to.Ptr("testWorkspace"), + // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), + // Etag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VerifierWorkspaceProperties{ + // Description: to.Ptr("A sample workspace"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // SystemData: &armnetwork.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), + // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), + // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), + // }, + // Tags: map[string]*string{ + // "color": to.Ptr("blue"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/version.go b/sdk/resourcemanager/network/armnetwork/version.go index 7de1254f596b..40f7c3596feb 100644 --- a/sdk/resourcemanager/network/armnetwork/version.go +++ b/sdk/resourcemanager/network/armnetwork/version.go @@ -1,10 +1,10 @@ // 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) Go Code Generator. package armnetwork const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" - moduleVersion = "v9.0.0" + moduleVersion = "v10.0.0" ) diff --git a/sdk/resourcemanager/network/armnetwork/vipswap_client.go b/sdk/resourcemanager/network/armnetwork/vipswap_client.go index 04f0131e0474..bf2aef04237f 100644 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client.go +++ b/sdk/resourcemanager/network/armnetwork/vipswap_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VipSwapClient contains the methods for the VipSwap group. // Don't use this type directly, use NewVipSwapClient() instead. +// +// Generated from API version 2025-07-01 type VipSwapClient struct { internal *arm.Client subscriptionID string } // NewVipSwapClient creates a new instance of VipSwapClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVipSwapClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VipSwapClient, error) { @@ -43,9 +43,6 @@ func NewVipSwapClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Performs vip swap operation on swappable cloud services. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - parameters - SwapResource object where slot type should be the target slot after vip swap for the specified cloud service. // - options - VipSwapClientBeginCreateOptions contains the optional parameters for the VipSwapClient.BeginCreate method. @@ -68,8 +65,6 @@ func (client *VipSwapClient) BeginCreate(ctx context.Context, groupName string, // Create - Performs vip swap operation on swappable cloud services. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VipSwapClient) create(ctx context.Context, groupName string, resourceName string, parameters SwapResource, options *VipSwapClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "VipSwapClient.BeginCreate" @@ -93,7 +88,11 @@ func (client *VipSwapClient) create(ctx context.Context, groupName string, resou // createCreateRequest creates the Create request. func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName string, resourceName string, parameters SwapResource, _ *VipSwapClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -103,18 +102,14 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) urlPath = strings.ReplaceAll(urlPath, "{singletonResource}", url.PathEscape("swap")) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +119,6 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName // Get - Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud service // can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - options - VipSwapClientGetOptions contains the optional parameters for the VipSwapClient.Get method. func (client *VipSwapClient) Get(ctx context.Context, groupName string, resourceName string, options *VipSwapClientGetOptions) (VipSwapClientGetResponse, error) { @@ -153,7 +145,11 @@ func (client *VipSwapClient) Get(ctx context.Context, groupName string, resource // getCreateRequest creates the Get request. func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName string, resourceName string, _ *VipSwapClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -163,17 +159,13 @@ func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName str } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) urlPath = strings.ReplaceAll(urlPath, "{singletonResource}", url.PathEscape("swap")) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -190,9 +182,6 @@ func (client *VipSwapClient) getHandleResponse(resp *http.Response) (VipSwapClie // List - Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a // cloud service can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - options - VipSwapClientListOptions contains the optional parameters for the VipSwapClient.List method. func (client *VipSwapClient) List(ctx context.Context, groupName string, resourceName string, options *VipSwapClientListOptions) (VipSwapClientListResponse, error) { @@ -219,7 +208,11 @@ func (client *VipSwapClient) List(ctx context.Context, groupName string, resourc // listCreateRequest creates the List request. func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName string, resourceName string, _ *VipSwapClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") } @@ -228,17 +221,13 @@ func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName st return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go index 7d69dfd33841..5087bbc24115 100644 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go @@ -1,81 +1,85 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceSwapGet.json -func ExampleVipSwapClient_Get() { +// Generated from example definition: 2025-07-01/CloudServiceSwapPut.json +func ExampleVipSwapClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVipSwapClient().Get(ctx, "rg1", "testCloudService", nil) + poller, err := clientFactory.NewVipSwapClient().BeginCreate(ctx, "rg1", "testCloudService", armnetwork.SwapResource{ + Properties: &armnetwork.SwapResourceProperties{ + SlotType: to.Ptr(armnetwork.SlotTypeProduction), + }, + }, 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 poll 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.SwapResource = armnetwork.SwapResource{ - // Name: to.Ptr("swap"), - // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), - // Properties: &armnetwork.SwapResourceProperties{ - // SlotType: to.Ptr(armnetwork.SlotTypeStaging), - // }, + // res = armnetwork.VipSwapClientCreateResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceSwapPut.json -func ExampleVipSwapClient_BeginCreate() { +// Generated from example definition: 2025-07-01/CloudServiceSwapGet.json +func ExampleVipSwapClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVipSwapClient().BeginCreate(ctx, "rg1", "testCloudService", armnetwork.SwapResource{ - Properties: &armnetwork.SwapResourceProperties{ - SlotType: to.Ptr(armnetwork.SlotTypeProduction), - }, - }, nil) + res, err := clientFactory.NewVipSwapClient().Get(ctx, "rg1", "testCloudService", 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) - } + // 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 = armnetwork.VipSwapClientGetResponse{ + // SwapResource: armnetwork.SwapResource{ + // Name: to.Ptr("swap"), + // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), + // Properties: &armnetwork.SwapResourceProperties{ + // SlotType: to.Ptr(armnetwork.SlotTypeStaging), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/CloudServiceSwapList.json +// Generated from example definition: 2025-07-01/CloudServiceSwapList.json func ExampleVipSwapClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -86,15 +90,18 @@ func ExampleVipSwapClient_List() { // 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.SwapResourceListResult = armnetwork.SwapResourceListResult{ - // Value: []*armnetwork.SwapResource{ - // { - // Name: to.Ptr("swap"), - // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), - // Properties: &armnetwork.SwapResourceProperties{ - // SlotType: to.Ptr(armnetwork.SlotTypeStaging), + // res = armnetwork.VipSwapClientListResponse{ + // SwapResourceListResult: armnetwork.SwapResourceListResult{ + // Value: []*armnetwork.SwapResource{ + // { + // Name: to.Ptr("swap"), + // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), + // Properties: &armnetwork.SwapResourceProperties{ + // SlotType: to.Ptr(armnetwork.SlotTypeStaging), + // }, // }, - // }}, + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go index 8f10d4a3f300..ccf68029b877 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// VirtualApplianceConnectionsClient contains the methods for the NetworkVirtualApplianceConnections group. +// VirtualApplianceConnectionsClient contains the methods for the VirtualApplianceConnections group. // Don't use this type directly, use NewVirtualApplianceConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualApplianceConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVirtualApplianceConnectionsClient creates a new instance of VirtualApplianceConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualApplianceConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceConnectionsClient, error) { @@ -44,11 +44,8 @@ func NewVirtualApplianceConnectionsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing // NVA connection' // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - connectionName - The name of the NVA connection. // - networkVirtualApplianceConnectionParameters - Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. // - options - VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceConnectionsClient.BeginCreateOrUpdate // method. @@ -59,8 +56,7 @@ func (client *VirtualApplianceConnectionsClient) BeginCreateOrUpdate(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -72,8 +68,6 @@ func (client *VirtualApplianceConnectionsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection' // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualApplianceConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, networkVirtualApplianceConnectionParameters VirtualApplianceConnection, options *VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceConnectionsClient.BeginCreateOrUpdate" @@ -119,9 +113,10 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, networkVirtualApplianceConnectionParameters); err != nil { return nil, err } @@ -130,11 +125,8 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a NVA connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - connectionName - The name of the NVA connection. // - options - VirtualApplianceConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceConnectionsClient.BeginDelete // method. func (client *VirtualApplianceConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientBeginDeleteOptions) (*runtime.Poller[VirtualApplianceConnectionsClientDeleteResponse], error) { @@ -144,8 +136,7 @@ func (client *VirtualApplianceConnectionsClient) BeginDelete(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,8 +148,6 @@ func (client *VirtualApplianceConnectionsClient) BeginDelete(ctx context.Context // Delete - Deletes a NVA connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualApplianceConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceConnectionsClient.BeginDelete" @@ -204,19 +193,15 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of specified NVA connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - connectionName - The name of the NVA connection. // - options - VirtualApplianceConnectionsClientGetOptions contains the optional parameters for the VirtualApplianceConnectionsClient.Get // method. func (client *VirtualApplianceConnectionsClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientGetOptions) (VirtualApplianceConnectionsClientGetResponse, error) { @@ -265,8 +250,8 @@ func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -281,10 +266,8 @@ func (client *VirtualApplianceConnectionsClient) getHandleResponse(resp *http.Re } // NewListPager - Lists NetworkVirtualApplianceConnections under the NVA. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualApplianceConnectionsClientListOptions contains the optional parameters for the VirtualApplianceConnectionsClient.NewListPager // method. func (client *VirtualApplianceConnectionsClient) NewListPager(resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceConnectionsClientListOptions) *runtime.Pager[VirtualApplianceConnectionsClientListResponse] { @@ -330,8 +313,8 @@ func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go index a1d9e046b711..dc97ea19a3c6 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceConnectionPut.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceConnectionPut.json func ExampleVirtualApplianceConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,25 +29,28 @@ func ExampleVirtualApplianceConnectionsClient_BeginCreateOrUpdate() { Asn: to.Ptr[int64](64512), BgpPeerAddress: []*string{ to.Ptr("169.254.16.13"), - to.Ptr("169.254.16.14")}, + to.Ptr("169.254.16.14"), + }, EnableInternetSecurity: to.Ptr(false), RoutingConfiguration: &armnetwork.RoutingConfiguration{ AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), }, InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), }, OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), }, PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ IDs: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + }, + }, Labels: []*string{ - to.Ptr("label1")}, + to.Ptr("label1"), + }, }, }, TunnelIdentifier: to.Ptr[int64](0), @@ -61,53 +61,84 @@ func ExampleVirtualApplianceConnectionsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualApplianceConnection = armnetwork.VirtualApplianceConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva1/networkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // res = armnetwork.VirtualApplianceConnectionsClientCreateOrUpdateResponse{ + // VirtualApplianceConnection: armnetwork.VirtualApplianceConnection{ // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva1/networkVirtualApplianceConnections/connection1"), + // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // Name: to.Ptr("connection1"), + // Asn: to.Ptr[int64](64512), + // BgpPeerAddress: []*string{ + // to.Ptr("169.254.16.13"), + // to.Ptr("169.254.16.14"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), // }, // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // }, // Labels: []*string{ - // to.Ptr("label1")}, + // to.Ptr("label1"), // }, // }, - // TunnelIdentifier: to.Ptr[int64](0), // }, - // } + // TunnelIdentifier: to.Ptr[int64](0), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceConnectionGet.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceConnectionDelete.json +func ExampleVirtualApplianceConnectionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualApplianceConnectionsClient().BeginDelete(ctx, "rg1", "nva1", "connection1", 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 poll 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 = armnetwork.VirtualApplianceConnectionsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceConnectionGet.json func ExampleVirtualApplianceConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -118,69 +149,53 @@ func ExampleVirtualApplianceConnectionsClient_Get() { // 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.VirtualApplianceConnection = armnetwork.VirtualApplianceConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // res = armnetwork.VirtualApplianceConnectionsClientGetResponse{ + // VirtualApplianceConnection: armnetwork.VirtualApplianceConnection{ // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), + // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // Name: to.Ptr("connection1"), + // Asn: to.Ptr[int64](64512), + // BgpPeerAddress: []*string{ + // to.Ptr("169.254.16.13"), + // to.Ptr("169.254.16.14"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), // }, // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // }, // Labels: []*string{ - // to.Ptr("label1")}, + // to.Ptr("label1"), // }, // }, - // TunnelIdentifier: to.Ptr[int64](0), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceConnectionDelete.json -func ExampleVirtualApplianceConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceConnectionsClient().BeginDelete(ctx, "rg1", "nva1", "connection1", 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) - } + // TunnelIdentifier: to.Ptr[int64](0), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceConnectionList.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceConnectionList.json func ExampleVirtualApplianceConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -195,40 +210,46 @@ func ExampleVirtualApplianceConnectionsClient_NewListPager() { _ = 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.VirtualApplianceConnectionList = armnetwork.VirtualApplianceConnectionList{ - // Value: []*armnetwork.VirtualApplianceConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // page = armnetwork.VirtualApplianceConnectionsClientListResponse{ + // VirtualApplianceConnectionList: armnetwork.VirtualApplianceConnectionList{ + // Value: []*armnetwork.VirtualApplianceConnection{ + // { // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), + // Properties: &armnetwork.VirtualApplianceConnectionProperties{ + // Name: to.Ptr("connection1"), + // Asn: to.Ptr[int64](64512), + // BgpPeerAddress: []*string{ + // to.Ptr("169.254.16.13"), + // to.Ptr("169.254.16.14"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RoutingConfiguration: &armnetwork.RoutingConfiguration{ // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), // }, // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), // }, // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // }, // Labels: []*string{ - // to.Ptr("label1")}, + // to.Ptr("label1"), // }, // }, - // TunnelIdentifier: to.Ptr[int64](0), // }, - // }}, - // } + // TunnelIdentifier: to.Ptr[int64](0), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go index a5695783235d..d010cea3c2f7 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// VirtualAppliancesClient contains the methods for the NetworkVirtualAppliances group. +// VirtualAppliancesClient contains the methods for the VirtualAppliances group. // Don't use this type directly, use NewVirtualAppliancesClient() instead. +// +// Generated from API version 2025-07-01 type VirtualAppliancesClient struct { internal *arm.Client subscriptionID string } // NewVirtualAppliancesClient creates a new instance of VirtualAppliancesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualAppliancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualAppliancesClient, error) { @@ -43,9 +43,7 @@ func NewVirtualAppliancesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - parameters - Parameters supplied to the create or update Network Virtual Appliance. // - options - VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate @@ -70,8 +68,6 @@ func (client *VirtualAppliancesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginCreateOrUpdate" @@ -96,6 +92,10 @@ func (client *VirtualAppliancesClient) createOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, _ *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +104,15 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +121,7 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete // method. @@ -137,8 +132,7 @@ func (client *VirtualAppliancesClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +144,6 @@ func (client *VirtualAppliancesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginDelete" @@ -176,6 +168,10 @@ func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, _ *VirtualAppliancesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +180,19 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. func (client *VirtualAppliancesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (VirtualAppliancesClientGetResponse, error) { @@ -231,6 +220,10 @@ func (client *VirtualAppliancesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +232,6 @@ func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, res return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +240,8 @@ func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -269,9 +258,7 @@ func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (V // BeginGetBootDiagnosticLogs - Retrieves the boot diagnostic logs for a VM instance belonging to the specified Network Virtual // Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - request - Parameters supplied to retrieve boot diagnostic logs for a NVA VM instance // - options - VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions contains the optional parameters for the VirtualAppliancesClient.BeginGetBootDiagnosticLogs @@ -283,8 +270,7 @@ func (client *VirtualAppliancesClient) BeginGetBootDiagnosticLogs(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientGetBootDiagnosticLogsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -297,8 +283,6 @@ func (client *VirtualAppliancesClient) BeginGetBootDiagnosticLogs(ctx context.Co // GetBootDiagnosticLogs - Retrieves the boot diagnostic logs for a VM instance belonging to the specified Network Virtual // Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualAppliancesClient) getBootDiagnosticLogs(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, request VirtualApplianceBootDiagnosticParameters, options *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginGetBootDiagnosticLogs" @@ -323,6 +307,10 @@ func (client *VirtualAppliancesClient) getBootDiagnosticLogs(ctx context.Context // getBootDiagnosticLogsCreateRequest creates the GetBootDiagnosticLogs request. func (client *VirtualAppliancesClient) getBootDiagnosticLogsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, request VirtualApplianceBootDiagnosticParameters, _ *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/getBootDiagnosticLogs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -331,18 +319,15 @@ func (client *VirtualAppliancesClient) getBootDiagnosticLogsCreateRequest(ctx co return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } @@ -350,8 +335,6 @@ func (client *VirtualAppliancesClient) getBootDiagnosticLogsCreateRequest(ctx co } // NewListPager - Gets all Network Virtual Appliances in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager // method. func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { @@ -389,8 +372,8 @@ func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -405,9 +388,7 @@ func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) ( } // NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager // method. func (client *VirtualAppliancesClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) *runtime.Pager[VirtualAppliancesClientListByResourceGroupResponse] { @@ -436,21 +417,21 @@ func (client *VirtualAppliancesClient) NewListByResourceGroupPager(resourceGroup // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualAppliancesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -466,9 +447,7 @@ func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *h // BeginReimage - Reimages one VM belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginReimageOptions contains the optional parameters for the VirtualAppliancesClient.BeginReimage // method. @@ -479,8 +458,7 @@ func (client *VirtualAppliancesClient) BeginReimage(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientReimageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -492,8 +470,6 @@ func (client *VirtualAppliancesClient) BeginReimage(ctx context.Context, resourc // Reimage - Reimages one VM belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualAppliancesClient) reimage(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginReimage" @@ -518,6 +494,10 @@ func (client *VirtualAppliancesClient) reimage(ctx context.Context, resourceGrou // reimageCreateRequest creates the Reimage request. func (client *VirtualAppliancesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/reimage" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -526,19 +506,16 @@ func (client *VirtualAppliancesClient) reimageCreateRequest(ctx context.Context, return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.NetworkVirtualApplianceInstanceIDs); err != nil { return nil, err } @@ -549,9 +526,7 @@ func (client *VirtualAppliancesClient) reimageCreateRequest(ctx context.Context, // BeginRestart - Restarts one or more VMs belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginRestartOptions contains the optional parameters for the VirtualAppliancesClient.BeginRestart // method. @@ -562,8 +537,7 @@ func (client *VirtualAppliancesClient) BeginRestart(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -575,8 +549,6 @@ func (client *VirtualAppliancesClient) BeginRestart(ctx context.Context, resourc // Restart - Restarts one or more VMs belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualAppliancesClient) restart(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginRestart" @@ -601,6 +573,10 @@ func (client *VirtualAppliancesClient) restart(ctx context.Context, resourceGrou // restartCreateRequest creates the Restart request. func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/restart" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -609,19 +585,16 @@ func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.NetworkVirtualApplianceInstanceIDs); err != nil { return nil, err } @@ -632,10 +605,8 @@ func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, // UpdateTags - Updates a Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of Network Virtual Appliance. -// - networkVirtualApplianceName - The name of Network Virtual Appliance being updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. // - parameters - Parameters supplied to Update Network Virtual Appliance Tags. // - options - VirtualAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualAppliancesClient.UpdateTags // method. @@ -681,9 +652,10 @@ func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go index 8d8b93370da4..c19797986c5d 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go @@ -1,345 +1,380 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceDelete.json -func ExampleVirtualAppliancesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkVirtualAppliancePut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppliance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginDelete(ctx, "rg1", "nva", nil) + poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ + Identity: &armnetwork.ManagedServiceIdentity{ + Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + }, + }, + Location: to.Ptr("West US"), + Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ + { + Name: to.Ptr("exrsdwan"), + HasPublicIP: to.Ptr(true), + }, + }, + BootStrapConfigurationBlobs: []*string{ + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, + CloudInitConfigurationBlobs: []*string{ + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + }, + InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + { + ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), + }, + }, + NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ + { + NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + { + Name: to.Ptr("publicnicipconfig"), + Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + Primary: to.Ptr(true), + }, + }, + { + Name: to.Ptr("publicnicipconfig-2"), + Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + Primary: to.Ptr(false), + }, + }, + }, + }, + }, + { + NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + { + Name: to.Ptr("privatenicipconfig"), + Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + Primary: to.Ptr(true), + }, + }, + { + Name: to.Ptr("privatenicipconfig-2"), + Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + Primary: to.Ptr(false), + }, + }, + }, + }, + }, + }, + }, + NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + BundledScaleUnit: to.Ptr("1"), + MarketPlaceVersion: to.Ptr("12.1"), + Vendor: to.Ptr("Cisco SDWAN"), + }, + VirtualApplianceAsn: to.Ptr[int64](10000), + VirtualHub: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceGet.json -func ExampleVirtualAppliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualAppliancesClient().Get(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientGetOptions{Expand: nil}) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - // { - // Name: to.Ptr("exrsdwan"), - // HasPublicIP: to.Ptr(true), - // }}, - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ + // { + // Name: to.Ptr("exrsdwan"), + // HasPublicIP: to.Ptr(true), + // }, + // }, + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // { + // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), + // }, + // }, + // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("publicnicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, // }, // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // }, + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("privatenicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), + // }, + // }, // }, - // }}, + // }, + // }, // }, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("12.1"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("publicnicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), // }, - // PrivateIPAddress: to.Ptr("192.168.12.11"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/networkVirtualApplianceConnections/connection1"), - // }}, - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }, - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.6"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.7"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.8"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.9"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // PrivateIPAddress: to.Ptr("192.168.12.10"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // { + // Name: to.Ptr("publicnicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("privatenicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("exrsdwan"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), + // PrivateIPAddress: to.Ptr("10.1.113.4"), + // PublicIPAddress: to.Ptr("4.231.25.19"), + // }, + // }, + // VirtualApplianceSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), // }, // }, - // } + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceUpdateTags.json -func ExampleVirtualAppliancesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSaaSPut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createSaaSNetworkVirtualAppliance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualAppliancesClient().UpdateTags(ctx, "rg1", "nva", armnetwork.TagsObject{ + poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ + Location: to.Ptr("West US"), + Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + Delegation: &armnetwork.DelegationProperties{ + ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), + }, + VirtualHub: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + }, + }, Tags: map[string]*string{ "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // Delegation: &armnetwork.DelegationProperties{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), + // }, + // DeploymentType: to.Ptr("PartnerManaged"), + // PartnerManagedResource: &armnetwork.PartnerManagedResourceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Lifter/firewalls/paloAltoFirewall"), + // InternalLoadBalancerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustILB"), + // StandardLoadBalancerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustSLB"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), // }, // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementNic"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privateNic-1"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceVnetBasicPut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNic() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceVnetAdditionalPrivatePut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicAdditionalPrivateNic() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("West US"), Properties: &armnetwork.VirtualAppliancePropertiesFormat{ BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + }, NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ { Name: to.Ptr("dataInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePrivateNic)}, + to.Ptr(armnetwork.NvaNicTypePrivateNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), }, }, { Name: to.Ptr("managementInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePublicNic)}, + to.Ptr(armnetwork.NvaNicTypePublicNic), + }, + Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + }, + }, + { + Name: to.Ptr("myAdditionalInterface"), + Type: []*armnetwork.NvaNicType{ + to.Ptr(armnetwork.NvaNicTypeAdditionalPrivateNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), }, - }}, + }, + }, NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ BundledScaleUnit: to.Ptr("1"), MarketPlaceVersion: to.Ptr("latest"), @@ -347,149 +382,191 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPriva }, VirtualApplianceAsn: to.Ptr[int64](10000), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - // { - // Name: to.Ptr("dataInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // { - // Name: to.Ptr("managementInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - // }, - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("latest"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }}, + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + // { + // Name: to.Ptr("dataInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePrivateNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // { + // Name: to.Ptr("managementInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePublicNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), // }, - // } + // }, + // { + // Name: to.Ptr("myAdditionalInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypeAdditionalPrivateNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), + // }, + // }, + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("latest"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.7"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myAdditionalInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myAdditionalInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.6"), + // PublicIPAddress: to.Ptr(""), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceVnetIngressPut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicIncludingInternetIngress() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceVnetAdditionalPublicPut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicAdditionalPublicNic() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("West US"), Properties: &armnetwork.VirtualAppliancePropertiesFormat{ BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/slbip"), - }}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + }, NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ { Name: to.Ptr("dataInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePrivateNic)}, + to.Ptr(armnetwork.NvaNicTypePrivateNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), }, }, { Name: to.Ptr("managementInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePublicNic)}, + to.Ptr(armnetwork.NvaNicTypePublicNic), + }, + Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + }, + }, + { + Name: to.Ptr("myAdditionalPublicInterface"), + Type: []*armnetwork.NvaNicType{ + to.Ptr(armnetwork.NvaNicTypeAdditionalPublicNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), }, - }}, + }, + }, NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ BundledScaleUnit: to.Ptr("1"), MarketPlaceVersion: to.Ptr("latest"), @@ -497,188 +574,182 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPriva }, VirtualApplianceAsn: to.Ptr[int64](10000), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - // { - // Name: to.Ptr("dataInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // { - // Name: to.Ptr("managementInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - // }, - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("latest"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }}, + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + // { + // Name: to.Ptr("dataInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePrivateNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // { + // Name: to.Ptr("managementInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePublicNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), // }, - // } + // }, + // { + // Name: to.Ptr("myAdditionalPublicInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypeAdditionalPublicNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), + // }, + // }, + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("latest"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.7"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myAdditionalPublicInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // PublicIPAddress: to.Ptr("40.30.2.4"), + // }, + // { + // Name: to.Ptr("myAdditionalPublicInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.6"), + // PublicIPAddress: to.Ptr("40.30.2.5"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceVnetNetworkProfilePut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicIncludingNetworkProfile() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceVnetBasicPut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNic() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("West US"), Properties: &armnetwork.VirtualAppliancePropertiesFormat{ BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - { - NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - { - Name: to.Ptr("myPrimaryPublicIpConfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(true), - }, - }, - { - Name: to.Ptr("myNonPrimaryPublicIpConfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(false), - }, - }}, - }, - }, - { - NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - { - Name: to.Ptr("myPrimaryPrivateIpConfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(true), - }, - }, - { - Name: to.Ptr("myNonPrimaryPrivateIpConfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(false), - }, - }}, - }, - }}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), }, NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ { Name: to.Ptr("dataInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePrivateNic)}, + to.Ptr(armnetwork.NvaNicTypePrivateNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), }, }, { Name: to.Ptr("managementInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePublicNic)}, + to.Ptr(armnetwork.NvaNicTypePublicNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), }, - }}, + }, + }, NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ BundledScaleUnit: to.Ptr("1"), MarketPlaceVersion: to.Ptr("latest"), @@ -686,220 +757,164 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPriva }, VirtualApplianceAsn: to.Ptr[int64](10000), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("myPrimaryPublicIpConfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("myNonPrimaryPublicIpConfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("myPrimaryPrivateIpConfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }}, + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), // }, - // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - // { - // Name: to.Ptr("dataInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // { - // Name: to.Ptr("managementInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - // }, - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("latest"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // PrivateIPAddress: to.Ptr("192.168.12.9"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("myPrimaryPublicIpConfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("myNonPrimaryPublicIpConfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("myPrimaryPrivateIpConfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myPrimaryPublicIpConfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // PublicIPAddress: to.Ptr("40.30.2.4"), - // }, - // { - // Name: to.Ptr("myNonPrimaryPublicIpConfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.6"), - // PublicIPAddress: to.Ptr("40.30.2.5"), - // }, - // { - // Name: to.Ptr("myPrimaryPrivateIpConfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.7"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.8"), - // PublicIPAddress: to.Ptr(""), - // }}, + // }, + // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + // { + // Name: to.Ptr("dataInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePrivateNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // { + // Name: to.Ptr("managementInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePublicNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), // }, - // } + // }, + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("latest"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceVnetAdditionalPrivatePut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicAdditionalPrivateNic() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceVnetIngressPut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicIncludingInternetIngress() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("West US"), Properties: &armnetwork.VirtualAppliancePropertiesFormat{ BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + }, + InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/slbip"), + }, + }, NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ { Name: to.Ptr("dataInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePrivateNic)}, + to.Ptr(armnetwork.NvaNicTypePrivateNic), + }, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), }, }, { Name: to.Ptr("managementInterface"), Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePublicNic)}, - Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + to.Ptr(armnetwork.NvaNicTypePublicNic), }, - }, - { - Name: to.Ptr("myAdditionalInterface"), - Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypeAdditionalPrivateNic)}, Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), }, - }}, + }, + }, NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ BundledScaleUnit: to.Ptr("1"), MarketPlaceVersion: to.Ptr("latest"), @@ -907,335 +922,144 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPriva }, VirtualApplianceAsn: to.Ptr[int64](10000), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - // { - // Name: to.Ptr("dataInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // { - // Name: to.Ptr("managementInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - // }, - // }, - // { - // Name: to.Ptr("myAdditionalInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypeAdditionalPrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), - // }, - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("latest"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // PrivateIPAddress: to.Ptr("192.168.12.7"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myAdditionalInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myAdditionalInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.6"), - // PublicIPAddress: to.Ptr(""), - // }}, - // }, - // } + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/slbip"), + // }, + // }, + // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + // { + // Name: to.Ptr("dataInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePrivateNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // { + // Name: to.Ptr("managementInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePublicNic), + // }, + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + // }, + // }, + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("latest"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("managementInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("dataInterface-ipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceVnetAdditionalPublicPut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicAdditionalPublicNic() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceVnetNetworkProfilePut.json +func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNvaInVNetWithPrivateNicPublicNicIncludingNetworkProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("West US"), Properties: &armnetwork.VirtualAppliancePropertiesFormat{ BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + }, CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - { - Name: to.Ptr("dataInterface"), - Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - }, - }, - { - Name: to.Ptr("managementInterface"), - Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypePublicNic)}, - Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - }, - }, - { - Name: to.Ptr("myAdditionalPublicInterface"), - Type: []*armnetwork.NvaNicType{ - to.Ptr(armnetwork.NvaNicTypeAdditionalPublicNic)}, - Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), - }, - }}, - NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - BundledScaleUnit: to.Ptr("1"), - MarketPlaceVersion: to.Ptr("latest"), - Vendor: to.Ptr("Cisco SDWAN"), + to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), }, - VirtualApplianceAsn: to.Ptr[int64](10000), - }, - }, 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ - // { - // Name: to.Ptr("dataInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePrivateNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // { - // Name: to.Ptr("managementInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypePublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), - // }, - // }, - // { - // Name: to.Ptr("myAdditionalPublicInterface"), - // Type: []*armnetwork.NvaNicType{ - // to.Ptr(armnetwork.NvaNicTypeAdditionalPublicNic)}, - // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet3"), - // }, - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("latest"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // PrivateIPAddress: to.Ptr("192.168.12.7"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("managementInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("dataInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("myAdditionalPublicInterface-ipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.5"), - // PublicIPAddress: to.Ptr("40.30.2.4"), - // }, - // { - // Name: to.Ptr("myAdditionalPublicInterface-ipconfig"), - // InstanceName: to.Ptr("nva_1"), - // NicType: to.Ptr(armnetwork.NicTypeInResponse("")), - // PrivateIPAddress: to.Ptr("192.168.12.6"), - // PublicIPAddress: to.Ptr("40.30.2.5"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualAppliancePut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppliance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - { - Name: to.Ptr("exrsdwan"), - HasPublicIP: to.Ptr(true), - }}, - BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - { - ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - }}, NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ { @@ -1243,17 +1067,18 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppl Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ { - Name: to.Ptr("publicnicipconfig"), + Name: to.Ptr("myPrimaryPublicIpConfig"), Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ Primary: to.Ptr(true), }, }, { - Name: to.Ptr("publicnicipconfig-2"), + Name: to.Ptr("myNonPrimaryPublicIpConfig"), Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ Primary: to.Ptr(false), }, - }}, + }, + }, }, }, { @@ -1261,29 +1086,51 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppl Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ { - Name: to.Ptr("privatenicipconfig"), + Name: to.Ptr("myPrimaryPrivateIpConfig"), Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ Primary: to.Ptr(true), }, }, { - Name: to.Ptr("privatenicipconfig-2"), + Name: to.Ptr("myNonPrimaryPrivateIpConfig"), Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ Primary: to.Ptr(false), }, - }}, + }, + }, }, - }}, + }, + }, + }, + NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + { + Name: to.Ptr("dataInterface"), + Type: []*armnetwork.NvaNicType{ + to.Ptr(armnetwork.NvaNicTypePrivateNic), + }, + Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + }, + }, + { + Name: to.Ptr("managementInterface"), + Type: []*armnetwork.NvaNicType{ + to.Ptr(armnetwork.NvaNicTypePublicNic), + }, + Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), + }, + }, }, NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ BundledScaleUnit: to.Ptr("1"), - MarketPlaceVersion: to.Ptr("12.1"), + MarketPlaceVersion: to.Ptr("latest"), Vendor: to.Ptr("Cisco SDWAN"), }, VirtualApplianceAsn: to.Ptr[int64](10000), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), }, }, nil) if err != nil { @@ -1291,295 +1138,407 @@ func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppl } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualAppliancesClientCreateOrUpdateResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - // { - // Name: to.Ptr("exrsdwan"), - // HasPublicIP: to.Ptr(true), - // }}, - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("myPrimaryPublicIpConfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("myNonPrimaryPublicIpConfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, // }, // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // }, + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("myPrimaryPrivateIpConfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, // }, - // }}, - // }, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // NvaInterfaceConfigurations: []*armnetwork.NvaInterfaceConfigurationsProperties{ + // { + // Name: to.Ptr("dataInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePrivateNic), // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("managementInterface"), + // Type: []*armnetwork.NvaNicType{ + // to.Ptr(armnetwork.NvaNicTypePublicNic), // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), + // Subnet: &armnetwork.NvaInVnetSubnetReferenceProperties{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet2"), // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // PrivateIPAddress: to.Ptr("10.1.113.4"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSaaSPut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createSaaSNetworkVirtualAppliance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - Delegation: &armnetwork.DelegationProperties{ - ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), - }, - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - }, 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.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // Delegation: &armnetwork.DelegationProperties{ + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("latest"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.9"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), - // }, - // DeploymentType: to.Ptr("PartnerManaged"), - // PartnerManagedResource: &armnetwork.PartnerManagedResourceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Lifter/firewalls/paloAltoFirewall"), - // InternalLoadBalancerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustILB"), - // StandardLoadBalancerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustSLB"), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("myPrimaryPublicIpConfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("myNonPrimaryPublicIpConfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("myPrimaryPrivateIpConfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myPrimaryPublicIpConfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // PublicIPAddress: to.Ptr("40.30.2.4"), + // }, + // { + // Name: to.Ptr("myNonPrimaryPublicIpConfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.6"), + // PublicIPAddress: to.Ptr("40.30.2.5"), + // }, + // { + // Name: to.Ptr("myPrimaryPrivateIpConfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.7"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("myNonPrimaryPrivateIpConfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.8"), + // PublicIPAddress: to.Ptr(""), + // }, + // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceEmptyRestart.json -func ExampleVirtualAppliancesClient_BeginRestart_restartAllNetworkVirtualApplianceVMsInVmScaleSet() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceDelete.json +func ExampleVirtualAppliancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginRestart(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientBeginRestartOptions{NetworkVirtualApplianceInstanceIDs: nil}) + poller, err := clientFactory.NewVirtualAppliancesClient().BeginDelete(ctx, "rg1", "nva", 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) + log.Fatalf("failed to poll 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.VirtualApplianceInstanceIDs = armnetwork.VirtualApplianceInstanceIDs{ - // InstanceIDs: []*string{ - // }, + // res = armnetwork.VirtualAppliancesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSpecificRestart.json -func ExampleVirtualAppliancesClient_BeginRestart_restartSpecificNetworkVirtualApplianceVMsInVmScaleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginRestart(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientBeginRestartOptions{NetworkVirtualApplianceInstanceIDs: 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.VirtualApplianceInstanceIDs = armnetwork.VirtualApplianceInstanceIDs{ - // InstanceIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSpecificReimage.json -func ExampleVirtualAppliancesClient_BeginReimage() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceGet.json +func ExampleVirtualAppliancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginReimage(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientBeginReimageOptions{NetworkVirtualApplianceInstanceIDs: nil}) + res, err := clientFactory.NewVirtualAppliancesClient().Get(ctx, "rg1", "nva", 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.VirtualApplianceInstanceIDs = armnetwork.VirtualApplianceInstanceIDs{ - // InstanceIDs: []*string{ - // to.Ptr("0")}, - // } + // res = armnetwork.VirtualAppliancesClientGetResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, + // }, + // }, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ + // { + // Name: to.Ptr("exrsdwan"), + // HasPublicIP: to.Ptr(true), + // }, + // }, + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, + // CloudInitConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // { + // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), + // }, + // }, + // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("publicnicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), + // }, + // }, + // }, + // }, + // }, + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("privatenicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("12.1"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // PrivateIPAddress: to.Ptr("192.168.12.11"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/networkVirtualApplianceConnections/connection1"), + // }, + // }, + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("publicnicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("privatenicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("exrsdwan"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), + // PrivateIPAddress: to.Ptr("192.168.12.5"), + // PublicIPAddress: to.Ptr("4.231.25.19"), + // }, + // { + // Name: to.Ptr("publicnicipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.6"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.7"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("privatenicipconfig"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.8"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.9"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("exrsdwan"), + // InstanceName: to.Ptr("nva_1"), + // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), + // PrivateIPAddress: to.Ptr("192.168.12.10"), + // PublicIPAddress: to.Ptr("4.231.25.19"), + // }, + // }, + // VirtualApplianceSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), + // }, + // }, + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceBootDiagnostics.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceBootDiagnostics.json func ExampleVirtualAppliancesClient_BeginGetBootDiagnosticLogs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1593,28 +1552,30 @@ func ExampleVirtualAppliancesClient_BeginGetBootDiagnosticLogs() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualApplianceInstanceID = armnetwork.VirtualApplianceInstanceID{ - // InstanceID: to.Ptr[int32](0), + // res = armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse{ + // VirtualApplianceInstanceID: armnetwork.VirtualApplianceInstanceID{ + // InstanceID: to.Ptr[int32](0), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceListByResourceGroup.json -func ExampleVirtualAppliancesClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceListBySubscription.json +func ExampleVirtualAppliancesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualAppliancesClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewVirtualAppliancesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1625,150 +1586,163 @@ func ExampleVirtualAppliancesClient_NewListByResourceGroupPager() { _ = 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.VirtualApplianceListResult = armnetwork.VirtualApplianceListResult{ - // Value: []*armnetwork.VirtualAppliance{ - // { - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // page = armnetwork.VirtualAppliancesClientListResponse{ + // VirtualApplianceListResult: armnetwork.VirtualApplianceListResult{ + // Value: []*armnetwork.VirtualAppliance{ + // { + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - // { - // Name: to.Ptr("exrsdwan"), - // HasPublicIP: to.Ptr(true), - // }}, - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ + // { + // Name: to.Ptr("exrsdwan"), + // HasPublicIP: to.Ptr(true), + // }, + // }, + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // { + // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), + // }, + // }, + // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("publicnicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), + // }, + // }, // }, // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // }, + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("privatenicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), + // }, + // }, // }, - // }}, + // }, + // }, // }, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("12.1"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("publicnicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // PrivateIPAddress: to.Ptr("10.1.113.4"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // { + // Name: to.Ptr("publicnicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("privatenicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("exrsdwan"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), + // PrivateIPAddress: to.Ptr("10.1.113.4"), + // PublicIPAddress: to.Ptr("4.231.25.19"), // }, // }, - // }}, - // } + // VirtualApplianceSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), + // }, + // }, + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceListBySubscription.json -func ExampleVirtualAppliancesClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceListByResourceGroup.json +func ExampleVirtualAppliancesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualAppliancesClient().NewListPager(nil) + pager := clientFactory.NewVirtualAppliancesClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1779,134 +1753,320 @@ func ExampleVirtualAppliancesClient_NewListPager() { _ = 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.VirtualApplianceListResult = armnetwork.VirtualApplianceListResult{ - // Value: []*armnetwork.VirtualAppliance{ - // { - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // page = armnetwork.VirtualAppliancesClientListByResourceGroupResponse{ + // VirtualApplianceListResult: armnetwork.VirtualApplianceListResult{ + // Value: []*armnetwork.VirtualAppliance{ + // { + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - // { - // Name: to.Ptr("exrsdwan"), - // HasPublicIP: to.Ptr(true), - // }}, - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ + // { + // Name: to.Ptr("exrsdwan"), + // HasPublicIP: to.Ptr(true), + // }, + // }, + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // InboundSecurityRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), + // }, + // }, + // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ + // { + // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), + // }, + // }, + // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ + // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("publicnicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("publicnicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, // }, // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, + // }, + // { + // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), + // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ + // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ + // { + // Name: to.Ptr("privatenicipconfig"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ + // Primary: to.Ptr(false), // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, + // }, // }, - // }}, + // }, + // }, // }, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("12.1"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("publicnicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // PrivateIPAddress: to.Ptr("10.1.113.4"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // { + // Name: to.Ptr("publicnicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // PublicIPAddress: to.Ptr("40.30.2.3"), + // }, + // { + // Name: to.Ptr("privatenicipconfig"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.3"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("privatenicipconfig-2"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), + // PrivateIPAddress: to.Ptr("192.168.12.4"), + // PublicIPAddress: to.Ptr(""), + // }, + // { + // Name: to.Ptr("exrsdwan"), + // InstanceName: to.Ptr("nva_0"), + // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), + // PrivateIPAddress: to.Ptr("10.1.113.4"), + // PublicIPAddress: to.Ptr("4.231.25.19"), + // }, + // }, + // VirtualApplianceSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), // }, // }, - // }}, - // } + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSpecificReimage.json +func ExampleVirtualAppliancesClient_BeginReimage() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualAppliancesClient().BeginReimage(ctx, "rg1", "nva", 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 poll 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 = armnetwork.VirtualAppliancesClientReimageResponse{ + // VirtualApplianceInstanceIDs: armnetwork.VirtualApplianceInstanceIDs{ + // InstanceIDs: []*string{ + // to.Ptr("0"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceEmptyRestart.json +func ExampleVirtualAppliancesClient_BeginRestart_restartAllNetworkVirtualApplianceVMSInVMScaleSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualAppliancesClient().BeginRestart(ctx, "rg1", "nva", 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 poll 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 = armnetwork.VirtualAppliancesClientRestartResponse{ + // VirtualApplianceInstanceIDs: armnetwork.VirtualApplianceInstanceIDs{ + // InstanceIDs: []*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSpecificRestart.json +func ExampleVirtualAppliancesClient_BeginRestart_restartSpecificNetworkVirtualApplianceVMSInVMScaleSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualAppliancesClient().BeginRestart(ctx, "rg1", "nva", 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 poll 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 = armnetwork.VirtualAppliancesClientRestartResponse{ + // VirtualApplianceInstanceIDs: armnetwork.VirtualApplianceInstanceIDs{ + // InstanceIDs: []*string{ + // to.Ptr("0"), + // to.Ptr("1"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceUpdateTags.json +func ExampleVirtualAppliancesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualAppliancesClient().UpdateTags(ctx, "rg1", "nva", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VirtualAppliancesClientUpdateTagsResponse{ + // VirtualAppliance: armnetwork.VirtualAppliance{ + // Name: to.Ptr("nva"), + // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, + // }, + // }, + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ + // AddressPrefix: to.Ptr("192.168.1.0/16"), + // BootStrapConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig"), + // }, + // CloudInitConfigurationBlobs: []*string{ + // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig"), + // }, + // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ + // BundledScaleUnit: to.Ptr("1"), + // MarketPlaceVersion: to.Ptr("12.1"), + // Vendor: to.Ptr("Cisco SDWAN"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualApplianceAsn: to.Ptr[int64](10000), + // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ + // { + // Name: to.Ptr("managementNic"), + // PrivateIPAddress: to.Ptr("192.168.12.1"), + // PublicIPAddress: to.Ptr("40.30.2.2"), + // }, + // { + // Name: to.Ptr("privateNic-1"), + // PrivateIPAddress: to.Ptr("192.168.12.2"), + // }, + // }, + // VirtualApplianceSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), + // }, + // }, + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go index eda384d27374..2be917062801 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualApplianceSitesClient contains the methods for the VirtualApplianceSites group. // Don't use this type directly, use NewVirtualApplianceSitesClient() instead. +// +// Generated from API version 2025-07-01 type VirtualApplianceSitesClient struct { internal *arm.Client subscriptionID string } // NewVirtualApplianceSitesClient creates a new instance of VirtualApplianceSitesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualApplianceSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSitesClient, error) { @@ -43,11 +43,9 @@ func NewVirtualApplianceSitesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - siteName - The name of the site. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - siteName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - parameters - Parameters supplied to the create or update Network Virtual Appliance Site operation. // - options - VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *VirtualApplianceSitesClient) BeginCreateOrUpdate(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceSitesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualApplianceSitesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualApplianceSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceSitesClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *VirtualApplianceSitesClient) createOrUpdate(ctx context.Context, r // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, _ *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte return nil, errors.New("parameter siteName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes the specified site from a Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - siteName - The name of the site. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - siteName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete // method. func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*runtime.Poller[VirtualApplianceSitesClientDeleteResponse], error) { @@ -143,8 +137,7 @@ func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceSitesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, reso // Delete - Deletes the specified site from a Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualApplianceSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceSitesClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *VirtualApplianceSitesClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, _ *VirtualApplianceSitesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +189,21 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte return nil, errors.New("parameter siteName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. -// - siteName - The name of the site. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - siteName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualApplianceSitesClientGetOptions contains the optional parameters for the VirtualApplianceSitesClient.Get // method. func (client *VirtualApplianceSitesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientGetOptions) (VirtualApplianceSitesClientGetResponse, error) { @@ -243,6 +231,10 @@ func (client *VirtualApplianceSitesClient) Get(ctx context.Context, resourceGrou // getCreateRequest creates the Get request. func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, _ *VirtualApplianceSitesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter siteName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,10 +268,8 @@ func (client *VirtualApplianceSitesClient) getHandleResponse(resp *http.Response } // NewListPager - Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.NewListPager // method. func (client *VirtualApplianceSitesClient) NewListPager(resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) *runtime.Pager[VirtualApplianceSitesClientListResponse] { @@ -312,6 +298,10 @@ func (client *VirtualApplianceSitesClient) NewListPager(resourceGroupName string // listCreateRequest creates the List request. func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, _ *VirtualApplianceSitesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go index 768439277349..a9092cada62a 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go @@ -1,136 +1,142 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSiteDelete.json -func ExampleVirtualApplianceSitesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSitePut.json +func ExampleVirtualApplianceSitesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginDelete(ctx, "rg1", "nva", "site1", nil) + poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", "site1", armnetwork.VirtualApplianceSite{ + Properties: &armnetwork.VirtualApplianceSiteProperties{ + AddressPrefix: to.Ptr("192.168.1.0/24"), + O365Policy: &armnetwork.Office365PolicyProperties{ + BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ + Default: to.Ptr(true), + Allow: to.Ptr(true), + Optimize: to.Ptr(true), + }, + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualApplianceSitesClientCreateOrUpdateResponse{ + // VirtualApplianceSite: armnetwork.VirtualApplianceSite{ + // Name: to.Ptr("site1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), + // Properties: &armnetwork.VirtualApplianceSiteProperties{ + // AddressPrefix: to.Ptr("192.168.1.0/24"), + // O365Policy: &armnetwork.Office365PolicyProperties{ + // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ + // Default: to.Ptr(true), + // Allow: to.Ptr(true), + // Optimize: to.Ptr(true), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSiteGet.json -func ExampleVirtualApplianceSitesClient_Get() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSiteDelete.json +func ExampleVirtualApplianceSitesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualApplianceSitesClient().Get(ctx, "rg1", "nva", "site1", nil) + poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginDelete(ctx, "rg1", "nva", "site1", 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 poll 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.VirtualApplianceSite = armnetwork.VirtualApplianceSite{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.VirtualApplianceSitesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSitePut.json -func ExampleVirtualApplianceSitesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSiteGet.json +func ExampleVirtualApplianceSitesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", "site1", armnetwork.VirtualApplianceSite{ - Properties: &armnetwork.VirtualApplianceSiteProperties{ - AddressPrefix: to.Ptr("192.168.1.0/24"), - O365Policy: &armnetwork.Office365PolicyProperties{ - BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - Default: to.Ptr(true), - Allow: to.Ptr(true), - Optimize: to.Ptr(true), - }, - }, - }, - }, nil) + res, err := clientFactory.NewVirtualApplianceSitesClient().Get(ctx, "rg1", "nva", "site1", 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.VirtualApplianceSite = armnetwork.VirtualApplianceSite{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), + // res = armnetwork.VirtualApplianceSitesClientGetResponse{ + // VirtualApplianceSite: armnetwork.VirtualApplianceSite{ + // Name: to.Ptr("site1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), + // Properties: &armnetwork.VirtualApplianceSiteProperties{ + // AddressPrefix: to.Ptr("192.168.1.0/24"), + // O365Policy: &armnetwork.Office365PolicyProperties{ + // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ + // Default: to.Ptr(true), + // Allow: to.Ptr(true), + // Optimize: to.Ptr(true), + // }, // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSiteList.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSiteList.json func ExampleVirtualApplianceSitesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -145,24 +151,27 @@ func ExampleVirtualApplianceSitesClient_NewListPager() { _ = 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.VirtualApplianceSiteListResult = armnetwork.VirtualApplianceSiteListResult{ - // Value: []*armnetwork.VirtualApplianceSite{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), + // page = armnetwork.VirtualApplianceSitesClientListResponse{ + // VirtualApplianceSiteListResult: armnetwork.VirtualApplianceSiteListResult{ + // Value: []*armnetwork.VirtualApplianceSite{ + // { + // Name: to.Ptr("site1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), + // Properties: &armnetwork.VirtualApplianceSiteProperties{ + // AddressPrefix: to.Ptr("192.168.1.0/24"), + // O365Policy: &armnetwork.Office365PolicyProperties{ + // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ + // Default: to.Ptr(true), + // Allow: to.Ptr(true), + // Optimize: to.Ptr(true), + // }, // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go index cd48875c5f67..3b505af7220f 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualApplianceSKUsClient contains the methods for the VirtualApplianceSKUs group. // Don't use this type directly, use NewVirtualApplianceSKUsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualApplianceSKUsClient struct { internal *arm.Client subscriptionID string } // NewVirtualApplianceSKUsClient creates a new instance of VirtualApplianceSKUsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualApplianceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSKUsClient, error) { @@ -43,8 +43,6 @@ func NewVirtualApplianceSKUsClient(subscriptionID string, credential azcore.Toke // Get - Retrieves a single available sku for network virtual appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - skuName - Name of the Sku. // - options - VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get // method. @@ -86,8 +84,8 @@ func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -102,8 +100,6 @@ func (client *VirtualApplianceSKUsClient) getHandleResponse(resp *http.Response) } // NewListPager - List all SKUs available for a virtual appliance. -// -// Generated from API version 2025-05-01 // - options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager // method. func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { @@ -141,8 +137,8 @@ func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go index 15085bdf9117..090f336b91a3 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go @@ -1,27 +1,68 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSkuList.json +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSkuGet.json +func ExampleVirtualApplianceSKUsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualApplianceSKUsClient().Get(ctx, "ciscoSdwan", 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 = armnetwork.VirtualApplianceSKUsClientGetResponse{ + // VirtualApplianceSKU: armnetwork.VirtualApplianceSKU{ + // Name: to.Ptr("ciscoSdwan"), + // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), + // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ + // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ + // { + // InstanceCount: to.Ptr[int32](2), + // ScaleUnit: to.Ptr("1"), + // }, + // { + // InstanceCount: to.Ptr[int32](2), + // ScaleUnit: to.Ptr("2"), + // }, + // }, + // AvailableVersions: []*string{ + // to.Ptr("11.12"), + // }, + // Vendor: to.Ptr("Cisco"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/NetworkVirtualApplianceSkuList.json func ExampleVirtualApplianceSKUsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,68 +77,33 @@ func ExampleVirtualApplianceSKUsClient_NewListPager() { _ = 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.VirtualApplianceSKUListResult = armnetwork.VirtualApplianceSKUListResult{ - // Value: []*armnetwork.VirtualApplianceSKU{ - // { - // Name: to.Ptr("ciscoSdwan"), - // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ - // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("1"), + // page = armnetwork.VirtualApplianceSKUsClientListResponse{ + // VirtualApplianceSKUListResult: armnetwork.VirtualApplianceSKUListResult{ + // Value: []*armnetwork.VirtualApplianceSKU{ + // { + // Name: to.Ptr("ciscoSdwan"), + // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), + // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ + // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ + // { + // InstanceCount: to.Ptr[int32](2), + // ScaleUnit: to.Ptr("1"), + // }, + // { + // InstanceCount: to.Ptr[int32](2), + // ScaleUnit: to.Ptr("2"), + // }, + // }, + // AvailableVersions: []*string{ + // to.Ptr("11.12"), // }, - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("2"), - // }}, - // AvailableVersions: []*string{ - // to.Ptr("11.12")}, // Vendor: to.Ptr("Cisco"), // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkVirtualApplianceSkuGet.json -func ExampleVirtualApplianceSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + // }, + // }, + // }, + // } } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceSKUsClient().Get(ctx, "ciscoSdwan", 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.VirtualApplianceSKU = armnetwork.VirtualApplianceSKU{ - // Name: to.Ptr("ciscoSdwan"), - // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ - // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("1"), - // }, - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("2"), - // }}, - // AvailableVersions: []*string{ - // to.Ptr("11.12")}, - // Vendor: to.Ptr("Cisco"), - // }, - // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go index e3b1cd0af3d1..f49f8fbeae7c 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualHubBgpConnectionClient contains the methods for the VirtualHubBgpConnection group. // Don't use this type directly, use NewVirtualHubBgpConnectionClient() instead. +// +// Generated from API version 2025-07-01 type VirtualHubBgpConnectionClient struct { internal *arm.Client subscriptionID string } // NewVirtualHubBgpConnectionClient creates a new instance of VirtualHubBgpConnectionClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualHubBgpConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionClient, error) { @@ -43,9 +43,7 @@ func NewVirtualHubBgpConnectionClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. // - parameters - Parameters of Bgp connection. @@ -58,8 +56,7 @@ func (client *VirtualHubBgpConnectionClient) BeginCreateOrUpdate(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualHubBgpConnectionClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubBgpConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,9 +125,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHubBgpConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. // - options - VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete @@ -143,8 +137,7 @@ func (client *VirtualHubBgpConnectionClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *VirtualHubBgpConnectionClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubBgpConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionClient.BeginDelete" @@ -203,17 +194,14 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a Virtual Hub Bgp Connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. // - options - VirtualHubBgpConnectionClientGetOptions contains the optional parameters for the VirtualHubBgpConnectionClient.Get @@ -264,8 +252,8 @@ func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go index 3ae57ccc73ee..75698890494d 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go @@ -1,117 +1,147 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubBgpConnectionGet.json -func ExampleVirtualHubBgpConnectionClient_Get() { +// Generated from example definition: 2025-07-01/VirtualHubBgpConnectionPut.json +func ExampleVirtualHubBgpConnectionClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualHubBgpConnectionClient().Get(ctx, "rg1", "hub1", "conn1", nil) + poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "conn1", armnetwork.BgpConnection{ + Properties: &armnetwork.BgpConnectionProperties{ + HubVirtualNetworkConnection: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + }, + PeerAsn: to.Ptr[int64](20000), + PeerIP: to.Ptr("192.168.1.5"), + RoutingConfiguration: &armnetwork.RoutingConfiguration{ + InboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap1"), + }, + OutboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap2"), + }, + }, + }, + }, 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 poll 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.BgpConnection = armnetwork.BgpConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + // res = armnetwork.VirtualHubBgpConnectionClientCreateOrUpdateResponse{ + // BgpConnection: armnetwork.BgpConnection{ + // Name: to.Ptr("conn1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), + // Properties: &armnetwork.BgpConnectionProperties{ + // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), + // HubVirtualNetworkConnection: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + // }, + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap2"), + // }, + // }, // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubBgpConnectionPut.json -func ExampleVirtualHubBgpConnectionClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualHubBgpConnectionDelete.json +func ExampleVirtualHubBgpConnectionClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "conn1", armnetwork.BgpConnection{ - Properties: &armnetwork.BgpConnectionProperties{ - HubVirtualNetworkConnection: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - }, - PeerAsn: to.Ptr[int64](20000), - PeerIP: to.Ptr("192.168.1.5"), - }, - }, nil) + poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginDelete(ctx, "rg1", "hub1", "conn1", 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) + log.Fatalf("failed to poll 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.BgpConnection = armnetwork.BgpConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.VirtualHubBgpConnectionClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubBgpConnectionDelete.json -func ExampleVirtualHubBgpConnectionClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualHubBgpConnectionGet.json +func ExampleVirtualHubBgpConnectionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginDelete(ctx, "rg1", "hub1", "conn1", nil) + res, err := clientFactory.NewVirtualHubBgpConnectionClient().Get(ctx, "rg1", "hub1", "conn1", 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) - } + // 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 = armnetwork.VirtualHubBgpConnectionClientGetResponse{ + // BgpConnection: armnetwork.BgpConnection{ + // Name: to.Ptr("conn1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), + // Properties: &armnetwork.BgpConnectionProperties{ + // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), + // HubVirtualNetworkConnection: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + // }, + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap2"), + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go index 5d78f8336be2..62cbc72f1486 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualHubBgpConnectionsClient contains the methods for the VirtualHubBgpConnections group. // Don't use this type directly, use NewVirtualHubBgpConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualHubBgpConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVirtualHubBgpConnectionsClient creates a new instance of VirtualHubBgpConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionsClient, error) { @@ -42,9 +42,7 @@ func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore. } // NewListPager - Retrieves the details of all VirtualHubBgpConnections. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.NewListPager // method. @@ -91,8 +89,8 @@ func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -108,11 +106,9 @@ func (client *VirtualHubBgpConnectionsClient) listHandleResponse(resp *http.Resp // BeginListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - hubName - The name of the virtual hub. -// - connectionName - The name of the virtual hub bgp connection. +// - connectionName - The name of the bgp connection. // - options - VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes // method. func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse], error) { @@ -122,8 +118,7 @@ func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -135,8 +130,6 @@ func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx cont // ListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes" @@ -161,6 +154,10 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutes(ctx context.C // listAdvertisedRoutesCreateRequest creates the ListAdvertisedRoutes request. func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, _ *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -173,28 +170,22 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - hubName - The name of the virtual hub. -// - connectionName - The name of the virtual hub bgp connection. +// - connectionName - The name of the bgp connection. // - options - VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes // method. func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListLearnedRoutesResponse], error) { @@ -204,8 +195,7 @@ func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListLearnedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -217,8 +207,6 @@ func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context // ListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubBgpConnectionsClient) listLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionsClient.BeginListLearnedRoutes" @@ -243,6 +231,10 @@ func (client *VirtualHubBgpConnectionsClient) listLearnedRoutes(ctx context.Cont // listLearnedRoutesCreateRequest creates the ListLearnedRoutes request. func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, _ *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go index eccbe91b4b89..3ae35a99e0df 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubBgpConnectionList.json +// Generated from example definition: 2025-07-01/VirtualHubBgpConnectionList.json func ExampleVirtualHubBgpConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,168 +33,187 @@ func ExampleVirtualHubBgpConnectionsClient_NewListPager() { _ = 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.ListVirtualHubBgpConnectionResults = armnetwork.ListVirtualHubBgpConnectionResults{ - // Value: []*armnetwork.BgpConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + // page = armnetwork.VirtualHubBgpConnectionsClientListResponse{ + // ListVirtualHubBgpConnectionResults: armnetwork.ListVirtualHubBgpConnectionResults{ + // Value: []*armnetwork.BgpConnection{ + // { + // Name: to.Ptr("conn1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), + // Properties: &armnetwork.BgpConnectionProperties{ + // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), + // HubVirtualNetworkConnection: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), + // }, + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/routeMaps/routeMap2"), + // }, + // }, // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeerListLearnedRoute.json -func ExampleVirtualHubBgpConnectionsClient_BeginListLearnedRoutes() { +// Generated from example definition: 2025-07-01/VirtualRouterPeerListAdvertisedRoute.json +func ExampleVirtualHubBgpConnectionsClient_BeginListAdvertisedRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListLearnedRoutes(ctx, "rg1", "virtualRouter1", "peer1", nil) + poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListAdvertisedRoutes(ctx, "rg1", "virtualRouter1", "peer1", 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) + log.Fatalf("failed to poll 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.Value = map[string][]*armnetwork.PeerRoute{ - // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), + // res = armnetwork.VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse{ + // Value: map[string][]*armnetwork.PeerRoute{ + // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.45.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.85.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.100.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, // }, - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.5"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }}, - // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), + // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.45.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.85.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, + // { + // AsPath: to.Ptr("65515"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.100.0.0/16"), + // NextHop: to.Ptr("10.85.3.4"), + // Origin: to.Ptr("Igp"), + // SourcePeer: to.Ptr("10.85.3.4"), + // Weight: to.Ptr[int32](0), + // }, // }, - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.5"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }}, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeerListAdvertisedRoute.json -func ExampleVirtualHubBgpConnectionsClient_BeginListAdvertisedRoutes() { +// Generated from example definition: 2025-07-01/VirtualRouterPeerListLearnedRoute.json +func ExampleVirtualHubBgpConnectionsClient_BeginListLearnedRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListAdvertisedRoutes(ctx, "rg1", "virtualRouter1", "peer1", nil) + poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListLearnedRoutes(ctx, "rg1", "virtualRouter1", "peer1", 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) + log.Fatalf("failed to poll 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.Value = map[string][]*armnetwork.PeerRoute{ - // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.45.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.85.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.100.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }}, - // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.45.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), + // res = armnetwork.VirtualHubBgpConnectionsClientListLearnedRoutesResponse{ + // Value: map[string][]*armnetwork.PeerRoute{ + // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ + // { + // AsPath: to.Ptr("65002-65001"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.101.0.0/16"), + // NextHop: to.Ptr("10.85.4.4"), + // Origin: to.Ptr("EBgp"), + // SourcePeer: to.Ptr("10.85.4.4"), + // Weight: to.Ptr[int32](32768), + // }, + // { + // AsPath: to.Ptr("65002-65001"), + // LocalAddress: to.Ptr("10.85.3.5"), + // Network: to.Ptr("10.101.0.0/16"), + // NextHop: to.Ptr("10.85.4.4"), + // Origin: to.Ptr("EBgp"), + // SourcePeer: to.Ptr("10.85.4.4"), + // Weight: to.Ptr[int32](32768), + // }, // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.85.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), + // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ + // { + // AsPath: to.Ptr("65002-65001"), + // LocalAddress: to.Ptr("10.85.3.4"), + // Network: to.Ptr("10.101.0.0/16"), + // NextHop: to.Ptr("10.85.4.4"), + // Origin: to.Ptr("EBgp"), + // SourcePeer: to.Ptr("10.85.4.4"), + // Weight: to.Ptr[int32](32768), + // }, + // { + // AsPath: to.Ptr("65002-65001"), + // LocalAddress: to.Ptr("10.85.3.5"), + // Network: to.Ptr("10.101.0.0/16"), + // NextHop: to.Ptr("10.85.4.4"), + // Origin: to.Ptr("EBgp"), + // SourcePeer: to.Ptr("10.85.4.4"), + // Weight: to.Ptr[int32](32768), + // }, // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.100.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }}, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go index 308c94954605..c79b00d5b61c 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualHubIPConfigurationClient contains the methods for the VirtualHubIPConfiguration group. // Don't use this type directly, use NewVirtualHubIPConfigurationClient() instead. +// +// Generated from API version 2025-07-01 type VirtualHubIPConfigurationClient struct { internal *arm.Client subscriptionID string } // NewVirtualHubIPConfigurationClient creates a new instance of VirtualHubIPConfigurationClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualHubIPConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubIPConfigurationClient, error) { @@ -43,11 +43,9 @@ func NewVirtualHubIPConfigurationClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - ipConfigName - The name of the ipconfig. +// - ipConfigName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - parameters - Hub Ip Configuration parameters. // - options - VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *VirtualHubIPConfigurationClient) BeginCreateOrUpdate(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubIPConfigurationClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualHubIPConfigurationClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubIPConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubIPConfigurationClient.BeginCreateOrUpdate" @@ -118,9 +113,10 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHubBgpConnection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - ipConfigName - The name of the ipconfig. +// - ipConfigName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete // method. func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*runtime.Poller[VirtualHubIPConfigurationClientDeleteResponse], error) { @@ -143,8 +137,7 @@ func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubIPConfigurationClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, // Delete - Deletes a VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubIPConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubIPConfigurationClient.BeginDelete" @@ -203,19 +194,16 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a Virtual Hub Ip configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. -// - ipConfigName - The name of the ipconfig. +// - ipConfigName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualHubIPConfigurationClientGetOptions contains the optional parameters for the VirtualHubIPConfigurationClient.Get // method. func (client *VirtualHubIPConfigurationClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (VirtualHubIPConfigurationClientGetResponse, error) { @@ -264,8 +252,8 @@ func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +268,7 @@ func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Resp } // NewListPager - Retrieves the details of all VirtualHubIpConfigurations. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.NewListPager // method. @@ -329,8 +315,8 @@ func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go index b6689082fc65..47cfc4eba2d2 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go @@ -1,123 +1,129 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubIpConfigurationGet.json -func ExampleVirtualHubIPConfigurationClient_Get() { +// Generated from example definition: 2025-07-01/VirtualHubIpConfigurationPut.json +func ExampleVirtualHubIPConfigurationClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualHubIPConfigurationClient().Get(ctx, "rg1", "hub1", "ipconfig1", nil) + poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "ipconfig1", armnetwork.HubIPConfiguration{ + Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + }, + }, + }, 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 poll 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.HubIPConfiguration = armnetwork.HubIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // res = armnetwork.VirtualHubIPConfigurationClientCreateOrUpdateResponse{ + // HubIPConfiguration: armnetwork.HubIPConfiguration{ + // Name: to.Ptr("ipconfig1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubIpConfigurationPut.json -func ExampleVirtualHubIPConfigurationClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualHubIpConfigurationDelete.json +func ExampleVirtualHubIPConfigurationClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "ipconfig1", armnetwork.HubIPConfiguration{ - Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - }, - }, - }, nil) + poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginDelete(ctx, "rg1", "hub1", "ipconfig1", 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) + log.Fatalf("failed to poll 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.HubIPConfiguration = armnetwork.HubIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, + // res = armnetwork.VirtualHubIPConfigurationClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubIpConfigurationDelete.json -func ExampleVirtualHubIPConfigurationClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualHubIpConfigurationGet.json +func ExampleVirtualHubIPConfigurationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginDelete(ctx, "rg1", "hub1", "ipconfig1", nil) + res, err := clientFactory.NewVirtualHubIPConfigurationClient().Get(ctx, "rg1", "hub1", "ipconfig1", 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) - } + // 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 = armnetwork.VirtualHubIPConfigurationClientGetResponse{ + // HubIPConfiguration: armnetwork.HubIPConfiguration{ + // Name: to.Ptr("ipconfig1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubIpConfigurationList.json +// Generated from example definition: 2025-07-01/VirtualHubIpConfigurationList.json func ExampleVirtualHubIPConfigurationClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -132,20 +138,23 @@ func ExampleVirtualHubIPConfigurationClient_NewListPager() { _ = 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.ListVirtualHubIPConfigurationResults = armnetwork.ListVirtualHubIPConfigurationResults{ - // Value: []*armnetwork.HubIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // page = armnetwork.VirtualHubIPConfigurationClientListResponse{ + // ListVirtualHubIPConfigurationResults: armnetwork.ListVirtualHubIPConfigurationResults{ + // Value: []*armnetwork.HubIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go index 0554ce03237c..58c803574055 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualHubRouteTableV2SClient contains the methods for the VirtualHubRouteTableV2S group. // Don't use this type directly, use NewVirtualHubRouteTableV2SClient() instead. +// +// Generated from API version 2025-07-01 type VirtualHubRouteTableV2SClient struct { internal *arm.Client subscriptionID string } // NewVirtualHubRouteTableV2SClient creates a new instance of VirtualHubRouteTableV2SClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualHubRouteTableV2SClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubRouteTableV2SClient, error) { @@ -43,10 +43,8 @@ func NewVirtualHubRouteTableV2SClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. -// - virtualHubName - The name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - routeTableName - The name of the VirtualHubRouteTableV2. // - virtualHubRouteTableV2Parameters - Parameters supplied to create or update VirtualHubRouteTableV2. // - options - VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate @@ -71,8 +69,6 @@ func (client *VirtualHubRouteTableV2SClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubRouteTableV2SClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubRouteTableV2SClient.BeginCreateOrUpdate" @@ -118,9 +114,10 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters); err != nil { return nil, err } @@ -129,10 +126,8 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. -// - virtualHubName - The name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - routeTableName - The name of the VirtualHubRouteTableV2. // - options - VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete // method. @@ -143,8 +138,7 @@ func (client *VirtualHubRouteTableV2SClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubRouteTableV2SClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +150,6 @@ func (client *VirtualHubRouteTableV2SClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubRouteTableV2SClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubRouteTableV2SClient.BeginDelete" @@ -203,18 +195,15 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. -// - virtualHubName - The name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualHubName - The name of the Virtual Hub. // - routeTableName - The name of the VirtualHubRouteTableV2. // - options - VirtualHubRouteTableV2SClientGetOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.Get // method. @@ -264,8 +253,8 @@ func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +269,7 @@ func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Respon } // NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.NewListPager // method. @@ -329,8 +316,8 @@ func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go index 9525a8adf5d9..3bb253db1298 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go @@ -1,101 +1,56 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubRouteTableV2Get.json -func ExampleVirtualHubRouteTableV2SClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubRouteTableV2SClient().Get(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", 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.VirtualHubRouteTableV2 = armnetwork.VirtualHubRouteTableV2{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), - // Name: to.Ptr("virtualHubRouteTable1a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubRouteTableV2Put.json +// Generated from example definition: 2025-07-01/VirtualHubRouteTableV2Put.json func ExampleVirtualHubRouteTableV2SClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualHubRouteTableV2SClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", armnetwork.VirtualHubRouteTableV2{ Properties: &armnetwork.VirtualHubRouteTableV2Properties{ AttachedConnections: []*string{ - to.Ptr("All_Vnets")}, + to.Ptr("All_Vnets"), + }, Routes: []*armnetwork.VirtualHubRouteV2{ { DestinationType: to.Ptr("CIDR"), Destinations: []*string{ to.Ptr("20.10.0.0/16"), - to.Ptr("20.20.0.0/16")}, + to.Ptr("20.20.0.0/16"), + }, NextHopType: to.Ptr("IPAddress"), NextHops: []*string{ - to.Ptr("10.0.0.68")}, + to.Ptr("10.0.0.68"), + }, }, { DestinationType: to.Ptr("CIDR"), Destinations: []*string{ - to.Ptr("0.0.0.0/0")}, + to.Ptr("0.0.0.0/0"), + }, NextHopType: to.Ptr("IPAddress"), NextHops: []*string{ - to.Ptr("10.0.0.68")}, - }}, + to.Ptr("10.0.0.68"), + }, + }, + }, }, }, nil) if err != nil { @@ -103,49 +58,57 @@ func ExampleVirtualHubRouteTableV2SClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualHubRouteTableV2 = armnetwork.VirtualHubRouteTableV2{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), - // Name: to.Ptr("virtualHubRouteTable1a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, + // res = armnetwork.VirtualHubRouteTableV2SClientCreateOrUpdateResponse{ + // VirtualHubRouteTableV2: armnetwork.VirtualHubRouteTableV2{ + // Name: to.Ptr("virtualHubRouteTable1a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Routes: []*armnetwork.VirtualHubRouteV2{ // { // DestinationType: to.Ptr("CIDR"), // Destinations: []*string{ // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // } + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubRouteTableV2Delete.json +// Generated from example definition: 2025-07-01/VirtualHubRouteTableV2Delete.json func ExampleVirtualHubRouteTableV2SClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -153,20 +116,81 @@ func ExampleVirtualHubRouteTableV2SClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll 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 = armnetwork.VirtualHubRouteTableV2SClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VirtualHubRouteTableV2Get.json +func ExampleVirtualHubRouteTableV2SClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) } + res, err := clientFactory.NewVirtualHubRouteTableV2SClient().Get(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", 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 = armnetwork.VirtualHubRouteTableV2SClientGetResponse{ + // VirtualHubRouteTableV2: armnetwork.VirtualHubRouteTableV2{ + // Name: to.Ptr("virtualHubRouteTable1a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubRouteTableV2List.json +// Generated from example definition: 2025-07-01/VirtualHubRouteTableV2List.json func ExampleVirtualHubRouteTableV2SClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -181,7 +205,69 @@ func ExampleVirtualHubRouteTableV2SClient_NewListPager() { _ = 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.ListVirtualHubRouteTableV2SResult = armnetwork.ListVirtualHubRouteTableV2SResult{ + // page = armnetwork.VirtualHubRouteTableV2SClientListResponse{ + // ListVirtualHubRouteTableV2SResult: armnetwork.ListVirtualHubRouteTableV2SResult{ + // Value: []*armnetwork.VirtualHubRouteTableV2{ + // { + // Name: to.Ptr("virtualHubRouteTable1a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // { + // Name: to.Ptr("virtualHubRouteTable1b"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1b"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Branches"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.30.0.0/16"), + // to.Ptr("20.40.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go index 212413d1b114..e01a30c27af7 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualHubsClient contains the methods for the VirtualHubs group. // Don't use this type directly, use NewVirtualHubsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualHubsClient struct { internal *arm.Client subscriptionID string } // NewVirtualHubsClient creates a new instance of VirtualHubsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualHubsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubsClient, error) { @@ -43,9 +43,7 @@ func NewVirtualHubsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to create or update VirtualHub. // - options - VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *VirtualHubsClient) BeginCreateOrUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VirtualHubsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*runtime.Poller[VirtualHubsClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginDelete" @@ -192,17 +183,14 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. func (client *VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (VirtualHubsClientGetResponse, error) { @@ -247,8 +235,8 @@ func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,9 +253,7 @@ func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (Virtual // BeginGetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified // resource . // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes // method. @@ -278,8 +264,7 @@ func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -292,8 +277,6 @@ func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.C // GetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified resource // . // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes" @@ -335,10 +318,11 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.EffectiveRoutesParameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.EffectiveRoutesParameters); err != nil { return nil, err } @@ -349,9 +333,7 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c // BeginGetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - getInboundRoutesParameters - Parameters supplied to get the inbound routes for a connection resource. // - options - VirtualHubsClientBeginGetInboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetInboundRoutes @@ -363,8 +345,7 @@ func (client *VirtualHubsClient) BeginGetInboundRoutes(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetInboundRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -376,8 +357,6 @@ func (client *VirtualHubsClient) BeginGetInboundRoutes(ctx context.Context, reso // GetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubsClient) getInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetInboundRoutes" @@ -419,9 +398,10 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getInboundRoutesParameters); err != nil { return nil, err } @@ -430,9 +410,7 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte // BeginGetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - getOutboundRoutesParameters - Parameters supplied to get the outbound routes for a connection resource. // - options - VirtualHubsClientBeginGetOutboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetOutboundRoutes @@ -444,8 +422,7 @@ func (client *VirtualHubsClient) BeginGetOutboundRoutes(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetOutboundRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -457,8 +434,6 @@ func (client *VirtualHubsClient) BeginGetOutboundRoutes(ctx context.Context, res // GetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualHubsClient) getOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetOutboundRoutes" @@ -500,9 +475,10 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getOutboundRoutesParameters); err != nil { return nil, err } @@ -510,8 +486,6 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont } // NewListPager - Lists all the VirtualHubs in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.NewListPager method. func (client *VirtualHubsClient) NewListPager(options *VirtualHubsClientListOptions) *runtime.Pager[VirtualHubsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListResponse]{ @@ -548,8 +522,8 @@ func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, _ *Virtu return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -564,9 +538,7 @@ func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (Virtua } // NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager // method. func (client *VirtualHubsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) *runtime.Pager[VirtualHubsClientListByResourceGroupResponse] { @@ -608,8 +580,8 @@ func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -625,9 +597,7 @@ func (client *VirtualHubsClient) listByResourceGroupHandleResponse(resp *http.Re // UpdateTags - Updates VirtualHub tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualHub. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to update VirtualHub tags. // - options - VirtualHubsClientUpdateTagsOptions contains the optional parameters for the VirtualHubsClient.UpdateTags method. @@ -673,9 +643,10 @@ func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go index f6e3b551a79c..b932ae5ad683 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go @@ -1,195 +1,92 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubGet.json -func ExampleVirtualHubsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubsClient().Get(ctx, "rg1", "virtualHub1", 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.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubPut.json +// Generated from example definition: 2025-07-01/VirtualHubPut.json func ExampleVirtualHubsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualHubsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub2", armnetwork.VirtualHub{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.VirtualHubProperties{ AddressPrefix: to.Ptr("10.168.0.0/24"), SKU: to.Ptr("Basic"), VirtualWan: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), }, }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.168.0.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // res = armnetwork.VirtualHubsClientCreateOrUpdateResponse{ + // VirtualHub: armnetwork.VirtualHub{ + // Name: to.Ptr("virtualHub2"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("10.168.0.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubUpdateTags.json -func ExampleVirtualHubsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubsClient().UpdateTags(ctx, "rg1", "virtualHub2", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.168.0.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubDelete.json +// Generated from example definition: 2025-07-01/VirtualHubDelete.json func ExampleVirtualHubsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -197,507 +94,686 @@ func ExampleVirtualHubsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualHubsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubListByResourceGroup.json -func ExampleVirtualHubsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VirtualHubGet.json +func ExampleVirtualHubsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualHubsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubsResult = armnetwork.ListVirtualHubsResult{ - // Value: []*armnetwork.VirtualHub{ - // { - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("210.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualHubList.json -func ExampleVirtualHubsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := clientFactory.NewVirtualHubsClient().Get(ctx, "rg1", "virtualHub1", nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubsClient().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.ListVirtualHubsResult = armnetwork.ListVirtualHubsResult{ - // Value: []*armnetwork.VirtualHub{ - // { - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("210.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }}, - // } + 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 = armnetwork.VirtualHubsClientGetResponse{ + // VirtualHub: armnetwork.VirtualHub{ + // Name: to.Ptr("virtualHub1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("10.10.1.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/EffectiveRoutesListForConnection.json +// Generated from example definition: 2025-07-01/EffectiveRoutesListForConnection.json func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForAConnectionResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - VirtualWanResourceType: to.Ptr("ExpressRouteConnection"), - }, - }) + poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{ + EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), + VirtualWanResourceType: to.Ptr("ExpressRouteConnection"), + }}) 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) + log.Fatalf("failed to poll 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.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, + // res = armnetwork.VirtualHubsClientGetEffectiveVirtualHubRoutesResponse{ + // VirtualHubEffectiveRouteList: armnetwork.VirtualHubEffectiveRouteList{ + // Value: []*armnetwork.VirtualHubEffectiveRoute{ + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.147.128.0/17"), + // }, // AsPath: to.Ptr("65520-65520"), // NextHopType: to.Ptr("Remote Hub"), // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // }, + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // AsPath: to.Ptr("12076-12076"), + // NextHopType: to.Ptr("ExpressRouteGateway"), + // NextHops: []*string{ + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), + // }, + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/EffectiveRoutesListForRouteTable.json +// Generated from example definition: 2025-07-01/EffectiveRoutesListForRouteTable.json func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForARouteTableResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - VirtualWanResourceType: to.Ptr("RouteTable"), - }, - }) + poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{ + EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + VirtualWanResourceType: to.Ptr("RouteTable"), + }}) 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) + log.Fatalf("failed to poll 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.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, + // res = armnetwork.VirtualHubsClientGetEffectiveVirtualHubRoutesResponse{ + // VirtualHubEffectiveRouteList: armnetwork.VirtualHubEffectiveRouteList{ + // Value: []*armnetwork.VirtualHubEffectiveRoute{ + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.147.128.0/17"), + // }, // AsPath: to.Ptr("65520-65520"), // NextHopType: to.Ptr("Remote Hub"), // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // }, + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // }, + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // AsPath: to.Ptr("12076-12076"), + // NextHopType: to.Ptr("ExpressRouteGateway"), + // NextHops: []*string{ + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/EffectiveRoutesListForVirtualHub.json +// Generated from example definition: 2025-07-01/EffectiveRoutesListForVirtualHub.json func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForTheVirtualHub() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: nil}) + poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", 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) + log.Fatalf("failed to poll 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.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, + // res = armnetwork.VirtualHubsClientGetEffectiveVirtualHubRoutesResponse{ + // VirtualHubEffectiveRouteList: armnetwork.VirtualHubEffectiveRouteList{ + // Value: []*armnetwork.VirtualHubEffectiveRoute{ + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.147.128.0/17"), + // }, // AsPath: to.Ptr("65520-65520"), // NextHopType: to.Ptr("Remote Hub"), // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // }, + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), + // }, + // { + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // AsPath: to.Ptr("12076-12076"), + // NextHopType: to.Ptr("ExpressRouteGateway"), + // NextHops: []*string{ + // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } + // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GetInboundRoutes.json +// Generated from example definition: 2025-07-01/GetInboundRoutes.json func ExampleVirtualHubsClient_BeginGetInboundRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualHubsClient().BeginGetInboundRoutes(ctx, "rg1", "virtualHub1", armnetwork.GetInboundRoutesParameters{ ConnectionType: to.Ptr("ExpressRouteConnection"), - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), + ResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), }, 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) + log.Fatalf("failed to poll 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.EffectiveRouteMapRouteList = armnetwork.EffectiveRouteMapRouteList{ - // Value: []*armnetwork.EffectiveRouteMapRoute{ - // { - // AsPath: to.Ptr("65520-65520"), - // BgpCommunities: to.Ptr("4293853166,12076,51004"), - // Prefix: to.Ptr("192.168.50.0/24"), + // res = armnetwork.VirtualHubsClientGetInboundRoutesResponse{ + // EffectiveRouteMapRouteList: armnetwork.EffectiveRouteMapRouteList{ + // Value: []*armnetwork.EffectiveRouteMapRoute{ + // { + // AsPath: to.Ptr("65520-65520"), + // BgpCommunities: to.Ptr("4293853166,12076,51004"), + // Prefix: to.Ptr("192.168.50.0/24"), + // }, + // { + // AsPath: to.Ptr("65520-65520-12076-12076"), + // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), + // Prefix: to.Ptr("10.200.0.0/16"), + // }, // }, - // { - // AsPath: to.Ptr("65520-65520-12076-12076"), - // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), - // Prefix: to.Ptr("10.200.0.0/16"), - // }}, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GetOutboundRoutes.json +// Generated from example definition: 2025-07-01/GetOutboundRoutes.json func ExampleVirtualHubsClient_BeginGetOutboundRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualHubsClient().BeginGetOutboundRoutes(ctx, "rg1", "virtualHub1", armnetwork.GetOutboundRoutesParameters{ ConnectionType: to.Ptr("ExpressRouteConnection"), - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), + ResourceURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), }, 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) + log.Fatalf("failed to poll 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 = armnetwork.VirtualHubsClientGetOutboundRoutesResponse{ + // EffectiveRouteMapRouteList: armnetwork.EffectiveRouteMapRouteList{ + // Value: []*armnetwork.EffectiveRouteMapRoute{ + // { + // AsPath: to.Ptr("65520-65520"), + // BgpCommunities: to.Ptr("4293853166,12076,51004"), + // Prefix: to.Ptr("192.168.50.0/24"), + // }, + // { + // AsPath: to.Ptr("65520-65520-12076-12076"), + // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), + // Prefix: to.Ptr("10.200.0.0/16"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/VirtualHubList.json +func ExampleVirtualHubsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVirtualHubsClient().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 = armnetwork.VirtualHubsClientListResponse{ + // ListVirtualHubsResult: armnetwork.ListVirtualHubsResult{ + // Value: []*armnetwork.VirtualHub{ + // { + // Name: to.Ptr("virtualHub1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("10.10.1.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // { + // Name: to.Ptr("rt2a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("virtualHub2"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // Location: to.Ptr("East US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("210.10.1.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // { + // Name: to.Ptr("rt2a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VirtualHubListByResourceGroup.json +func ExampleVirtualHubsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVirtualHubsClient().NewListByResourceGroupPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.VirtualHubsClientListByResourceGroupResponse{ + // ListVirtualHubsResult: armnetwork.ListVirtualHubsResult{ + // Value: []*armnetwork.VirtualHub{ + // { + // Name: to.Ptr("virtualHub1"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("10.10.1.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // { + // Name: to.Ptr("rt2a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("virtualHub2"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // Location: to.Ptr("East US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("210.10.1.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // { + // Name: to.Ptr("rt2a"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), + // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ + // AttachedConnections: []*string{ + // to.Ptr("All_Vnets"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Routes: []*armnetwork.VirtualHubRouteV2{ + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("20.10.0.0/16"), + // to.Ptr("20.20.0.0/16"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // { + // DestinationType: to.Ptr("CIDR"), + // Destinations: []*string{ + // to.Ptr("0.0.0.0/0"), + // }, + // NextHopType: to.Ptr("IPAddress"), + // NextHops: []*string{ + // to.Ptr("10.0.0.68"), + // }, + // }, + // }, + // }, + // }, + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VirtualHubUpdateTags.json +func ExampleVirtualHubsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualHubsClient().UpdateTags(ctx, "rg1", "virtualHub2", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EffectiveRouteMapRouteList = armnetwork.EffectiveRouteMapRouteList{ - // Value: []*armnetwork.EffectiveRouteMapRoute{ - // { - // AsPath: to.Ptr("65520-65520"), - // BgpCommunities: to.Ptr("4293853166,12076,51004"), - // Prefix: to.Ptr("192.168.50.0/24"), + // res = armnetwork.VirtualHubsClientUpdateTagsResponse{ + // VirtualHub: armnetwork.VirtualHub{ + // Name: to.Ptr("virtualHub2"), + // Type: to.Ptr("Microsoft.Network/virtualHubs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualHubProperties{ + // AddressPrefix: to.Ptr("10.168.0.0/24"), + // AllowBranchToBranchTraffic: to.Ptr(false), + // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SKU: to.Ptr("Basic"), + // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ + // }, + // VirtualRouterAsn: to.Ptr[int64](65515), + // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ + // MinCapacity: to.Ptr[int32](2), + // }, + // VirtualRouterIPs: []*string{ + // to.Ptr("10.10.1.12"), + // to.Ptr("10.10.1.13"), + // }, + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), + // }, // }, - // { - // AsPath: to.Ptr("65520-65520-12076-12076"), - // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), - // Prefix: to.Ptr("10.200.0.0/16"), - // }}, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go index 4b742e812ee8..cbb9455fc4ba 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client.go index eae617e4938b..9820dc5c8999 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualNetworkAppliancesClient contains the methods for the VirtualNetworkAppliances group. // Don't use this type directly, use NewVirtualNetworkAppliancesClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkAppliancesClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkAppliancesClient creates a new instance of VirtualNetworkAppliancesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkAppliancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkAppliancesClient, error) { @@ -43,9 +43,7 @@ func NewVirtualNetworkAppliancesClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Creates or updates a virtual network appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkApplianceName - The name of the virtual network appliance. // - parameters - Parameters supplied to the create or update virtual network appliance operation. // - options - VirtualNetworkAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkAppliancesClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *VirtualNetworkAppliancesClient) BeginCreateOrUpdate(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkAppliancesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VirtualNetworkAppliancesClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Creates or updates a virtual network appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, parameters VirtualNetworkAppliance, options *VirtualNetworkAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAppliancesClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *VirtualNetworkAppliancesClient) createOrUpdate(ctx context.Context // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworkAppliancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, parameters VirtualNetworkAppliance, _ *VirtualNetworkAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkAppliances/{virtualNetworkApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *VirtualNetworkAppliancesClient) createOrUpdateCreateRequest(ctx co return nil, errors.New("parameter virtualNetworkApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkApplianceName}", url.PathEscape(virtualNetworkApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *VirtualNetworkAppliancesClient) createOrUpdateCreateRequest(ctx co // BeginDelete - Deletes the specified virtual network appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkApplianceName - The name of the virtual network appliance. // - options - VirtualNetworkAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkAppliancesClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *VirtualNetworkAppliancesClient) BeginDelete(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkAppliancesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *VirtualNetworkAppliancesClient) BeginDelete(ctx context.Context, r // Delete - Deletes the specified virtual network appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, options *VirtualNetworkAppliancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAppliancesClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *VirtualNetworkAppliancesClient) deleteOperation(ctx context.Contex // deleteCreateRequest creates the Delete request. func (client *VirtualNetworkAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, _ *VirtualNetworkAppliancesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkAppliances/{virtualNetworkApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *VirtualNetworkAppliancesClient) deleteCreateRequest(ctx context.Co return nil, errors.New("parameter virtualNetworkApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkApplianceName}", url.PathEscape(virtualNetworkApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified virtual network appliance. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkApplianceName - The name of the virtual network appliance. // - options - VirtualNetworkAppliancesClientGetOptions contains the optional parameters for the VirtualNetworkAppliancesClient.Get // method. @@ -232,6 +220,10 @@ func (client *VirtualNetworkAppliancesClient) Get(ctx context.Context, resourceG // getCreateRequest creates the Get request. func (client *VirtualNetworkAppliancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, _ *VirtualNetworkAppliancesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkAppliances/{virtualNetworkApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +232,13 @@ func (client *VirtualNetworkAppliancesClient) getCreateRequest(ctx context.Conte return nil, errors.New("parameter virtualNetworkApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkApplianceName}", url.PathEscape(virtualNetworkApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,9 +253,7 @@ func (client *VirtualNetworkAppliancesClient) getHandleResponse(resp *http.Respo } // NewListPager - Gets all virtual network appliances in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworkAppliancesClientListOptions contains the optional parameters for the VirtualNetworkAppliancesClient.NewListPager // method. func (client *VirtualNetworkAppliancesClient) NewListPager(resourceGroupName string, options *VirtualNetworkAppliancesClientListOptions) *runtime.Pager[VirtualNetworkAppliancesClientListResponse] { @@ -296,21 +282,21 @@ func (client *VirtualNetworkAppliancesClient) NewListPager(resourceGroupName str // listCreateRequest creates the List request. func (client *VirtualNetworkAppliancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworkAppliancesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkAppliances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -325,8 +311,6 @@ func (client *VirtualNetworkAppliancesClient) listHandleResponse(resp *http.Resp } // NewListAllPager - Gets all virtual network appliances in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualNetworkAppliancesClientListAllOptions contains the optional parameters for the VirtualNetworkAppliancesClient.NewListAllPager // method. func (client *VirtualNetworkAppliancesClient) NewListAllPager(options *VirtualNetworkAppliancesClientListAllOptions) *runtime.Pager[VirtualNetworkAppliancesClientListAllResponse] { @@ -364,8 +348,8 @@ func (client *VirtualNetworkAppliancesClient) listAllCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,9 +365,7 @@ func (client *VirtualNetworkAppliancesClient) listAllHandleResponse(resp *http.R // UpdateTags - Updates a virtual network appliance tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkApplianceName - The name of the virtual network appliance. // - parameters - Parameters supplied to update virtual network appliance tags. // - options - VirtualNetworkAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkAppliancesClient.UpdateTags @@ -413,6 +395,10 @@ func (client *VirtualNetworkAppliancesClient) UpdateTags(ctx context.Context, re // updateTagsCreateRequest creates the UpdateTags request. func (client *VirtualNetworkAppliancesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkApplianceName string, parameters TagsObject, _ *VirtualNetworkAppliancesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkAppliances/{virtualNetworkApplianceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -421,18 +407,15 @@ func (client *VirtualNetworkAppliancesClient) updateTagsCreateRequest(ctx contex return nil, errors.New("parameter virtualNetworkApplianceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkApplianceName}", url.PathEscape(virtualNetworkApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client_example_test.go index e6befa03b40e..90082adc0714 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkappliances_client_example_test.go @@ -1,209 +1,158 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_Delete.json -func ExampleVirtualNetworkAppliancesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_CreateOrUpdate.json +func ExampleVirtualNetworkAppliancesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkAppliancesClient().BeginDelete(ctx, "rg1", "test-vna", nil) + poller, err := clientFactory.NewVirtualNetworkAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "test-vna", armnetwork.VirtualNetworkAppliance{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + BandwidthInGbps: to.Ptr[float64](100), + Subnet: &armnetwork.Subnet{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_Get.json -func ExampleVirtualNetworkAppliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkAppliancesClient().Get(ctx, "rg1", "test-vna", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkAppliance = armnetwork.VirtualNetworkAppliance{ - // Name: to.Ptr("test-vna"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VirtualNetworkAppliancesClientCreateOrUpdateResponse{ + // VirtualNetworkAppliance: armnetwork.VirtualNetworkAppliance{ + // Name: to.Ptr("test-vna"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_CreateOrUpdate.json -func ExampleVirtualNetworkAppliancesClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_Delete.json +func ExampleVirtualNetworkAppliancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "test-vna", armnetwork.VirtualNetworkAppliance{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - BandwidthInGbps: to.Ptr("100"), - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - }, - }, - }, nil) + poller, err := clientFactory.NewVirtualNetworkAppliancesClient().BeginDelete(ctx, "rg1", "test-vna", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkAppliance = armnetwork.VirtualNetworkAppliance{ - // Name: to.Ptr("test-vna"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_UpdateTags.json -func ExampleVirtualNetworkAppliancesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_Get.json +func ExampleVirtualNetworkAppliancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkAppliancesClient().UpdateTags(ctx, "rg1", "test-vna", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewVirtualNetworkAppliancesClient().Get(ctx, "rg1", "test-vna", 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.VirtualNetworkAppliance = armnetwork.VirtualNetworkAppliance{ - // Name: to.Ptr("test-vna"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VirtualNetworkAppliancesClientGetResponse{ + // VirtualNetworkAppliance: armnetwork.VirtualNetworkAppliance{ + // Name: to.Ptr("test-vna"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_ListBySubscription.json -func ExampleVirtualNetworkAppliancesClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_List.json +func ExampleVirtualNetworkAppliancesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualNetworkAppliancesClient().NewListAllPager(nil) + pager := clientFactory.NewVirtualNetworkAppliancesClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -214,74 +163,79 @@ func ExampleVirtualNetworkAppliancesClient_NewListAllPager() { _ = 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.VirtualNetworkApplianceListResult = armnetwork.VirtualNetworkApplianceListResult{ - // Value: []*armnetwork.VirtualNetworkAppliance{ - // { - // Name: to.Ptr("test-vna"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.VirtualNetworkAppliancesClientListResponse{ + // VirtualNetworkApplianceListResult: armnetwork.VirtualNetworkApplianceListResult{ + // Value: []*armnetwork.VirtualNetworkAppliance{ + // { + // Name: to.Ptr("test-vna"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }, - // { - // Name: to.Ptr("test-vna2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("test-vna2"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3d"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3d"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkAppliances_List.json -func ExampleVirtualNetworkAppliancesClient_NewListPager() { +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_ListBySubscription.json +func ExampleVirtualNetworkAppliancesClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualNetworkAppliancesClient().NewListPager("rg1", nil) + pager := clientFactory.NewVirtualNetworkAppliancesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -292,58 +246,120 @@ func ExampleVirtualNetworkAppliancesClient_NewListPager() { _ = 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.VirtualNetworkApplianceListResult = armnetwork.VirtualNetworkApplianceListResult{ - // Value: []*armnetwork.VirtualNetworkAppliance{ - // { - // Name: to.Ptr("test-vna"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.VirtualNetworkAppliancesClientListAllResponse{ + // VirtualNetworkApplianceListResult: armnetwork.VirtualNetworkApplianceListResult{ + // Value: []*armnetwork.VirtualNetworkAppliance{ + // { + // Name: to.Ptr("test-vna"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }, - // { - // Name: to.Ptr("test-vna2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ - // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // { + // Name: to.Ptr("test-vna2"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3d"), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3d"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/VirtualNetworkAppliances_UpdateTags.json +func ExampleVirtualNetworkAppliancesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkAppliancesClient().UpdateTags(ctx, "rg1", "test-vna", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VirtualNetworkAppliancesClientUpdateTagsResponse{ + // VirtualNetworkAppliance: armnetwork.VirtualNetworkAppliance{ + // Name: to.Ptr("test-vna"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkAppliances"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkAppliancePropertiesFormat{ + // IPConfigurations: []*armnetwork.VirtualNetworkApplianceIPConfiguration{ + // { + // Name: to.Ptr("ipconfig1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkAppliances/test-vna/ipConfigurations/ipconfig1"), + // Properties: &armnetwork.VirtualNetworkApplianceIPConfigurationProperties{ + // Primary: to.Ptr(true), + // PrivateIPAddress: to.Ptr("10.0.1.4"), + // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("c9b1f5f4-5d6e-4f0a-89c1-6b3d3e3c3e3c"), + // Subnet: &armnetwork.Subnet{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go index 88bb303c8ce5..9da1542e4cd4 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go index ef3b00ab5974..ced413c70176 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualNetworkGatewayConnectionsClient contains the methods for the VirtualNetworkGatewayConnections group. // Don't use this type directly, use NewVirtualNetworkGatewayConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkGatewayConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkGatewayConnectionsClient creates a new instance of VirtualNetworkGatewayConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayConnectionsClient, error) { @@ -43,9 +43,7 @@ func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the create or update virtual network gateway connection operation. // - options - VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginCreateOrUpdate(ctx co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, _ *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques // BeginDelete - Deletes the specified virtual network Gateway connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginDelete(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginDelete(ctx context.Co // Delete - Deletes the specified virtual network Gateway connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx contex // deleteCreateRequest creates the Delete request. func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, _ *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified virtual network gateway connection by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get // method. @@ -232,6 +220,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, r // getCreateRequest creates the Get request. func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, _ *VirtualNetworkGatewayConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,17 +232,13 @@ func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx conte return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -266,10 +254,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) getHandleResponse(resp *ht // BeginGetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas // method. func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse], error) { @@ -279,8 +265,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -292,8 +277,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context // GetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas" @@ -318,6 +301,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Cont // getIkeSasCreateRequest creates the GetIkeSas request. func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, _ *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -326,17 +313,13 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -344,10 +327,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx // GetSharedKey - The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual // network gateway connection shared key through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The virtual network gateway connection shared key name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey // method. func (client *VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse, error) { @@ -375,6 +356,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.C // getSharedKeyCreateRequest creates the GetSharedKey request. func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, _ *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -383,17 +368,13 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest( return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -409,9 +390,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse // NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections // created. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager // method. func (client *VirtualNetworkGatewayConnectionsClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) *runtime.Pager[VirtualNetworkGatewayConnectionsClientListResponse] { @@ -440,21 +419,21 @@ func (client *VirtualNetworkGatewayConnectionsClient) NewListPager(resourceGroup // listCreateRequest creates the List request. func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworkGatewayConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -470,10 +449,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) listHandleResponse(resp *h // BeginResetConnection - Resets the virtual network gateway connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection // method. func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientResetConnectionResponse], error) { @@ -483,8 +460,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -496,8 +472,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx c // ResetConnection - Resets the virtual network gateway connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetConnection" @@ -522,6 +496,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx contex // resetConnectionCreateRequest creates the ResetConnection request. func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, _ *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -530,29 +508,21 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group -// through Network resource provider. +// shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The virtual network gateway connection reset shared key Name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the begin reset virtual network gateway connection shared key operation through network // resource provider. // - options - VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey @@ -564,8 +534,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -576,11 +545,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx co } // ResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group -// through Network resource provider. +// shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey" @@ -605,6 +571,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context // resetSharedKeyCreateRequest creates the ResetSharedKey request. func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, _ *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -613,18 +583,15 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -632,13 +599,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques } // BeginSetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group through -// Network resource provider. +// shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The virtual network gateway connection name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork // resource provider. // - options - VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey @@ -650,8 +614,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -662,11 +625,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx cont } // SetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared -// key for passed virtual network gateway connection in the specified resource group through -// Network resource provider. +// key for passed virtual network gateway connection in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) setSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey" @@ -691,6 +651,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKey(ctx context.C // setSharedKeyCreateRequest creates the SetSharedKey request. func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, _ *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -699,18 +663,15 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -719,9 +680,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( // BeginStartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the // VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture method. @@ -732,8 +691,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStartPacketCapture(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -745,8 +703,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStartPacketCapture(ct // StartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture" @@ -771,6 +727,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx con // startPacketCaptureCreateRequest creates the StartPacketCapture request. func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -779,19 +739,16 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -802,10 +759,8 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe // BeginStopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the // VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture method. @@ -816,8 +771,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStopPacketCapture(ctx return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -829,8 +783,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStopPacketCapture(ctx // StopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture" @@ -855,6 +807,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx cont // stopPacketCaptureCreateRequest creates the StopPacketCapture request. func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, _ *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -863,18 +819,15 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -883,9 +836,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq // BeginUpdateTags - Updates a virtual network gateway connection tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to update virtual network gateway connection tags. // - options - VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags @@ -897,8 +848,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginUpdateTags(ctx contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -910,8 +860,6 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginUpdateTags(ctx contex // UpdateTags - Updates a virtual network gateway connection tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayConnectionsClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginUpdateTags" @@ -936,6 +884,10 @@ func (client *VirtualNetworkGatewayConnectionsClient) updateTags(ctx context.Con // updateTagsCreateRequest creates the UpdateTags request. func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, _ *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -944,18 +896,15 @@ func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ct return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go index 6fd1eb0ed669..c48c18cc951b 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go @@ -1,28 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionCreate.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionCreate.json func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -33,7 +30,8 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { CertificateAuthentication: &armnetwork.CertificateAuthentication{ InboundAuthCertificateChain: []*string{ to.Ptr("MIIC+TCCAeGgAwIBAgIQFOJUqDaxV5xJcKpTKO..."), - to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh...")}, + to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh..."), + }, InboundAuthCertificateSubjectName: to.Ptr("CN=rootCert.com"), OutboundAuthCertificate: to.Ptr("https://customerKv.vault.azure.net/Certificates/outBoundcert/Version"), }, @@ -43,37 +41,49 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { DpdTimeoutSeconds: to.Ptr[int32](30), EgressNatRules: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + }, + }, EnableBgp: to.Ptr(false), GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ { CustomBgpIPAddress: to.Ptr("169.254.21.1"), - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), }, { CustomBgpIPAddress: to.Ptr("169.254.21.3"), - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - }}, + IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), + }, + }, IngressNatRules: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + }, + }, IPSecPolicies: []*armnetwork.IPSecPolicy{}, LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), Location: to.Ptr("centralus"), - Tags: map[string]*string{}, Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ GatewayIPAddress: to.Ptr("x.x.x.x"), LocalNetworkAddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.1.0.0/16")}, + to.Ptr("10.1.0.0/16"), + }, }, }, + Tags: map[string]*string{}, + }, + RoutingWeight: to.Ptr[int32](0), + SharedKey: to.Ptr("Abc123"), + RoutingConfiguration: &armnetwork.RoutingConfiguration{ + InboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + }, + OutboundRouteMap: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + }, }, - RoutingWeight: to.Ptr[int32](0), - SharedKey: to.Ptr("Abc123"), TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{}, TunnelProperties: []*armnetwork.VirtualNetworkGatewayConnectionTunnelProperties{ { @@ -83,12 +93,12 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { { BgpPeeringAddress: to.Ptr("10.78.1.20"), TunnelIPAddress: to.Ptr("10.78.1.7"), - }}, + }, + }, UsePolicyBasedTrafficSelectors: to.Ptr(false), VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), Location: to.Ptr("centralus"), - Tags: map[string]*string{}, Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ Active: to.Ptr(false), BgpSettings: &armnetwork.BgpSettings{ @@ -100,24 +110,26 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), Name: to.Ptr("gwipconfig1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), }, }, - }}, + }, + }, SKU: &armnetwork.VirtualNetworkGatewaySKU{ Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), }, VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), }, + Tags: map[string]*string{}, }, }, }, nil) @@ -126,23 +138,25 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("connS2S"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // AuthenticationType: to.Ptr(armnetwork.ConnectionAuthenticationTypeCertificate), - // CertificateAuthentication: &armnetwork.CertificateAuthentication{ - // InboundAuthCertificateChain: []*string{ - // to.Ptr("MIIC+TCCAeGgAwIBAgIQFOJUqDaxV5xJcKpTKO..."), - // to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh...")}, + // res = armnetwork.VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse{ + // VirtualNetworkGatewayConnection: armnetwork.VirtualNetworkGatewayConnection{ + // Name: to.Ptr("connS2S"), + // Type: to.Ptr("Microsoft.Network/connections"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ + // AuthenticationType: to.Ptr(armnetwork.ConnectionAuthenticationTypeCertificate), + // CertificateAuthentication: &armnetwork.CertificateAuthentication{ + // InboundAuthCertificateChain: []*string{ + // to.Ptr("MIIC+TCCAeGgAwIBAgIQFOJUqDaxV5xJcKpTKO..."), + // to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh..."), + // }, // InboundAuthCertificateSubjectName: to.Ptr("CN=rootCert.com"), // OutboundAuthCertificate: to.Ptr("https://customerKv.vault.azure.net/Certificates/outBoundcert/Version"), // }, @@ -153,32 +167,43 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { // EgressBytesTransferred: to.Ptr[int64](0), // EgressNatRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + // }, + // }, // EnableBgp: to.Ptr(false), // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ // { // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), // }, // { // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), + // }, + // }, // IngressBytesTransferred: to.Ptr[int64](0), // IngressNatRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + // }, + // }, // IPSecPolicies: []*armnetwork.IPSecPolicy{ // }, // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ // }, // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // }, // RoutingWeight: to.Ptr[int32](0), // TunnelProperties: []*armnetwork.VirtualNetworkGatewayConnectionTunnelProperties{ // { @@ -188,26 +213,54 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { // { // BgpPeeringAddress: to.Ptr("10.78.1.20"), // TunnelIPAddress: to.Ptr("10.78.1.7"), - // }}, + // }, + // }, // UseLocalAzureIPAddress: to.Ptr(false), // UsePolicyBasedTrafficSelectors: to.Ptr(false), // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ // }, // }, // }, - // } + // }, + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionDelete.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginDelete(ctx, "rg1", "conn1", 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 poll 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 = armnetwork.VirtualNetworkGatewayConnectionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionGet.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionGet.json func ExampleVirtualNetworkGatewayConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -218,18 +271,20 @@ func ExampleVirtualNetworkGatewayConnectionsClient_Get() { // 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.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("connS2S"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // AuthenticationType: to.Ptr(armnetwork.ConnectionAuthenticationTypeCertificate), - // CertificateAuthentication: &armnetwork.CertificateAuthentication{ - // InboundAuthCertificateChain: []*string{ - // to.Ptr("MIIC+TCCAeGgAwIBAgIQFOJUqDaxV5xJcKpTKO..."), - // to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh...")}, + // res = armnetwork.VirtualNetworkGatewayConnectionsClientGetResponse{ + // VirtualNetworkGatewayConnection: armnetwork.VirtualNetworkGatewayConnection{ + // Name: to.Ptr("connS2S"), + // Type: to.Ptr("Microsoft.Network/connections"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ + // AuthenticationType: to.Ptr(armnetwork.ConnectionAuthenticationTypeCertificate), + // CertificateAuthentication: &armnetwork.CertificateAuthentication{ + // InboundAuthCertificateChain: []*string{ + // to.Ptr("MIIC+TCCAeGgAwIBAgIQFOJUqDaxV5xJcKpTKO..."), + // to.Ptr("MIIC+TCCAeGgAwIBAgIQPJerInitNblK7yBgkqh..."), + // }, // InboundAuthCertificateSubjectName: to.Ptr("CN=rootCert.com"), // OutboundAuthCertificate: to.Ptr("https://customerKv.vault.azure.net/Certificates/outBoundcert/Version"), // }, @@ -241,32 +296,43 @@ func ExampleVirtualNetworkGatewayConnectionsClient_Get() { // EgressBytesTransferred: to.Ptr[int64](0), // EgressNatRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + // }, + // }, // EnableBgp: to.Ptr(false), // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ // { // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), // }, // { // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), + // }, + // }, // IngressBytesTransferred: to.Ptr[int64](0), // IngressNatRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + // }, + // }, // IPSecPolicies: []*armnetwork.IPSecPolicy{ // }, // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // }, // RoutingWeight: to.Ptr[int32](0), // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ // }, @@ -278,158 +344,55 @@ func ExampleVirtualNetworkGatewayConnectionsClient_Get() { // { // BgpPeeringAddress: to.Ptr("10.78.1.20"), // TunnelIPAddress: to.Ptr("10.78.1.7"), - // }}, + // }, + // }, // UseLocalAzureIPAddress: to.Ptr(false), // UsePolicyBasedTrafficSelectors: to.Ptr(false), // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ // }, // }, // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionDelete.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginDelete(ctx, "rg1", "conn1", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionUpdateTags.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginUpdateTags(ctx, "rg1", "test", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/test"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionStatusUnknown), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionSetSharedKey.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginSetSharedKey() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionGetIkeSas.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginGetIkeSas() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginSetSharedKey(ctx, "rg1", "connS2S", armnetwork.ConnectionSharedKey{ - Value: to.Ptr("AzureAbc123"), - }, nil) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginGetIkeSas(ctx, "rg1", "vpngwcn1", 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) + log.Fatalf("failed to poll 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.ConnectionSharedKey = armnetwork.ConnectionSharedKey{ - // ID: to.Ptr(""), - // Value: to.Ptr("AzureAbc123"), + // res = armnetwork.VirtualNetworkGatewayConnectionsClientGetIkeSasResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionGetSharedKey.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionGetSharedKey.json func ExampleVirtualNetworkGatewayConnectionsClient_GetSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -440,20 +403,22 @@ func ExampleVirtualNetworkGatewayConnectionsClient_GetSharedKey() { // 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.ConnectionSharedKey = armnetwork.ConnectionSharedKey{ - // ID: to.Ptr(""), - // Value: to.Ptr("AzureAbc123"), + // res = armnetwork.VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{ + // ConnectionSharedKey: armnetwork.ConnectionSharedKey{ + // ID: to.Ptr(""), + // Value: to.Ptr("AzureAbc123"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionsList.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionsList.json func ExampleVirtualNetworkGatewayConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -468,124 +433,170 @@ func ExampleVirtualNetworkGatewayConnectionsClient_NewListPager() { _ = 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.VirtualNetworkGatewayConnectionListResult = armnetwork.VirtualNetworkGatewayConnectionListResult{ - // Value: []*armnetwork.VirtualNetworkGatewayConnection{ - // { - // Name: to.Ptr("conn1"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/conn1"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv1), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](30), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // page = armnetwork.VirtualNetworkGatewayConnectionsClientListResponse{ + // VirtualNetworkGatewayConnectionListResult: armnetwork.VirtualNetworkGatewayConnectionListResult{ + // Value: []*armnetwork.VirtualNetworkGatewayConnection{ + // { + // Name: to.Ptr("conn1"), + // Type: to.Ptr("Microsoft.Network/connections"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/connections/conn1"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ + // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), + // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv1), + // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), + // DpdTimeoutSeconds: to.Ptr[int32](30), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), + // }, // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // EnableBgp: to.Ptr(false), + // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.1"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // }, + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.3"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), + // }, // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // IngressBytesTransferred: to.Ptr[int64](0), + // IngressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), + // }, + // }, + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // }, // }, // }, // }, - // }, - // { - // Name: to.Ptr("conn2"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/conn2"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](20), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.4"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), + // { + // Name: to.Ptr("conn2"), + // Type: to.Ptr("Microsoft.Network/connections"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/connections/conn2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ + // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), + // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), + // DpdTimeoutSeconds: to.Ptr[int32](20), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), + // }, // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.6"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // EnableBgp: to.Ptr(false), + // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.4"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), + // }, + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.6"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/ActiveActive"), + // }, // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UseLocalAzureIPAddress: to.Ptr(true), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // IngressBytesTransferred: to.Ptr[int64](0), + // IngressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), + // }, + // }, + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // UseLocalAzureIPAddress: to.Ptr(true), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // }, // }, // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionResetSharedKey.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionReset.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetConnection() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginResetConnection(ctx, "rg1", "conn1", 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 poll the result: %v", err) + } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionResetSharedKey.json func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -597,138 +608,226 @@ func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetSharedKey() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.ConnectionResetSharedKey = armnetwork.ConnectionResetSharedKey{ - // KeyLength: to.Ptr[int32](128), + // res = armnetwork.VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse{ + // ConnectionResetSharedKey: armnetwork.ConnectionResetSharedKey{ + // KeyLength: to.Ptr[int32](128), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionSetSharedKey.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginSetSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNPacketCaptureStartParameters{ - FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), - }, - }) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginSetSharedKey(ctx, "rg1", "connS2S", armnetwork.ConnectionSharedKey{ + Value: to.Ptr("AzureAbc123"), + }, 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse{ + // ConnectionSharedKey: armnetwork.ConnectionSharedKey{ + // ID: to.Ptr(""), + // Value: to.Ptr("AzureAbc123"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionStartPacketCapture.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionStartPacketCapture.json func ExampleVirtualNetworkGatewayConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayConnectionWithoutFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{Parameters: nil}) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionStopPacketCapture.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginStopPacketCapture() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "vpngwcn1", armnetwork.VPNPacketCaptureStopParameters{ - SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), - }, nil) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{ + Parameters: &armnetwork.VPNPacketCaptureStartParameters{ + FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + }}) 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionGetIkeSas.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginGetIkeSas() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionStopPacketCapture.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginStopPacketCapture() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginGetIkeSas(ctx, "rg1", "vpngwcn1", nil) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "vpngwcn1", armnetwork.VPNPacketCaptureStopParameters{ + SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + }, 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayConnectionReset.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetConnection() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayConnectionUpdateTags.json +func ExampleVirtualNetworkGatewayConnectionsClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginResetConnection(ctx, "rg1", "conn1", nil) + poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginUpdateTags(ctx, "rg1", "test", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewayConnectionsClientUpdateTagsResponse{ + // VirtualNetworkGatewayConnection: armnetwork.VirtualNetworkGatewayConnection{ + // Name: to.Ptr("test"), + // Type: to.Ptr("Microsoft.Network/connections"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/connections/test"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ + // ConnectionStatus: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionStatusUnknown), + // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.1"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // }, + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.3"), + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), + // }, + // }, + // IngressBytesTransferred: to.Ptr[int64](0), + // IngressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + // }, + // }, + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), + // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // }, + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go index 8b0e8ba43e84..ac4dfa7778ba 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualNetworkGatewayNatRulesClient contains the methods for the VirtualNetworkGatewayNatRules group. // Don't use this type directly, use NewVirtualNetworkGatewayNatRulesClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkGatewayNatRulesClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkGatewayNatRulesClient creates a new instance of VirtualNetworkGatewayNatRulesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayNatRulesClient, error) { @@ -44,11 +44,9 @@ func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing // nat rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the Virtual Network Gateway. -// - virtualNetworkGatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - natRuleParameters - Parameters supplied to create or Update a Nat Rule. // - options - VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate // method. @@ -59,8 +57,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,8 +70,6 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing // nat rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate" @@ -120,9 +115,10 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { return nil, err } @@ -131,11 +127,9 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the Virtual Network Gateway. -// - virtualNetworkGatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete // method. func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewayNatRulesClientDeleteResponse], error) { @@ -145,8 +139,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -158,8 +151,6 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Conte // Delete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewayNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayNatRulesClient.BeginDelete" @@ -205,19 +196,16 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a nat rule. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the Virtual Network Gateway. -// - virtualNetworkGatewayName - The name of the gateway. -// - natRuleName - The name of the nat rule. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - natRuleName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualNetworkGatewayNatRulesClientGetOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.Get // method. func (client *VirtualNetworkGatewayNatRulesClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (VirtualNetworkGatewayNatRulesClientGetResponse, error) { @@ -266,8 +254,8 @@ func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -282,10 +270,8 @@ func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http. } // NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the virtual network gateway. -// - virtualNetworkGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the // VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager method. func (client *VirtualNetworkGatewayNatRulesClient) NewListByVirtualNetworkGatewayPager(resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) *runtime.Pager[VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse] { @@ -331,8 +317,8 @@ func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go index 92afb3060c05..30eff450efcf 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go @@ -1,69 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayNatRuleGet.json -func ExampleVirtualNetworkGatewayNatRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", 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.VirtualNetworkGatewayNatRule = armnetwork.VirtualNetworkGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.4.0.0/24"), - // PortRange: to.Ptr("200-200"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // PortRange: to.Ptr("100-100"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayNatRulePut.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayNatRulePut.json func ExampleVirtualNetworkGatewayNatRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -74,13 +30,15 @@ func ExampleVirtualNetworkGatewayNatRulesClient_BeginCreateOrUpdate() { { AddressSpace: to.Ptr("192.168.21.0/24"), PortRange: to.Ptr("300-400"), - }}, + }, + }, InternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("10.4.0.0/24"), PortRange: to.Ptr("200-300"), - }}, - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), + }, + }, + IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), }, }, nil) @@ -89,42 +47,46 @@ func ExampleVirtualNetworkGatewayNatRulesClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkGatewayNatRule = armnetwork.VirtualNetworkGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.21.0/24"), - // PortRange: to.Ptr("300-400"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // PortRange: to.Ptr("200-300"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse{ + // VirtualNetworkGatewayNatRule: armnetwork.VirtualNetworkGatewayNatRule{ + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // PortRange: to.Ptr("300-400"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // PortRange: to.Ptr("200-300"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayNatRuleDelete.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayNatRuleDelete.json func ExampleVirtualNetworkGatewayNatRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -132,20 +94,70 @@ func ExampleVirtualNetworkGatewayNatRulesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewayNatRulesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayNatRuleGet.json +func ExampleVirtualNetworkGatewayNatRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armnetwork.VirtualNetworkGatewayNatRulesClientGetResponse{ + // VirtualNetworkGatewayNatRule: armnetwork.VirtualNetworkGatewayNatRule{ + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("50.4.0.0/24"), + // PortRange: to.Ptr("200-200"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // PortRange: to.Ptr("100-100"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayNatRuleList.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayNatRuleList.json func ExampleVirtualNetworkGatewayNatRulesClient_NewListByVirtualNetworkGatewayPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -160,7 +172,53 @@ func ExampleVirtualNetworkGatewayNatRulesClient_NewListByVirtualNetworkGatewayPa _ = 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.ListVirtualNetworkGatewayNatRulesResult = armnetwork.ListVirtualNetworkGatewayNatRulesResult{ + // page = armnetwork.VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{ + // ListVirtualNetworkGatewayNatRulesResult: armnetwork.ListVirtualNetworkGatewayNatRulesResult{ + // Value: []*armnetwork.VirtualNetworkGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule2"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.21.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.4.0.0/24"), + // }, + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go index dee69915a8f1..77db1c2efdc3 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // VirtualNetworkGatewaysClient contains the methods for the VirtualNetworkGateways group. // Don't use this type directly, use NewVirtualNetworkGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkGatewaysClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkGatewaysClient creates a new instance of VirtualNetworkGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewaysClient, error) { @@ -44,9 +44,7 @@ func NewVirtualNetworkGatewaysClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to create or update virtual network gateway operation. // - options - VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate @@ -58,8 +56,7 @@ func (client *VirtualNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdate(ctx context.Context, // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, _ *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -105,18 +104,15 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -125,9 +121,7 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes the specified virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete // method. @@ -138,8 +132,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDelete(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -151,8 +144,6 @@ func (client *VirtualNetworkGatewaysClient) BeginDelete(ctx context.Context, res // Delete - Deletes the specified virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDelete" @@ -177,6 +168,10 @@ func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -185,27 +180,20 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginDisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - request - The parameters are supplied to disconnect vpn connections. // - options - VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters @@ -217,8 +205,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGateway return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -231,8 +218,6 @@ func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGateway // DisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections" @@ -274,9 +259,9 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } @@ -286,9 +271,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo // BeginGenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource // group. Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. // - options - VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile @@ -300,8 +283,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGenerateVPNProfileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -314,8 +296,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context. // GenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. // Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGenerateVPNProfile" @@ -340,6 +320,10 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfile(ctx context.Conte // generateVPNProfileCreateRequest creates the GenerateVPNProfile request. func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, _ *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -348,18 +332,15 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -369,9 +350,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx // BeginGeneratevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. // - options - VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage @@ -383,8 +362,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -397,8 +375,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx co // Generatevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified // resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage" @@ -423,6 +399,10 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context // generatevpnclientpackageCreateRequest creates the Generatevpnclientpackage request. func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, _ *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -431,18 +411,15 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -451,9 +428,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques // Get - Gets the specified virtual network gateway by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get // method. @@ -482,6 +457,10 @@ func (client *VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGro // getCreateRequest creates the Get request. func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -490,17 +469,13 @@ func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -517,9 +492,7 @@ func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Respons // BeginGetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the // specified peer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peer - The IP address of the peer. // - options - VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes @@ -531,8 +504,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -545,8 +517,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context // GetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the specified // peer. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes" @@ -571,6 +541,10 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutes(ctx context.Cont // getAdvertisedRoutesCreateRequest creates the GetAdvertisedRoutes request. func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, _ *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -579,27 +553,21 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("peer", peer) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginGetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus // method. @@ -610,8 +578,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetBgpPeerStatus(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -623,8 +590,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetBgpPeerStatus(ctx context.Co // GetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus" @@ -649,6 +614,10 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context // getBgpPeerStatusCreateRequest creates the GetBgpPeerStatus request. func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -657,20 +626,16 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.Peer != nil { reqQP.Set("peer", *options.Peer) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -678,9 +643,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co // BeginGetFailoverAllTestDetails - This operation retrieves the details of all the failover tests performed on the gateway // for different peering locations // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - typeParam - The type of failover test // - fetchLatest - Fetch only the latest tests for each peering location @@ -693,8 +656,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverAllTestDetails(ctx c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -707,8 +669,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverAllTestDetails(ctx c // GetFailoverAllTestDetails - This operation retrieves the details of all the failover tests performed on the gateway for // different peering locations // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetails(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, typeParam string, fetchLatest bool, options *VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails" @@ -733,6 +693,10 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetails(ctx contex // getFailoverAllTestDetailsCreateRequest creates the GetFailoverAllTestDetails request. func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, typeParam string, fetchLatest bool, _ *VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getFailoverAllTestsDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -741,19 +705,15 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("fetchLatest", strconv.FormatBool(fetchLatest)) reqQP.Set("type", typeParam) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -761,9 +721,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque // BeginGetFailoverSingleTestDetails - This operation retrieves the details of a particular failover test performed on the // gateway based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test // - failoverTestID - The unique Guid value which identifies the test @@ -776,8 +734,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverSingleTestDetails(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -790,8 +747,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverSingleTestDetails(ct // GetFailoverSingleTestDetails - This operation retrieves the details of a particular failover test performed on the gateway // based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, failoverTestID string, options *VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails" @@ -816,6 +771,10 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetails(ctx con // getFailoverSingleTestDetailsCreateRequest creates the GetFailoverSingleTestDetails request. func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, failoverTestID string, _ *VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getFailoverSingleTestDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -824,19 +783,15 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("failoverTestId", failoverTestID) reqQP.Set("peeringLocation", peeringLocation) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -844,9 +799,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe // BeginGetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes // method. @@ -857,8 +810,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetLearnedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -871,8 +823,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Co // GetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes" @@ -897,6 +847,10 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context // getLearnedRoutesCreateRequest creates the GetLearnedRoutes request. func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -905,17 +859,13 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -923,9 +873,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co // BeginGetResiliencyInformation - This operation retrieves the resiliency information for an Express Route Gateway, including // the gateway's current resiliency score and recommendations to further improve the score // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetResiliencyInformation // method. @@ -936,8 +884,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetResiliencyInformation(ctx co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetResiliencyInformationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -950,8 +897,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetResiliencyInformation(ctx co // GetResiliencyInformation - This operation retrieves the resiliency information for an Express Route Gateway, including // the gateway's current resiliency score and recommendations to further improve the score // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getResiliencyInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetResiliencyInformation" @@ -976,6 +921,10 @@ func (client *VirtualNetworkGatewaysClient) getResiliencyInformation(ctx context // getResiliencyInformationCreateRequest creates the GetResiliencyInformation request. func (client *VirtualNetworkGatewaysClient) getResiliencyInformationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getResiliencyInformation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -984,20 +933,16 @@ func (client *VirtualNetworkGatewaysClient) getResiliencyInformationCreateReques return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.AttemptRefresh != nil { reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1005,9 +950,7 @@ func (client *VirtualNetworkGatewaysClient) getResiliencyInformationCreateReques // BeginGetRoutesInformation - This operation retrieves the route set information for an Express Route Gateway based on their // resiliency // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetRoutesInformation // method. @@ -1018,8 +961,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetRoutesInformation(ctx contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetRoutesInformationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1031,8 +973,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetRoutesInformation(ctx contex // GetRoutesInformation - This operation retrieves the route set information for an Express Route Gateway based on their resiliency // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getRoutesInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetRoutesInformation" @@ -1057,6 +997,10 @@ func (client *VirtualNetworkGatewaysClient) getRoutesInformation(ctx context.Con // getRoutesInformationCreateRequest creates the GetRoutesInformation request. func (client *VirtualNetworkGatewaysClient) getRoutesInformationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getRoutesInformation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1065,20 +1009,16 @@ func (client *VirtualNetworkGatewaysClient) getRoutesInformationCreateRequest(ct return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.AttemptRefresh != nil { reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1086,9 +1026,7 @@ func (client *VirtualNetworkGatewaysClient) getRoutesInformationCreateRequest(ct // BeginGetVPNProfilePackageURL - Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified // resource group. The profile needs to be generated first using generateVpnProfile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL // method. @@ -1099,8 +1037,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1113,8 +1050,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx con // GetVPNProfilePackageURL - Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified // resource group. The profile needs to be generated first using generateVpnProfile. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL" @@ -1139,6 +1074,10 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context. // getVPNProfilePackageURLCreateRequest creates the GetVPNProfilePackageURL request. func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1147,17 +1086,13 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1165,9 +1100,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest // BeginGetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the // VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth method. @@ -1178,8 +1111,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ct return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1192,8 +1124,6 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ct // GetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth" @@ -1218,6 +1148,10 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx con // getVpnclientConnectionHealthCreateRequest creates the GetVpnclientConnectionHealth request. func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1226,29 +1160,22 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginGetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient -// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. +// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayName - The virtual network gateway name. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the // VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters method. func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse], error) { @@ -1258,8 +1185,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1270,11 +1196,8 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx } // GetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec -// policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. +// policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters" @@ -1299,6 +1222,10 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx cont // getVpnclientIPSecParametersCreateRequest creates the GetVpnclientIPSecParameters request. func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1307,27 +1234,21 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginInvokeAbortMigration - Trigger abort migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the virtual network gateway. -// - virtualNetworkGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeAbortMigration // method. func (client *VirtualNetworkGatewaysClient) BeginInvokeAbortMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeAbortMigrationResponse], error) { @@ -1337,8 +1258,7 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeAbortMigration(ctx contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1350,8 +1270,6 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeAbortMigration(ctx contex // InvokeAbortMigration - Trigger abort migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) invokeAbortMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginInvokeAbortMigration" @@ -1393,18 +1311,15 @@ func (client *VirtualNetworkGatewaysClient) invokeAbortMigrationCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginInvokeCommitMigration - Trigger commit migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the virtual network gateway. -// - virtualNetworkGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeCommitMigration // method. func (client *VirtualNetworkGatewaysClient) BeginInvokeCommitMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeCommitMigrationResponse], error) { @@ -1414,8 +1329,7 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeCommitMigration(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1427,8 +1341,6 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeCommitMigration(ctx conte // InvokeCommitMigration - Trigger commit migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) invokeCommitMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginInvokeCommitMigration" @@ -1470,18 +1382,15 @@ func (client *VirtualNetworkGatewaysClient) invokeCommitMigrationCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginInvokeExecuteMigration - Trigger execute migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the virtual network gateway. -// - virtualNetworkGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration // method. func (client *VirtualNetworkGatewaysClient) BeginInvokeExecuteMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse], error) { @@ -1491,8 +1400,7 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeExecuteMigration(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1504,8 +1412,6 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokeExecuteMigration(ctx cont // InvokeExecuteMigration - Trigger execute migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) invokeExecuteMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration" @@ -1547,18 +1453,15 @@ func (client *VirtualNetworkGatewaysClient) invokeExecuteMigrationCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginInvokePrepareMigration - Trigger prepare migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the virtual network gateway. -// - virtualNetworkGatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayName - The name of the virtual network gateway. // - migrationParams - Parameters supplied to the Begin Prepare migration on basic vpn gateway through Network resource provider. // - options - VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokePrepareMigration // method. @@ -1569,8 +1472,7 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokePrepareMigration(ctx cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1582,8 +1484,6 @@ func (client *VirtualNetworkGatewaysClient) BeginInvokePrepareMigration(ctx cont // InvokePrepareMigration - Trigger prepare migration for the virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) invokePrepareMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, migrationParams VirtualNetworkGatewayMigrationParameters, options *VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginInvokePrepareMigration" @@ -1625,9 +1525,9 @@ func (client *VirtualNetworkGatewaysClient) invokePrepareMigrationCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, migrationParams); err != nil { return nil, err } @@ -1635,9 +1535,7 @@ func (client *VirtualNetworkGatewaysClient) invokePrepareMigrationCreateRequest( } // NewListPager - Gets all virtual network gateways by resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager // method. func (client *VirtualNetworkGatewaysClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) *runtime.Pager[VirtualNetworkGatewaysClientListResponse] { @@ -1666,21 +1564,21 @@ func (client *VirtualNetworkGatewaysClient) NewListPager(resourceGroupName strin // listCreateRequest creates the List request. func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworkGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1695,9 +1593,7 @@ func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Respon } // NewListConnectionsPager - Gets all the connections in a virtual network gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListConnectionsPager // method. @@ -1727,6 +1623,10 @@ func (client *VirtualNetworkGatewaysClient) NewListConnectionsPager(resourceGrou // listConnectionsCreateRequest creates the ListConnections request. func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientListConnectionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1735,17 +1635,13 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx con return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1761,8 +1657,6 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsHandleResponse(resp * // ListRadiusSecrets - List all Radius servers with respective radius secrets from virtual network gateway VpnClientConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientListRadiusSecretsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.ListRadiusSecrets @@ -1792,6 +1686,10 @@ func (client *VirtualNetworkGatewaysClient) ListRadiusSecrets(ctx context.Contex // listRadiusSecretsCreateRequest creates the ListRadiusSecrets request. func (client *VirtualNetworkGatewaysClient) listRadiusSecretsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientListRadiusSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/listRadiusSecrets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1800,17 +1698,13 @@ func (client *VirtualNetworkGatewaysClient) listRadiusSecretsCreateRequest(ctx c return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1826,9 +1720,7 @@ func (client *VirtualNetworkGatewaysClient) listRadiusSecretsHandleResponse(resp // BeginReset - Resets the primary of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset // method. @@ -1839,8 +1731,7 @@ func (client *VirtualNetworkGatewaysClient) BeginReset(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1852,8 +1743,6 @@ func (client *VirtualNetworkGatewaysClient) BeginReset(ctx context.Context, reso // Reset - Resets the primary of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginReset" @@ -1878,6 +1767,10 @@ func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceG // resetCreateRequest creates the Reset request. func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1886,20 +1779,16 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.GatewayVip != nil { reqQP.Set("gatewayVip", *options.GatewayVip) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1907,9 +1796,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte // BeginResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey // method. @@ -1920,8 +1807,7 @@ func (client *VirtualNetworkGatewaysClient) BeginResetVPNClientSharedKey(ctx con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1933,8 +1819,6 @@ func (client *VirtualNetworkGatewaysClient) BeginResetVPNClientSharedKey(ctx con // ResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey" @@ -1959,6 +1843,10 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context. // resetVPNClientSharedKeyCreateRequest creates the ResetVPNClientSharedKey request. func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1967,27 +1855,20 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginSetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client // of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - vpnclientIPSecParams - Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client // operation through Network resource provider. @@ -2000,8 +1881,7 @@ func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2014,8 +1894,6 @@ func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx // SetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client // of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters" @@ -2040,6 +1918,10 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx cont // setVpnclientIPSecParametersCreateRequest creates the SetVpnclientIPSecParameters request. func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, _ *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2048,18 +1930,15 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnclientIPSecParams); err != nil { return nil, err } @@ -2069,9 +1948,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq // BeginStartExpressRouteSiteFailoverSimulation - This operation starts failover simulation on the gateway for the specified // peering location // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test // - options - VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions contains the optional parameters @@ -2083,8 +1960,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStartExpressRouteSiteFailoverSi return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2097,8 +1973,6 @@ func (client *VirtualNetworkGatewaysClient) BeginStartExpressRouteSiteFailoverSi // StartExpressRouteSiteFailoverSimulation - This operation starts failover simulation on the gateway for the specified peering // location // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, options *VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation" @@ -2123,6 +1997,10 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat // startExpressRouteSiteFailoverSimulationCreateRequest creates the StartExpressRouteSiteFailoverSimulation request. func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, _ *VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startSiteFailoverTest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2131,27 +2009,21 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("peeringLocation", peeringLocation) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginStartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture // method. @@ -2162,8 +2034,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStartPacketCapture(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2175,8 +2046,6 @@ func (client *VirtualNetworkGatewaysClient) BeginStartPacketCapture(ctx context. // StartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartPacketCapture" @@ -2201,6 +2070,10 @@ func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Conte // startPacketCaptureCreateRequest creates the StartPacketCapture request. func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2209,19 +2082,16 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -2233,9 +2103,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx // BeginStopExpressRouteSiteFailoverSimulation - This operation stops failover simulation on the gateway for the specified // peering location // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - stopParameters - Virtual network gateway stop simulation parameters supplied to stop failover simulation on gateway. // - options - VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions contains the optional parameters @@ -2247,8 +2115,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStopExpressRouteSiteFailoverSim return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2261,8 +2128,6 @@ func (client *VirtualNetworkGatewaysClient) BeginStopExpressRouteSiteFailoverSim // StopExpressRouteSiteFailoverSimulation - This operation stops failover simulation on the gateway for the specified peering // location // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation" @@ -2287,6 +2152,10 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati // stopExpressRouteSiteFailoverSimulationCreateRequest creates the StopExpressRouteSiteFailoverSimulation request. func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, _ *VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopSiteFailoverTest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2295,18 +2164,15 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, stopParameters); err != nil { return nil, err } @@ -2315,9 +2181,7 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati // BeginStopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. // - options - VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture @@ -2329,8 +2193,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStopPacketCapture(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2342,8 +2205,6 @@ func (client *VirtualNetworkGatewaysClient) BeginStopPacketCapture(ctx context.C // StopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStopPacketCapture" @@ -2368,6 +2229,10 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCapture(ctx context.Contex // stopPacketCaptureCreateRequest creates the StopPacketCapture request. func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, _ *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2376,18 +2241,15 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -2396,9 +2258,7 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c // SupportedVPNDevices - Gets a xml format representation for supported vpn devices. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices // method. @@ -2427,6 +2287,10 @@ func (client *VirtualNetworkGatewaysClient) SupportedVPNDevices(ctx context.Cont // supportedVPNDevicesCreateRequest creates the SupportedVPNDevices request. func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2435,17 +2299,13 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -2461,9 +2321,7 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesHandleResponse(re // BeginUpdateTags - Updates a virtual network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to update virtual network gateway tags. // - options - VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags @@ -2475,8 +2333,7 @@ func (client *VirtualNetworkGatewaysClient) BeginUpdateTags(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2488,8 +2345,6 @@ func (client *VirtualNetworkGatewaysClient) BeginUpdateTags(ctx context.Context, // UpdateTags - Updates a virtual network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginUpdateTags" @@ -2514,6 +2369,10 @@ func (client *VirtualNetworkGatewaysClient) updateTags(ctx context.Context, reso // updateTagsCreateRequest creates the UpdateTags request. func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, _ *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2522,18 +2381,15 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -2542,11 +2398,8 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. // VPNDeviceConfigurationScript - Gets a xml format representation for vpn device configuration script. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script -// is generated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the generate vpn device script operation. // - options - VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions contains the optional parameters for the VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript // method. @@ -2575,6 +2428,10 @@ func (client *VirtualNetworkGatewaysClient) VPNDeviceConfigurationScript(ctx con // vpnDeviceConfigurationScriptCreateRequest creates the VPNDeviceConfigurationScript request. func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, _ *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -2583,18 +2440,15 @@ func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRe return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go index 65af6893e6ea..c27ddb4a01b4 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go @@ -1,39 +1,36 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayUpdate.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayUpdate.json func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetworkGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "vpngw", armnetwork.VirtualNetworkGateway{ - Location: to.Ptr("centralus"), Identity: &armnetwork.ManagedServiceIdentity{ Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, + Location: to.Ptr("centralus"), Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ Active: to.Ptr(false), AllowRemoteVnetTraffic: to.Ptr(false), @@ -45,7 +42,8 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor }, CustomRoutes: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("101.168.0.6/32")}, + to.Ptr("101.168.0.6/32"), + }, }, DisableIPSecReplayProtection: to.Ptr(false), EnableBgp: to.Ptr(false), @@ -59,48 +57,54 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), }, }, - }}, + }, + }, NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), Name: to.Ptr("natRule1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), ExternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("50.0.0.0/24"), - }}, + }, + }, InternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("10.10.0.0/24"), - }}, + }, + }, IPConfigurationID: to.Ptr(""), Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), }, }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), Name: to.Ptr("natRule2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), ExternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("30.0.0.0/24"), - }}, + }, + }, InternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("20.10.0.0/24"), - }}, + }, + }, IPConfigurationID: to.Ptr(""), Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), }, - }}, + }, + }, SKU: &armnetwork.VirtualNetworkGatewaySKU{ Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), @@ -111,9 +115,11 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor RadiusServerAddress: to.Ptr("10.2.0.0"), RadiusServerScore: to.Ptr[int64](20), RadiusServerSecret: to.Ptr("radiusServerSecret"), - }}, + }, + }, VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, + to.Ptr(armnetwork.VPNClientProtocolOpenVPN), + }, VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{}, VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{}, }, @@ -125,139 +131,154 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualNetworkGatewaysClientCreateOrUpdateResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("vpngw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65515), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), + // to.Ptr("10.3.1.254"), + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("52.161.10.135"), + // }, // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // EnableDNSForwarding: to.Ptr(true), + // EnableHighBandwidthVPNGateway: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // InboundDNSForwardingEndpoint: to.Ptr("10.0.1.14"), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("gwipconfig1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnableDNSForwarding: to.Ptr(true), - // EnableHighBandwidthVPNGateway: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // InboundDNSForwardingEndpoint: to.Ptr("10.0.1.14"), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // AddressSpace: to.Ptr("50.0.0.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr(""), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, + // AddressSpace: to.Ptr("10.10.0.0/24"), // }, + // }, + // IPConfigurationID: to.Ptr(""), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr(""), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // AddressSpace: to.Ptr("30.0.0.0/24"), + // }, // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.2.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("20.10.0.0/24"), // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), // }, - // } + // IPConfigurationID: to.Ptr(""), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](0), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.2.0.0"), + // RadiusServerScore: to.Ptr[int64](20), + // }, + // }, + // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ + // to.Ptr(armnetwork.VPNClientProtocolOpenVPN), + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ + // }, + // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ + // }, + // }, + // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkScalableGatewayUpdate.json +// Generated from example definition: 2025-07-01/VirtualNetworkScalableGatewayUpdate.json func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetworkScalableGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -284,13 +305,14 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), }, Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), }, }, - }}, + }, + }, NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{}, SKU: &armnetwork.VirtualNetworkGatewaySKU{ Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), @@ -305,71 +327,185 @@ func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetwor } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("ergw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AdminState: to.Ptr(armnetwork.AdminStateEnabled), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ - // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ - // Max: to.Ptr[int32](3), - // Min: to.Ptr[int32](2), + // res = armnetwork.VirtualNetworkGatewaysClientCreateOrUpdateResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("ergw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AdminState: to.Ptr(armnetwork.AdminStateEnabled), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ + // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ + // Max: to.Ptr[int32](3), + // Min: to.Ptr[int32](2), + // }, // }, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("gwipconfig1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // }, // }, // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VirtualNetworkGatewayPolicyGroups: []*armnetwork.VirtualNetworkGatewayPolicyGroup{ + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), + // }, + // VirtualNetworkGatewayPolicyGroups: []*armnetwork.VirtualNetworkGatewayPolicyGroup{ + // }, + // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), // }, - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGet.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayDelete.json +func ExampleVirtualNetworkGatewaysClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDelete(ctx, "rg1", "vpngw", 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 poll 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 = armnetwork.VirtualNetworkGatewaysClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewaysDisconnectP2sVpnConnections.json +func ExampleVirtualNetworkGatewaysClient_BeginDisconnectVirtualNetworkGatewayVPNConnections() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDisconnectVirtualNetworkGatewayVPNConnections(ctx, "vpn-gateway-test", "vpngateway", armnetwork.P2SVPNConnectionRequest{ + VPNConnectionIDs: []*string{ + to.Ptr("vpnconnId1"), + to.Ptr("vpnconnId2"), + }, + }, 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 poll 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 = armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGenerateVpnProfile.json +func ExampleVirtualNetworkGatewaysClient_BeginGenerateVPNProfile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, 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 poll 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 = armnetwork.VirtualNetworkGatewaysClientGenerateVPNProfileResponse{ + // Value: to.Ptr(""), + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGenerateVpnClientPackage.json +func ExampleVirtualNetworkGatewaysClient_BeginGeneratevpnclientpackage() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGeneratevpnclientpackage(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, 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 poll 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 = armnetwork.VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse{ + // Value: to.Ptr(""), + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGet.json func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -380,140 +516,155 @@ func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkGateway() { // 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ + // res = armnetwork.VirtualNetworkGatewaysClientGetResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("vpngw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, // }, // }, - // }, - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), + // to.Ptr("10.3.1.254"), + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("52.161.10.135"), + // }, // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // EnableHighBandwidthVPNGateway: to.Ptr(false), + // EnablePrivateIPAddress: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("gwipconfig1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnableHighBandwidthVPNGateway: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // }, + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // AddressSpace: to.Ptr("50.0.0.0/24"), // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // AddressSpace: to.Ptr("10.10.0.0/24"), + // }, // }, - // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ - // ErrorMessage: to.Ptr(""), - // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), - // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("30.0.0.0/24"), + // }, // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.1.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("20.10.0.0/24"), // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), // }, - // } + // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](0), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ + // ErrorMessage: to.Ptr(""), + // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), + // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), + // }, + // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.1.0.0"), + // RadiusServerScore: to.Ptr[int64](20), + // }, + // }, + // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ + // to.Ptr(armnetwork.VPNClientProtocolOpenVPN), + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ + // }, + // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ + // }, + // }, + // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkScalableGatewayGet.json +// Generated from example definition: 2025-07-01/VirtualNetworkScalableGatewayGet.json func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkScalableGateway() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -524,632 +675,267 @@ func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkScalableGateway() // 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("ergw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AdminState: to.Ptr(armnetwork.AdminStateEnabled), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ - // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ - // Max: to.Ptr[int32](3), - // Min: to.Ptr[int32](2), + // res = armnetwork.VirtualNetworkGatewaysClientGetResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("ergw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AdminState: to.Ptr(armnetwork.AdminStateEnabled), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ + // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ + // Max: to.Ptr[int32](3), + // Min: to.Ptr[int32](2), + // }, // }, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("gwipconfig1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // }, // }, // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VirtualNetworkGatewayPolicyGroups: []*armnetwork.VirtualNetworkGatewayPolicyGroup{ + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), + // }, + // VirtualNetworkGatewayPolicyGroups: []*armnetwork.VirtualNetworkGatewayPolicyGroup{ + // }, + // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), // }, - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayDelete.json -func ExampleVirtualNetworkGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetAdvertisedRoutes.json +func ExampleVirtualNetworkGatewaysClient_BeginGetAdvertisedRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDelete(ctx, "rg1", "vpngw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetAdvertisedRoutes(ctx, "rg1", "vpngw", "test", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse{ + // GatewayRouteListResult: armnetwork.GatewayRouteListResult{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayUpdateTags.json -func ExampleVirtualNetworkGatewaysClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetBGPPeerStatus.json +func ExampleVirtualNetworkGatewaysClient_BeginGetBgpPeerStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginUpdateTags(ctx, "rg1", "vpngw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetBgpPeerStatus(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), + // res = armnetwork.VirtualNetworkGatewaysClientGetBgpPeerStatusResponse{ + // BgpPeerStatusListResult: armnetwork.BgpPeerStatusListResult{ // }, - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.0.254"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testpub1"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayList.json -func ExampleVirtualNetworkGatewaysClient_NewListPager() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetFailoverAllTestsDetails.json +func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverAllTestDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkGatewayListResult = armnetwork.VirtualNetworkGatewayListResult{ - // Value: []*armnetwork.VirtualNetworkGateway{ - // { - // Name: to.Ptr("vpngw1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), - // Location: to.Ptr("loc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.0.14"), - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw1-ip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ - // ErrorMessage: to.Ptr(""), - // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), - // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // }, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // }, - // { - // Name: to.Ptr("vpngw2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), - // Location: to.Ptr("loc2"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.1.0.46"), - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(true), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.1.0.7"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw2-ip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ - // ErrorMessage: to.Ptr(""), - // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), - // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.2.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewaysListConnections.json -func ExampleVirtualNetworkGatewaysClient_NewListConnectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetFailoverAllTestDetails(ctx, "rg1", "ergw", "SingleSiteFailover", true, nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListConnectionsPager("testrg", "test-vpn-gateway-1", 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.VirtualNetworkGatewayListConnectionsResult = armnetwork.VirtualNetworkGatewayListConnectionsResult{ - // Value: []*armnetwork.VirtualNetworkGatewayConnectionListEntity{ - // { - // Name: to.Ptr("test-vpn-connection"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/connections/test-vpn-connection"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionListEntityPropertiesFormat{ - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeVnet2Vnet), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(true), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](22), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkConnectionGatewayReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-1"), - // }, - // VirtualNetworkGateway2: &armnetwork.VirtualNetworkConnectionGatewayReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg-2/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-2"), - // }, - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse{ + // ExpressRouteFailoverTestDetailsArray: []*armnetwork.ExpressRouteFailoverTestDetails{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayReset.json -func ExampleVirtualNetworkGatewaysClient_BeginReset() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetFailoverSingleTestDetails.json +func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverSingleTestDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginResetOptions{GatewayVip: nil}) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetFailoverSingleTestDetails(ctx, "rg1", "ergw", "Vancouver", "fe458ae8-d2ae-4520-a104-44bc233bde7e", 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) + log.Fatalf("failed to poll 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.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } + // res = armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse{ + // ExpressRouteFailoverSingleTestDetailsArray: []*armnetwork.ExpressRouteFailoverSingleTestDetails{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayResetVpnClientSharedKey.json -func ExampleVirtualNetworkGatewaysClient_BeginResetVPNClientSharedKey() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayLearnedRoutes.json +func ExampleVirtualNetworkGatewaysClient_BeginGetLearnedRoutes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginResetVPNClientSharedKey(ctx, "rg1", "vpngw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetLearnedRoutes(ctx, "rg1", "vpngw", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse{ + // GatewayRouteListResult: armnetwork.GatewayRouteListResult{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGenerateVpnClientPackage.json -func ExampleVirtualNetworkGatewaysClient_BeginGeneratevpnclientpackage() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetResiliencyInformation.json +func ExampleVirtualNetworkGatewaysClient_BeginGetResiliencyInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGeneratevpnclientpackage(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetResiliencyInformation(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions{ + AttemptRefresh: to.Ptr(true)}) 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) + log.Fatalf("failed to poll 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.Value = "" + // res = armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse{ + // GatewayResiliencyInformation: armnetwork.GatewayResiliencyInformation{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGenerateVpnProfile.json -func ExampleVirtualNetworkGatewaysClient_BeginGenerateVPNProfile() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetRoutesInformation.json +func ExampleVirtualNetworkGatewaysClient_BeginGetRoutesInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetRoutesInformation(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions{ + AttemptRefresh: to.Ptr(false)}) 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) + log.Fatalf("failed to poll 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.Value = "" + // res = armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse{ + // GatewayRouteSetsInformation: armnetwork.GatewayRouteSetsInformation{ + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetVpnProfilePackageUrl.json func ExampleVirtualNetworkGatewaysClient_BeginGetVPNProfilePackageURL() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1159,463 +945,798 @@ func ExampleVirtualNetworkGatewaysClient_BeginGetVPNProfilePackageURL() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.Value = "" + // res = armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse{ + // Value: to.Ptr(""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetBGPPeerStatus.json -func ExampleVirtualNetworkGatewaysClient_BeginGetBgpPeerStatus() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetVpnclientConnectionHealth.json +func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientConnectionHealth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetBgpPeerStatus(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions{Peer: nil}) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientConnectionHealth(ctx, "p2s-vnet-test", "vpnp2sgw", 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) + log.Fatalf("failed to poll 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.BgpPeerStatusListResult = armnetwork.BgpPeerStatusListResult{ + // res = armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse{ + // VPNClientConnectionHealthDetailListResult: armnetwork.VPNClientConnectionHealthDetailListResult{ + // Value: []*armnetwork.VPNClientConnectionHealthDetail{ + // { + // EgressBytesTransferred: to.Ptr[int64](33420), + // EgressPacketsTransferred: to.Ptr[int64](557), + // IngressBytesTransferred: to.Ptr[int64](33420), + // IngressPacketsTransferred: to.Ptr[int64](557), + // MaxBandwidth: to.Ptr[int64](240000000), + // MaxPacketsPerSecond: to.Ptr[int64](4), + // PrivateIPAddress: to.Ptr("192.168.210.2"), + // PublicIPAddress: to.Ptr("167.220.2.232:45522"), + // VPNConnectionDuration: to.Ptr[int64](900), + // VPNConnectionID: to.Ptr("IKEv2_1e1cfe59-5c7c-4315-a876-b11fbfdfeed4"), + // VPNConnectionTime: to.Ptr("2019-05-02T22:26:22"), + // VPNUserName: to.Ptr("gwp2schildcert"), + // }, + // { + // EgressBytesTransferred: to.Ptr[int64](23420), + // EgressPacketsTransferred: to.Ptr[int64](357), + // IngressBytesTransferred: to.Ptr[int64](23420), + // IngressPacketsTransferred: to.Ptr[int64](357), + // MaxBandwidth: to.Ptr[int64](220000000), + // MaxPacketsPerSecond: to.Ptr[int64](4), + // PrivateIPAddress: to.Ptr("192.168.210.1"), + // PublicIPAddress: to.Ptr("167.220.2.232:45213"), + // VPNConnectionDuration: to.Ptr[int64](800), + // VPNConnectionID: to.Ptr("IKEv2_571cfe59-2c7d-1415-e813-c51fbfdfea16"), + // VPNConnectionTime: to.Ptr("2019-05-01T21:06:12"), + // VPNUserName: to.Ptr("gwp2schildcert"), + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewaySupportedVpnDevice.json -func ExampleVirtualNetworkGatewaysClient_SupportedVPNDevices() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayGetVpnClientIpsecParameters.json +func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientIPSecParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().SupportedVPNDevices(ctx, "rg1", "vpngw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientIPSecParameters(ctx, "rg1", "vpngw", 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 poll 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.Value = "" + // res = armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse{ + // VPNClientIPsecParameters: armnetwork.VPNClientIPsecParameters{ + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86473), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AllVirtualNetworkGatewayRadiusServerSecretsList.json -func ExampleVirtualNetworkGatewaysClient_ListRadiusSecrets() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayAbortMigration.json +func ExampleVirtualNetworkGatewaysClient_BeginInvokeAbortMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().ListRadiusSecrets(ctx, "rg1", "vpngw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeAbortMigration(ctx, "rg1", "vpngw", 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.RadiusAuthServerListResult = armnetwork.RadiusAuthServerListResult{ - // Value: []*armnetwork.RadiusAuthServer{ - // { - // RadiusServerAddress: to.Ptr("1.1.1.1"), - // RadiusServerSecret: to.Ptr("abc123"), - // }, - // { - // RadiusServerAddress: to.Ptr("2.2.2.2"), - // RadiusServerSecret: to.Ptr("mnop1234"), - // }}, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayLearnedRoutes.json -func ExampleVirtualNetworkGatewaysClient_BeginGetLearnedRoutes() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayCommitMigration.json +func ExampleVirtualNetworkGatewaysClient_BeginInvokeCommitMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetLearnedRoutes(ctx, "rg1", "vpngw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeCommitMigration(ctx, "rg1", "vpngw", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetAdvertisedRoutes.json -func ExampleVirtualNetworkGatewaysClient_BeginGetAdvertisedRoutes() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayExecuteMigration.json +func ExampleVirtualNetworkGatewaysClient_BeginInvokeExecuteMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetAdvertisedRoutes(ctx, "rg1", "vpngw", "test", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeExecuteMigration(ctx, "rg1", "vpngw", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetResiliencyInformation.json -func ExampleVirtualNetworkGatewaysClient_BeginGetResiliencyInformation() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayPrepareMigration.json +func ExampleVirtualNetworkGatewaysClient_BeginInvokePrepareMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetResiliencyInformation(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions{AttemptRefresh: to.Ptr(true)}) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokePrepareMigration(ctx, "rg1", "vpngw", armnetwork.VirtualNetworkGatewayMigrationParameters{ + MigrationType: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP), + ResourceURL: to.Ptr("testUrl"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.GatewayResiliencyInformation = armnetwork.GatewayResiliencyInformation{ - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetRoutesInformation.json -func ExampleVirtualNetworkGatewaysClient_BeginGetRoutesInformation() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayList.json +func ExampleVirtualNetworkGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetRoutesInformation(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions{AttemptRefresh: to.Ptr(false)}) - 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) + pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.VirtualNetworkGatewaysClientListResponse{ + // VirtualNetworkGatewayListResult: armnetwork.VirtualNetworkGatewayListResult{ + // Value: []*armnetwork.VirtualNetworkGateway{ + // { + // Name: to.Ptr("vpngw1"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), + // Location: to.Ptr("loc1"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65515), + // BgpPeeringAddress: to.Ptr("10.0.0.14"), + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // EnablePrivateIPAddress: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("default"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/ipConfigurations/default"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw1-ip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // }, + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("50.0.0.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.10.0.0/24"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("30.0.0.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("20.10.0.0/24"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ + // ErrorMessage: to.Ptr(""), + // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), + // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), + // }, + // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ + // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ + // }, + // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ + // }, + // }, + // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // }, + // { + // Name: to.Ptr("vpngw2"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), + // Location: to.Ptr("loc2"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65515), + // BgpPeeringAddress: to.Ptr("10.1.0.46"), + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // EnablePrivateIPAddress: to.Ptr(true), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("default"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAddress: to.Ptr("10.1.0.7"), + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw2-ip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), + // }, + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // { + // Name: to.Ptr("natRule1"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("50.0.0.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("10.10.0.0/24"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("natRule2"), + // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), + // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("30.0.0.0/24"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("20.10.0.0/24"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VirtualNetworkGatewayMigrationStatus: &armnetwork.VirtualNetworkGatewayMigrationStatus{ + // ErrorMessage: to.Ptr(""), + // Phase: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationPhase("")), + // State: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationState("")), + // }, + // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.2.0.0"), + // RadiusServerScore: to.Ptr[int64](20), + // }, + // }, + // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ + // to.Ptr(armnetwork.VPNClientProtocolOpenVPN), + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ + // }, + // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ + // }, + // }, + // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // }, + // }, + // }, + // } } - // 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.GatewayRouteSetsInformation = armnetwork.GatewayRouteSetsInformation{ - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewaySetVpnClientIpsecParameters.json -func ExampleVirtualNetworkGatewaysClient_BeginSetVpnclientIPSecParameters() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewaysListConnections.json +func ExampleVirtualNetworkGatewaysClient_NewListConnectionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginSetVpnclientIPSecParameters(ctx, "rg1", "vpngw", armnetwork.VPNClientIPsecParameters{ - DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - SaDataSizeKilobytes: to.Ptr[int32](429497), - SaLifeTimeSeconds: to.Ptr[int32](86473), - }, 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) + pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListConnectionsPager("testrg", "test-vpn-gateway-1", 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 = armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse{ + // VirtualNetworkGatewayListConnectionsResult: armnetwork.VirtualNetworkGatewayListConnectionsResult{ + // Value: []*armnetwork.VirtualNetworkGatewayConnectionListEntity{ + // { + // Name: to.Ptr("test-vpn-connection"), + // Type: to.Ptr("Microsoft.Network/connections"), + // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/connections/test-vpn-connection"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkGatewayConnectionListEntityPropertiesFormat{ + // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeVnet2Vnet), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(true), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RoutingWeight: to.Ptr[int32](22), + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VirtualNetworkGateway1: &armnetwork.VirtualNetworkConnectionGatewayReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-1"), + // }, + // VirtualNetworkGateway2: &armnetwork.VirtualNetworkConnectionGatewayReference{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg-2/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-2"), + // }, + // }, + // }, + // }, + // }, + // } } - // 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.VPNClientIPsecParameters = armnetwork.VPNClientIPsecParameters{ - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86473), - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetVpnClientIpsecParameters.json -func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientIPSecParameters() { +// Generated from example definition: 2025-07-01/AllVirtualNetworkGatewayRadiusServerSecretsList.json +func ExampleVirtualNetworkGatewaysClient_ListRadiusSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("72f988bf-86f1-41af-91ab-2d7cd011db47", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientIPSecParameters(ctx, "rg1", "vpngw", nil) + res, err := clientFactory.NewVirtualNetworkGatewaysClient().ListRadiusSecrets(ctx, "rg1", "vpngw", 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.VPNClientIPsecParameters = armnetwork.VPNClientIPsecParameters{ - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86473), + // res = armnetwork.VirtualNetworkGatewaysClientListRadiusSecretsResponse{ + // RadiusAuthServerListResult: armnetwork.RadiusAuthServerListResult{ + // Value: []*armnetwork.RadiusAuthServer{ + // { + // RadiusServerAddress: to.Ptr("1.1.1.1"), + // RadiusServerSecret: to.Ptr("*****"), + // }, + // { + // RadiusServerAddress: to.Ptr("2.2.2.2"), + // RadiusServerSecret: to.Ptr("*****"), + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayVpnDeviceConfigurationScript.json -func ExampleVirtualNetworkGatewaysClient_VPNDeviceConfigurationScript() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().VPNDeviceConfigurationScript(ctx, "rg1", "vpngw", armnetwork.VPNDeviceScriptParameters{ - DeviceFamily: to.Ptr("ISR"), - FirmwareVersion: to.Ptr("IOS 15.1 (Preview)"), - Vendor: to.Ptr("Cisco"), - }, 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.Value = "! Microsoft Corporation\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Sample VPN tunnel configuration template for IOS-based devices\r\n!\r\n! This configuration template applies to Cisco VPN devices running IOS 15.1 or beyond (ISR or ASR)\r\n!\r\n\r\n\r\n \r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! ACL rules\r\n!\r\n! Some VPN devices require explicit ACL rules to allow cross-premises traffic:\r\n!\r\n! 1. Allow traffic between on premises address ranges and VNet address ranges\r\n! 2. Allow IKE traffic (UDP:500) between on premises VPN devices and Azure VPN gateway\r\n! 3. Allow IPsec traffic (Proto:ESP) between on premises VPN devices and Azure VPN gateway\r\n!\r\n \r\naccess-list 101 permit ip 10.1.0.0 0.0.255.255 10.0.0.0 0.0.255.255\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Internet Key Exchange (IKE) configuration\r\n!\r\n! This section specifies the authentication, encryption, hashing, and Diffie-Hellman group parameters for IKE\r\n! main mode or phase 1\r\n!\r\n\r\ncrypto ikev2 proposal SwaggerS2S-proposal\r\n encryption DES3\r\n integrity SHA384\r\n group DHGroup24\r\n lifetime 3600\r\n exit\r\n\r\ncrypto ikev2 policy SwaggerS2S-policy\r\n proposal SwaggerS2S-proposal\r\n exit\r\n\r\ncrypto ikev2 keyring SwaggerBranch-keyring\r\n \r\n peer 52.173.199.254\r\n address 52.173.199.254\r\n pre-shared-key lALEHuppeopJmA94exRNiRr2QzuZ6lOsvzu5IlJUEA6LthbTc8g5MTT86MCsGNMzGkTAaLuLnEJoD1Cn4cIlr94qKZm9drsgllzWvsPNezS71stAkaW1Bb7h6GBnDlDP\r\n exit\r\n\r\ncrypto ikev2 profile SwaggerS2S-profile\r\n match address local 10.3.0.0\r\n match identity remote address 52.173.199.254 255.255.255.255\r\n \r\n authentication remote pre-share\r\n authentication local pre-share\r\n keyring SwaggerBranch-keyring\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! IPsec configuration\r\n!\r\n! This section specifies encryption, authentication, tunnel mode properties for the Phase 2 negotiation\r\n!\r\ncrypto ipsec transform-set SwaggerS2S-TransformSet DES3 DES3\r\n mode tunnel\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Crypto map configuration\r\n!\r\n! This section defines a crypto profile that binds the cross-premises network traffic to the IPsec and IKE\r\n! policy profiles for this connection. Then defines the VTI (virtual tunnel interface) with the crypto\r\n! profile. A random interface number (tunnel 1) was used with a random link local address (169.254.0.1/28)\r\n! for the tunnel interface. If either selection is already used in the VPN device, please select another\r\n! interface number or address. The only requirement is that they must not overlap with another interface\r\n! on the same VPN device.\r\n!\r\ncrypto ipsec profile SwaggerS2S-IPsecProfile\r\n set transform-set SwaggerS2S-TransformSet\r\n set ikev2-profile SwaggerS2S-profile\r\n set pfs None\r\n set security-association lifetime 3600\r\n exit\r\n\r\n\r\nint tunnel 52.173.199.254\r\n ip address 169.254.0.1 255.255.255.252\r\n ip tcp adjust-mss 1350\r\n tunnel source 10.3.0.0\r\n tunnel mode ipsec ipv4\r\n tunnel destination 52.173.199.254\r\n tunnel protection ipsec profile SwaggerS2S-IPsecProfile\r\n exit\r\n\r\n ip route 10.0.0.0 255.255.0.0 tunnel 52.173.199.254 " -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayStartPacketCaptureFilterData.json -func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithFilter() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayReset.json +func ExampleVirtualNetworkGatewaysClient_BeginReset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNPacketCaptureStartParameters{ - FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), - }, - }) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginReset(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewaysClientResetResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("vpngw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // Location: to.Ptr("centralus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.3.1.254"), + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("52.161.10.135"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("gwipconfig1"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), + // }, + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](0), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayStartPacketCapture.json -func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithoutFilter() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayResetVpnClientSharedKey.json +func ExampleVirtualNetworkGatewaysClient_BeginResetVPNClientSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginResetVPNClientSharedKey(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayStopPacketCapture.json -func ExampleVirtualNetworkGatewaysClient_BeginStopPacketCapture() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewaySetVpnClientIpsecParameters.json +func ExampleVirtualNetworkGatewaysClient_BeginSetVpnclientIPSecParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", armnetwork.VPNPacketCaptureStopParameters{ - SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginSetVpnclientIPSecParameters(ctx, "rg1", "vpngw", armnetwork.VPNClientIPsecParameters{ + DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), + IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), + SaDataSizeKilobytes: to.Ptr[int32](429497), + SaLifeTimeSeconds: to.Ptr[int32](86473), }, 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse{ + // VPNClientIPsecParameters: armnetwork.VPNClientIPsecParameters{ + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86473), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetFailoverAllTestsDetails.json -func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverAllTestDetails() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayStartSiteFailoverSimulation.json +func ExampleVirtualNetworkGatewaysClient_BeginStartExpressRouteSiteFailoverSimulation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetFailoverAllTestDetails(ctx, "rg1", "ergw", "SingleSiteFailover", true, nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartExpressRouteSiteFailoverSimulation(ctx, "rg1", "ergw", "Vancouver", 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) + log.Fatalf("failed to poll 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.ExpressRouteFailoverTestDetailsArray = []*armnetwork.ExpressRouteFailoverTestDetails{ + // res = armnetwork.VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse{ + // Value: to.Ptr(""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetFailoverSingleTestDetails.json -func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverSingleTestDetails() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayStartPacketCapture.json +func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithoutFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetFailoverSingleTestDetails(ctx, "rg1", "ergw", "Vancouver", "fe458ae8-d2ae-4520-a104-44bc233bde7e", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.ExpressRouteFailoverSingleTestDetailsArray = []*armnetwork.ExpressRouteFailoverSingleTestDetails{ + // res = armnetwork.VirtualNetworkGatewaysClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayStartSiteFailoverSimulation.json -func ExampleVirtualNetworkGatewaysClient_BeginStartExpressRouteSiteFailoverSimulation() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayStartPacketCaptureFilterData.json +func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartExpressRouteSiteFailoverSimulation(ctx, "rg1", "ergw", "Vancouver", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{ + Parameters: &armnetwork.VPNPacketCaptureStartParameters{ + FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + }}) 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) + log.Fatalf("failed to poll 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.Value = "[object Object]" + // res = armnetwork.VirtualNetworkGatewaysClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayStopSiteFailoverSimulation.json +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayStopSiteFailoverSimulation.json func ExampleVirtualNetworkGatewaysClient_BeginStopExpressRouteSiteFailoverSimulation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1632,184 +1753,207 @@ func ExampleVirtualNetworkGatewaysClient_BeginStopExpressRouteSiteFailoverSimula FailoverConnectionName: to.Ptr("conn2"), FailoverLocation: to.Ptr("Amsterdam"), IsVerified: to.Ptr(true), - }}, + }, + }, }, 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) + log.Fatalf("failed to poll 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.Value = "[object Object]" + // res = armnetwork.VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse{ + // Value: to.Ptr(""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayGetVpnclientConnectionHealth.json -func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientConnectionHealth() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayStopPacketCapture.json +func ExampleVirtualNetworkGatewaysClient_BeginStopPacketCapture() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientConnectionHealth(ctx, "p2s-vnet-test", "vpnp2sgw", nil) + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", armnetwork.VPNPacketCaptureStopParameters{ + SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + }, 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) + log.Fatalf("failed to poll 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.VPNClientConnectionHealthDetailListResult = armnetwork.VPNClientConnectionHealthDetailListResult{ - // Value: []*armnetwork.VPNClientConnectionHealthDetail{ - // { - // EgressBytesTransferred: to.Ptr[int64](33420), - // EgressPacketsTransferred: to.Ptr[int64](557), - // IngressBytesTransferred: to.Ptr[int64](33420), - // IngressPacketsTransferred: to.Ptr[int64](557), - // MaxBandwidth: to.Ptr[int64](240000000), - // MaxPacketsPerSecond: to.Ptr[int64](4), - // PrivateIPAddress: to.Ptr("192.168.210.2"), - // PublicIPAddress: to.Ptr("167.220.2.232:45522"), - // VPNConnectionDuration: to.Ptr[int64](900), - // VPNConnectionID: to.Ptr("IKEv2_1e1cfe59-5c7c-4315-a876-b11fbfdfeed4"), - // VPNConnectionTime: to.Ptr("2019-05-02T22:26:22"), - // VPNUserName: to.Ptr("gwp2schildcert"), - // }, - // { - // EgressBytesTransferred: to.Ptr[int64](23420), - // EgressPacketsTransferred: to.Ptr[int64](357), - // IngressBytesTransferred: to.Ptr[int64](23420), - // IngressPacketsTransferred: to.Ptr[int64](357), - // MaxBandwidth: to.Ptr[int64](220000000), - // MaxPacketsPerSecond: to.Ptr[int64](4), - // PrivateIPAddress: to.Ptr("192.168.210.1"), - // PublicIPAddress: to.Ptr("167.220.2.232:45213"), - // VPNConnectionDuration: to.Ptr[int64](800), - // VPNConnectionID: to.Ptr("IKEv2_571cfe59-2c7d-1415-e813-c51fbfdfea16"), - // VPNConnectionTime: to.Ptr("2019-05-01T21:06:12"), - // VPNUserName: to.Ptr("gwp2schildcert"), - // }}, + // res = armnetwork.VirtualNetworkGatewaysClientStopPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewaysDisconnectP2sVpnConnections.json -func ExampleVirtualNetworkGatewaysClient_BeginDisconnectVirtualNetworkGatewayVPNConnections() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewaySupportedVpnDevice.json +func ExampleVirtualNetworkGatewaysClient_SupportedVPNDevices() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDisconnectVirtualNetworkGatewayVPNConnections(ctx, "vpn-gateway-test", "vpngateway", armnetwork.P2SVPNConnectionRequest{ - VPNConnectionIDs: []*string{ - to.Ptr("vpnconnId1"), - to.Ptr("vpnconnId2")}, - }, nil) + res, err := clientFactory.NewVirtualNetworkGatewaysClient().SupportedVPNDevices(ctx, "rg1", "vpngw", 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) - } + // 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 = armnetwork.VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{ + // Value: to.Ptr(""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayPrepareMigration.json -func ExampleVirtualNetworkGatewaysClient_BeginInvokePrepareMigration() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayUpdateTags.json +func ExampleVirtualNetworkGatewaysClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokePrepareMigration(ctx, "rg1", "vpngw", armnetwork.VirtualNetworkGatewayMigrationParameters{ - MigrationType: to.Ptr(armnetwork.VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP), - ResourceURL: to.Ptr("testUrl"), + poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginUpdateTags(ctx, "rg1", "vpngw", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayExecuteMigration.json -func ExampleVirtualNetworkGatewaysClient_BeginInvokeExecuteMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeExecuteMigration(ctx, "rg1", "vpngw", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayCommitMigration.json -func ExampleVirtualNetworkGatewaysClient_BeginInvokeCommitMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeCommitMigration(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkGatewaysClientUpdateTagsResponse{ + // VirtualNetworkGateway: armnetwork.VirtualNetworkGateway{ + // Name: to.Ptr("vpngw"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // }, + // }, + // }, + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ + // Active: to.Ptr(false), + // AllowRemoteVnetTraffic: to.Ptr(false), + // AllowVirtualWanTraffic: to.Ptr(false), + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65515), + // BgpPeeringAddress: to.Ptr("10.0.0.254"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.3.1.254"), + // }, + // IPConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("52.161.10.135"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // CustomRoutes: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("101.168.0.6/32"), + // }, + // }, + // DisableIPSecReplayProtection: to.Ptr(false), + // EnableBgp: to.Ptr(false), + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), + // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ + // { + // Name: to.Ptr("default"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), + // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ + // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // PublicIPAddress: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testpub1"), + // }, + // Subnet: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), + // }, + // }, + // }, + // }, + // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // SKU: &armnetwork.VirtualNetworkGatewaySKU{ + // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), + // }, + // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), + // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGatewayAbortMigration.json -func ExampleVirtualNetworkGatewaysClient_BeginInvokeAbortMigration() { +// Generated from example definition: 2025-07-01/VirtualNetworkGatewayVpnDeviceConfigurationScript.json +func ExampleVirtualNetworkGatewaysClient_VPNDeviceConfigurationScript() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginInvokeAbortMigration(ctx, "rg1", "vpngw", nil) + res, err := clientFactory.NewVirtualNetworkGatewaysClient().VPNDeviceConfigurationScript(ctx, "rg1", "vpngw", armnetwork.VPNDeviceScriptParameters{ + DeviceFamily: to.Ptr("ISR"), + FirmwareVersion: to.Ptr("IOS 15.1 (Preview)"), + Vendor: to.Ptr("Cisco"), + }, 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) - } + // 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 = armnetwork.VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{ + // Value: to.Ptr("! Microsoft Corporation\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Sample VPN tunnel configuration template for IOS-based devices\r\n!\r\n! This configuration template applies to Cisco VPN devices running IOS 15.1 or beyond (ISR or ASR)\r\n!\r\n\r\n\r\n \r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! ACL rules\r\n!\r\n! Some VPN devices require explicit ACL rules to allow cross-premises traffic:\r\n!\r\n! 1. Allow traffic between on premises address ranges and VNet address ranges\r\n! 2. Allow IKE traffic (UDP:500) between on premises VPN devices and Azure VPN gateway\r\n! 3. Allow IPsec traffic (Proto:ESP) between on premises VPN devices and Azure VPN gateway\r\n!\r\n \r\naccess-list 101 permit ip 10.1.0.0 0.0.255.255 10.0.0.0 0.0.255.255\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Internet Key Exchange (IKE) configuration\r\n!\r\n! This section specifies the authentication, encryption, hashing, and Diffie-Hellman group parameters for IKE\r\n! main mode or phase 1\r\n!\r\n\r\ncrypto ikev2 proposal SwaggerS2S-proposal\r\n encryption DES3\r\n integrity SHA384\r\n group DHGroup24\r\n lifetime 3600\r\n exit\r\n\r\ncrypto ikev2 policy SwaggerS2S-policy\r\n proposal SwaggerS2S-proposal\r\n exit\r\n\r\ncrypto ikev2 keyring SwaggerBranch-keyring\r\n \r\n peer 52.173.199.254\r\n address 52.173.199.254\r\n pre-shared-key lALEHuppeopJmA94exRNiRr2QzuZ6lOsvzu5IlJUEA6LthbTc8g5MTT86MCsGNMzGkTAaLuLnEJoD1Cn4cIlr94qKZm9drsgllzWvsPNezS71stAkaW1Bb7h6GBnDlDP\r\n exit\r\n\r\ncrypto ikev2 profile SwaggerS2S-profile\r\n match address local 10.3.0.0\r\n match identity remote address 52.173.199.254 255.255.255.255\r\n \r\n authentication remote pre-share\r\n authentication local pre-share\r\n keyring SwaggerBranch-keyring\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! IPsec configuration\r\n!\r\n! This section specifies encryption, authentication, tunnel mode properties for the Phase 2 negotiation\r\n!\r\ncrypto ipsec transform-set SwaggerS2S-TransformSet DES3 DES3\r\n mode tunnel\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Crypto map configuration\r\n!\r\n! This section defines a crypto profile that binds the cross-premises network traffic to the IPsec and IKE\r\n! policy profiles for this connection. Then defines the VTI (virtual tunnel interface) with the crypto\r\n! profile. A random interface number (tunnel 1) was used with a random link local address (169.254.0.1/28)\r\n! for the tunnel interface. If either selection is already used in the VPN device, please select another\r\n! interface number or address. The only requirement is that they must not overlap with another interface\r\n! on the same VPN device.\r\n!\r\ncrypto ipsec profile SwaggerS2S-IPsecProfile\r\n set transform-set SwaggerS2S-TransformSet\r\n set ikev2-profile SwaggerS2S-profile\r\n set pfs None\r\n set security-association lifetime 3600\r\n exit\r\n\r\n\r\nint tunnel 52.173.199.254\r\n ip address 169.254.0.1 255.255.255.252\r\n ip tcp adjust-mss 1350\r\n tunnel source 10.3.0.0\r\n tunnel mode ipsec ipv4\r\n tunnel destination 52.173.199.254\r\n tunnel protection ipsec profile SwaggerS2S-IPsecProfile\r\n exit\r\n\r\n ip route 10.0.0.0 255.255.0.0 tunnel 52.173.199.254 "), + // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go index 4ce4ff477110..77a5f9d04f0e 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualNetworkPeeringsClient contains the methods for the VirtualNetworkPeerings group. // Don't use this type directly, use NewVirtualNetworkPeeringsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkPeeringsClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkPeeringsClient creates a new instance of VirtualNetworkPeeringsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkPeeringsClient, error) { @@ -43,11 +43,9 @@ func NewVirtualNetworkPeeringsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a peering in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. -// - virtualNetworkPeeringName - The name of the peering. +// - virtualNetworkPeeringName - The name of the virtual network peering. // - virtualNetworkPeeringParameters - Parameters supplied to the create or update virtual network peering operation. // - options - VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *VirtualNetworkPeeringsClient) BeginCreateOrUpdate(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualNetworkPeeringsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a peering in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkPeeringsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdate(ctx context.Context, // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,21 +108,18 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx cont return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.SyncRemoteAddressSpace != nil { reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualNetworkPeeringParameters); err != nil { return nil, err } @@ -132,9 +128,7 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. // - options - VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete @@ -146,8 +140,7 @@ func (client *VirtualNetworkPeeringsClient) BeginDelete(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -159,8 +152,6 @@ func (client *VirtualNetworkPeeringsClient) BeginDelete(ctx context.Context, res // Delete - Deletes the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkPeeringsClient.BeginDelete" @@ -185,6 +176,10 @@ func (client *VirtualNetworkPeeringsClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, _ *VirtualNetworkPeeringsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -197,26 +192,19 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. // - options - VirtualNetworkPeeringsClientGetOptions contains the optional parameters for the VirtualNetworkPeeringsClient.Get @@ -246,6 +234,10 @@ func (client *VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGro // getCreateRequest creates the Get request. func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, _ *VirtualNetworkPeeringsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -258,17 +250,13 @@ func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -283,9 +271,7 @@ func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Respons } // NewListPager - Gets all virtual network peerings in a virtual network. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.NewListPager // method. @@ -315,6 +301,10 @@ func (client *VirtualNetworkPeeringsClient) NewListPager(resourceGroupName strin // listCreateRequest creates the List request. func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, _ *VirtualNetworkPeeringsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -323,17 +313,13 @@ func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Contex return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go index d471ccd1aba1..86db0b44cdea 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go @@ -1,188 +1,136 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringDelete.json -func ExampleVirtualNetworkPeeringsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginDelete(ctx, "peerTest", "vnet1", "peer", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkV6SubnetPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getV6SubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringCreate.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) + poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ + Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + AllowForwardedTraffic: to.Ptr(true), + AllowGatewayTransit: to.Ptr(false), + AllowVirtualNetworkAccess: to.Ptr(true), + RemoteVirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + }, + UseRemoteGateways: to.Ptr(false), + }, + }, 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // to.Ptr("12.0.0.0/8"), // }, - // UseRemoteGateways: to.Ptr(false), // }, - // } + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json -func ExampleVirtualNetworkPeeringsClient_Get_getPeeringWithRemoteVirtualNetworkEncryption() { +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeeringWithRemoteVirtualNetworkEncryption() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) + poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ + Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + AllowForwardedTraffic: to.Ptr(true), + AllowGatewayTransit: to.Ptr(false), + AllowVirtualNetworkAccess: to.Ptr(true), + RemoteVirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + }, + UseRemoteGateways: to.Ptr(false), + }, + }, 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 poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ // Enabled: to.Ptr(true), @@ -190,83 +138,85 @@ func ExampleVirtualNetworkPeeringsClient_Get_getPeeringWithRemoteVirtualNetworkE // }, // UseRemoteGateways: to.Ptr(false), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkSubnetPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getSubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringSync.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) + poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ + Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + AllowForwardedTraffic: to.Ptr(true), + AllowGatewayTransit: to.Ptr(false), + AllowVirtualNetworkAccess: to.Ptr(true), + RemoteVirtualNetwork: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + }, + UseRemoteGateways: to.Ptr(false), + }, + }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{ + SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) 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 poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkV6SubnetPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createV6SubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkSubnetPeeringCreate.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createSubnetPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -275,84 +225,98 @@ func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createV6SubnetPeeri AllowForwardedTraffic: to.Ptr(true), AllowGatewayTransit: to.Ptr(false), AllowVirtualNetworkAccess: to.Ptr(true), - EnableOnlyIPv6Peering: to.Ptr(true), + EnableOnlyIPv6Peering: to.Ptr(false), LocalSubnetNames: []*string{ to.Ptr("Subnet1"), - to.Ptr("Subnet4")}, + to.Ptr("Subnet4"), + }, PeerCompleteVnets: to.Ptr(false), RemoteSubnetNames: []*string{ - to.Ptr("Subnet2")}, + to.Ptr("Subnet2"), + }, RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), }, UseRemoteGateways: to.Ptr(false), }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) + }, 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) + log.Fatalf("failed to poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002::/64"), - // to.Ptr("2003::/64")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(false), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("13.0.0.0/8"), + // to.Ptr("2002:2002::/64"), + // }, // }, // LocalSubnetNames: []*string{ // to.Ptr("Subnet1"), - // to.Ptr("Subnet4")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002::/64"), - // to.Ptr("2003::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } + // to.Ptr("Subnet4"), + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("13.0.0.0/8"), + // to.Ptr("2002:2002::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkSubnetPeeringSync.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncSubnetPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -361,60 +325,89 @@ func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeering() { AllowForwardedTraffic: to.Ptr(true), AllowGatewayTransit: to.Ptr(false), AllowVirtualNetworkAccess: to.Ptr(true), + EnableOnlyIPv6Peering: to.Ptr(false), + PeerCompleteVnets: to.Ptr(false), RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), }, UseRemoteGateways: to.Ptr(false), }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) + }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{ + SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) 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) + log.Fatalf("failed to poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(false), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("2002:2002::/64"), + // }, + // }, + // LocalSubnetNames: []*string{ + // to.Ptr("Subnet1"), + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("2002:2002::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), // }, - // UseRemoteGateways: to.Ptr(false), // }, - // } + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeeringWithRemoteVirtualNetworkEncryption() { +// Generated from example definition: 2025-07-01/VirtualNetworkV6SubnetPeeringCreate.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createV6SubnetPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -423,59 +416,94 @@ func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeeringWithRe AllowForwardedTraffic: to.Ptr(true), AllowGatewayTransit: to.Ptr(false), AllowVirtualNetworkAccess: to.Ptr(true), + EnableOnlyIPv6Peering: to.Ptr(true), + LocalSubnetNames: []*string{ + to.Ptr("Subnet1"), + to.Ptr("Subnet4"), + }, + PeerCompleteVnets: to.Ptr(false), + RemoteSubnetNames: []*string{ + to.Ptr("Subnet2"), + }, RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), }, UseRemoteGateways: to.Ptr(false), }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) + }, 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) + log.Fatalf("failed to poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(true), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002::/64"), + // to.Ptr("2003::/64"), + // }, + // }, + // LocalSubnetNames: []*string{ + // to.Ptr("Subnet1"), + // to.Ptr("Subnet4"), + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002::/64"), + // to.Ptr("2003::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001::/64"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001::/64"), + // }, // }, // UseRemoteGateways: to.Ptr(false), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkSubnetPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createSubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkV6SubnetPeeringSync.json +func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncV6SubnetPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -484,310 +512,357 @@ func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createSubnetPeering AllowForwardedTraffic: to.Ptr(true), AllowGatewayTransit: to.Ptr(false), AllowVirtualNetworkAccess: to.Ptr(true), - EnableOnlyIPv6Peering: to.Ptr(false), - LocalSubnetNames: []*string{ - to.Ptr("Subnet1"), - to.Ptr("Subnet4")}, - PeerCompleteVnets: to.Ptr(false), - RemoteSubnetNames: []*string{ - to.Ptr("Subnet2")}, + EnableOnlyIPv6Peering: to.Ptr(true), + PeerCompleteVnets: to.Ptr(false), RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), }, UseRemoteGateways: to.Ptr(false), }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) + }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{ + SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) 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) + log.Fatalf("failed to poll 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("13.0.0.0/8"), - // to.Ptr("2002:2002::/64")}, + // res = armnetwork.VirtualNetworkPeeringsClientCreateOrUpdateResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(true), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002:2002::/64"), + // }, // }, // LocalSubnetNames: []*string{ // to.Ptr("Subnet1"), - // to.Ptr("Subnet4")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("13.0.0.0/8"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002:2002::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001:2001::/64"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001:2001::/64"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringDelete.json +func ExampleVirtualNetworkPeeringsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) + poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginDelete(ctx, "peerTest", "vnet1", "peer", 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) + log.Fatalf("failed to poll 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 = armnetwork.VirtualNetworkPeeringsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringGet.json +func ExampleVirtualNetworkPeeringsClient_Get_getPeering() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // res = armnetwork.VirtualNetworkPeeringsClientGetResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // to.Ptr("12.0.0.0/8"), // }, - // UseRemoteGateways: to.Ptr(false), // }, - // } + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkV6SubnetPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncV6SubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json +func ExampleVirtualNetworkPeeringsClient_Get_getPeeringWithRemoteVirtualNetworkEncryption() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - EnableOnlyIPv6Peering: to.Ptr(true), - PeerCompleteVnets: to.Ptr(false), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) + res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + // 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 = armnetwork.VirtualNetworkPeeringsClientGetResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ + // Enabled: to.Ptr(true), + // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkSubnetPeeringGet.json +func ExampleVirtualNetworkPeeringsClient_Get_getSubnetPeering() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, + // res = armnetwork.VirtualNetworkPeeringsClientGetResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(false), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("2002:2002::/64"), + // }, // }, // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } + // to.Ptr("Subnet1"), + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("212.0.0.0/16"), + // to.Ptr("2002:2002::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // to.Ptr("2001:2001::/64"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkSubnetPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncSubnetPeering() { +// Generated from example definition: 2025-07-01/VirtualNetworkV6SubnetPeeringGet.json +func ExampleVirtualNetworkPeeringsClient_Get_getV6SubnetPeering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - EnableOnlyIPv6Peering: to.Ptr(false), - PeerCompleteVnets: to.Ptr(false), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) + res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", 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.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, + // res = armnetwork.VirtualNetworkPeeringsClientGetResponse{ + // VirtualNetworkPeering: armnetwork.VirtualNetworkPeering{ + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // EnableOnlyIPv6Peering: to.Ptr(true), + // LocalAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002:2002::/64"), + // }, // }, // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } + // to.Ptr("Subnet1"), + // }, + // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2002:2002::/64"), + // }, + // }, + // PeerCompleteVnets: to.Ptr(false), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001:2001::/64"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20002"), + // }, + // RemoteSubnetNames: []*string{ + // to.Ptr("Subnet2"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("2001:2001::/64"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringList.json +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringList.json func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeerings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -802,76 +877,83 @@ func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeerings() { _ = 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.VirtualNetworkPeeringListResult = armnetwork.VirtualNetworkPeeringListResult{ - // Value: []*armnetwork.VirtualNetworkPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // page = armnetwork.VirtualNetworkPeeringsClientListResponse{ + // VirtualNetworkPeeringListResult: armnetwork.VirtualNetworkPeeringListResult{ + // Value: []*armnetwork.VirtualNetworkPeering{ + // { + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // to.Ptr("12.0.0.0/8"), // }, - // UseRemoteGateways: to.Ptr(false), // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // { + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(false), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("13.0.0.0/8"), + // }, + // }, + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20003"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), + // }, + // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("13.0.0.0/8"), + // }, + // }, + // UseRemoteGateways: to.Ptr(false), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(false), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20003"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }}, - // } + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json +// Generated from example definition: 2025-07-01/VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeeringsWithRemoteVirtualNetworkEncryption() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -886,27 +968,29 @@ func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeeringsWithRemoteVirt _ = 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.VirtualNetworkPeeringListResult = armnetwork.VirtualNetworkPeeringListResult{ - // Value: []*armnetwork.VirtualNetworkPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, + // page = armnetwork.VirtualNetworkPeeringsClientListResponse{ + // VirtualNetworkPeeringListResult: armnetwork.VirtualNetworkPeeringListResult{ + // Value: []*armnetwork.VirtualNetworkPeering{ + // { + // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), + // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ + // AllowForwardedTraffic: to.Ptr(true), + // AllowGatewayTransit: to.Ptr(false), + // AllowVirtualNetworkAccess: to.Ptr(true), + // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteAddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("12.0.0.0/8"), + // }, // }, // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ // RegionalCommunity: to.Ptr("12076:50004"), // VirtualNetworkCommunity: to.Ptr("12076:20002"), // }, // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), // }, // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ // Enabled: to.Ptr(true), @@ -916,8 +1000,8 @@ func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeeringsWithRemoteVirt // }, // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), // Name: to.Ptr("peer"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ // AllowForwardedTraffic: to.Ptr(false), // AllowGatewayTransit: to.Ptr(false), @@ -926,22 +1010,25 @@ func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeeringsWithRemoteVirt // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // RemoteAddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20003"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // to.Ptr("13.0.0.0/8"), // }, - // UseRemoteGateways: to.Ptr(false), // }, - // }}, - // } + // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20003"), + // }, + // RemoteVirtualNetwork: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), + // }, + // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ + // Enabled: to.Ptr(true), + // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // }, + // UseRemoteGateways: to.Ptr(false), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go index d97349f14f95..00210bbd179a 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // VirtualNetworksClient contains the methods for the VirtualNetworks group. // Don't use this type directly, use NewVirtualNetworksClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworksClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworksClient creates a new instance of VirtualNetworksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworksClient, error) { @@ -44,9 +44,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // CheckIPAddressAvailability - Checks whether a private IP address is available for use. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - ipAddress - The private IP address to be verified. // - options - VirtualNetworksClientCheckIPAddressAvailabilityOptions contains the optional parameters for the VirtualNetworksClient.CheckIPAddressAvailability @@ -75,7 +73,11 @@ func (client *VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Cont // checkIPAddressAvailabilityCreateRequest creates the CheckIPAddressAvailability request. func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, ipAddress string, _ *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/checkIPAddressAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,18 +86,14 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) reqQP.Set("ipAddress", ipAddress) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -111,9 +109,7 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityHandleResponse(re // BeginCreateOrUpdate - Creates or updates a virtual network in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to the create or update virtual network operation. // - options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate @@ -125,8 +121,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworksClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -138,8 +133,6 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a virtual network in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginCreateOrUpdate" @@ -164,6 +157,10 @@ func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, _ *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -172,18 +169,15 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -192,9 +186,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete // method. @@ -205,8 +197,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworksClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -218,8 +209,6 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -244,6 +233,10 @@ func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, _ *VirtualNetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -252,26 +245,19 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified virtual network by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (VirtualNetworksClientGetResponse, error) { @@ -299,6 +285,10 @@ func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -307,10 +297,6 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -319,8 +305,8 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -335,9 +321,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir } // NewListPager - Gets all virtual networks in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager // method. func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, options *VirtualNetworksClientListOptions) *runtime.Pager[VirtualNetworksClientListResponse] { @@ -366,21 +350,21 @@ func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, opti // listCreateRequest creates the List request. func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworksClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -395,8 +379,6 @@ func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (Vi } // NewListAllPager - Gets all virtual networks in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager // method. func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { @@ -434,8 +416,8 @@ func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, _ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -450,9 +432,7 @@ func (client *VirtualNetworksClient) listAllHandleResponse(resp *http.Response) } // BeginListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus // method. @@ -479,9 +459,8 @@ func (client *VirtualNetworksClient) BeginListDdosProtectionStatus(ctx context.C return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[VirtualNetworksClientListDdosProtectionStatusResponse]]{ - FinalStateVia: runtime.FinalStateViaLocation, - Response: &pager, - Tracer: client.internal.Tracer(), + Response: &pager, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -493,8 +472,6 @@ func (client *VirtualNetworksClient) BeginListDdosProtectionStatus(ctx context.C } // ListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network -// -// Generated from API version 2025-05-01 func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginListDdosProtectionStatus" @@ -519,6 +496,10 @@ func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Contex // listDdosProtectionStatusCreateRequest creates the ListDdosProtectionStatus request. func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -527,23 +508,19 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx c return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } if options != nil && options.Top != nil { reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -558,9 +535,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusHandleResponse(resp } // NewListUsagePager - Lists usage stats. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.NewListUsagePager // method. @@ -590,6 +565,10 @@ func (client *VirtualNetworksClient) NewListUsagePager(resourceGroupName string, // listUsageCreateRequest creates the ListUsage request. func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, _ *VirtualNetworksClientListUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -598,17 +577,13 @@ func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -624,9 +599,7 @@ func (client *VirtualNetworksClient) listUsageHandleResponse(resp *http.Response // UpdateTags - Updates a virtual network tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to update virtual network tags. // - options - VirtualNetworksClientUpdateTagsOptions contains the optional parameters for the VirtualNetworksClient.UpdateTags @@ -656,6 +629,10 @@ func (client *VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGro // updateTagsCreateRequest creates the UpdateTags request. func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject, _ *VirtualNetworksClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -664,18 +641,15 @@ func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context return nil, errors.New("parameter virtualNetworkName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go index 62fe5990c574..935e6151daa8 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go @@ -1,233 +1,298 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkDelete.json -func ExampleVirtualNetworksClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualNetworkCheckIPAddressAvailability.json +func ExampleVirtualNetworksClient_CheckIPAddressAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rg1", "test-vnet", nil) + res, err := clientFactory.NewVirtualNetworksClient().CheckIPAddressAvailability(ctx, "rg1", "test-vnet", "10.0.1.4", 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) - } + // 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 = armnetwork.VirtualNetworksClientCheckIPAddressAvailabilityResponse{ + // IPAddressAvailabilityResult: armnetwork.IPAddressAvailabilityResult{ + // Available: to.Ptr(false), + // AvailableIPAddresses: []*string{ + // to.Ptr("10.0.1.5"), + // to.Ptr("10.0.1.6"), + // to.Ptr("10.0.1.7"), + // to.Ptr("10.0.1.8"), + // to.Ptr("10.0.1.9"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGet.json -func ExampleVirtualNetworksClient_Get_getVirtualNetwork() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreate.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetwork() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + AddressSpace: &armnetwork.AddressSpace{ + AddressPrefixes: []*string{ + to.Ptr("10.0.0.0/16"), + }, + }, + FlowTimeoutInMinutes: to.Ptr[int32](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 poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DefaultPublicNatGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, + // FlowTimeoutInMinutes: to.Ptr[int32](10), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.1.0/24"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGetWithSubnetDelegation.json -func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithADelegatedSubnet() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateServiceEndpointPolicy.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ + Location: to.Ptr("eastus2euap"), + Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + AddressSpace: &armnetwork.AddressSpace{ + AddressPrefixes: []*string{ + to.Ptr("10.0.0.0/16"), + }, + }, + Subnets: []*armnetwork.Subnet{ + { + Name: to.Ptr("test-1"), + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), + }, + }, + ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + { + Service: to.Ptr("Microsoft.Storage"), + }, + }, + }, + }, + }, + }, + }, 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 poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("vnet1"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), + // Location: to.Ptr("eastus2euap"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), + // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.1.0/24"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, + // AddressPrefix: to.Ptr("10.0.0.0/16"), // IPConfigurations: []*armnetwork.IPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), - // }}, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), + // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ + // }, + // ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), + // }, + // }, + // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // { + // Locations: []*string{ + // to.Ptr("eastus2(stage)"), + // to.Ptr("usnorth(stage)"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Service: to.Ptr("Microsoft.Storage"), + // }, + // }, // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGetWithServiceAssociationLink.json -func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithServiceAssociationLinks() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateServiceEndpoints.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + AddressSpace: &armnetwork.AddressSpace{ + AddressPrefixes: []*string{ + to.Ptr("10.0.0.0/16"), + }, + }, + Subnets: []*armnetwork.Subnet{ + { + Name: to.Ptr("test-1"), + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/16"), + ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + { + Service: to.Ptr("Microsoft.Storage"), + }, + }, + }, + }, + }, + }, + }, 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 poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("vnet1"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), + // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.214.0/24"), - // Delegations: []*armnetwork.Delegation{ + // AddressPrefix: to.Ptr("10.0.0.0/16"), + // IPConfigurations: []*armnetwork.IPConfiguration{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ + // }, + // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/aciDelegation"), - // Name: to.Ptr("aciDelegation"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // to.Ptr("Microsoft.Network/virtualNetworks/subnets/action")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // IPConfigurationProfiles: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceAssociationLinks: []*armnetwork.ServiceAssociationLink{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/serviceAssociationLinks/serviceAssociationLink1"), - // Name: to.Ptr("serviceAssociationLink1"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), - // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ - // LinkedResourceType: to.Ptr("Microsoft.Provider/resourceType"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // Locations: []*string{ + // to.Ptr("eastus2(stage)"), + // to.Ptr("usnorth(stage)"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Service: to.Ptr("Microsoft.Storage"), // }, // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, // }, // }, - // } + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreate.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetwork() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateSubnet.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -236,9 +301,17 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetwork() { Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, + to.Ptr("10.0.0.0/16"), + }, + }, + Subnets: []*armnetwork.Subnet{ + { + Name: to.Ptr("test-1"), + Properties: &armnetwork.SubnetPropertiesFormat{ + AddressPrefix: to.Ptr("10.0.0.0/24"), + }, + }, }, - FlowTimeoutInMinutes: to.Ptr[int32](10), }, }, nil) if err != nil { @@ -246,39 +319,49 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetwork() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, - // FlowTimeoutInMinutes: to.Ptr[int32](10), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ + // { + // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/24"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateWithBgpCommunities.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithBgpCommunities() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateSubnetWithAddressPrefixes.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnetContainingAddressPrefixes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -287,18 +370,20 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithBg Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - VirtualNetworkCommunity: to.Ptr("12076:20000"), + to.Ptr("10.0.0.0/16"), + }, }, Subnets: []*armnetwork.Subnet{ { - Name: to.Ptr("test-1"), + Name: to.Ptr("test-2"), Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), + AddressPrefixes: []*string{ + to.Ptr("10.0.0.0/28"), + to.Ptr("10.0.1.0/28"), + }, }, - }}, + }, + }, }, }, nil) if err != nil { @@ -306,49 +391,52 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithBg } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20000"), + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), + // Name: to.Ptr("test-2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-2"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/28"), + // to.Ptr("10.1.0.0/28"), + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateSubnetWithDelegation.json +// Generated from example definition: 2025-07-01/VirtualNetworkCreateSubnetWithDelegation.json func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithDelegatedSubnets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -357,7 +445,8 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithDe Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, + to.Ptr("10.0.0.0/16"), + }, }, Subnets: []*armnetwork.Subnet{ { @@ -370,9 +459,11 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithDe Properties: &armnetwork.ServiceDelegationPropertiesFormat{ ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), }, - }}, + }, + }, }, - }}, + }, + }, }, }, nil) if err != nil { @@ -380,57 +471,62 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithDe } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westcentralus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("westcentralus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ // AddressPrefix: to.Ptr("10.0.0.0/24"), // Delegations: []*armnetwork.Delegation{ // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1/delegations/myDelegation"), // Name: to.Ptr("myDelegation"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1/delegations/myDelegation"), // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ // Actions: []*string{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), // }, - // }}, + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Purpose: to.Ptr(""), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateWithEncryption.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEncryption() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateWithBgpCommunities.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithBgpCommunities() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -439,11 +535,11 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEn Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, + to.Ptr("10.0.0.0/16"), + }, }, - Encryption: &armnetwork.VirtualNetworkEncryption{ - Enabled: to.Ptr(true), - Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + VirtualNetworkCommunity: to.Ptr("12076:20000"), }, Subnets: []*armnetwork.Subnet{ { @@ -451,7 +547,8 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEn Properties: &armnetwork.SubnetPropertiesFormat{ AddressPrefix: to.Ptr("10.0.0.0/24"), }, - }}, + }, + }, }, }, nil) if err != nil { @@ -459,49 +556,53 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEn } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, - // Encryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ + // RegionalCommunity: to.Ptr("12076:50004"), + // VirtualNetworkCommunity: to.Ptr("12076:20000"), // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ // AddressPrefix: to.Ptr("10.0.0.0/24"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateWithIpamPool.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithIpamPool() { +// Generated from example definition: 2025-07-01/VirtualNetworkCreateWithEncryption.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEncryption() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -509,27 +610,22 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithIp Location: to.Ptr("eastus"), Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ - IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - { - NumberOfIPAddresses: to.Ptr("65536"), - Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - }, - }}, + AddressPrefixes: []*string{ + to.Ptr("10.0.0.0/16"), + }, + }, + Encryption: &armnetwork.VirtualNetworkEncryption{ + Enabled: to.Ptr(true), + Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), }, Subnets: []*armnetwork.Subnet{ { Name: to.Ptr("test-1"), Properties: &armnetwork.SubnetPropertiesFormat{ - IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - { - NumberOfIPAddresses: to.Ptr("80"), - Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - }, - }}, + AddressPrefix: to.Ptr("10.0.0.0/24"), }, - }}, + }, + }, }, }, nil) if err != nil { @@ -537,85 +633,84 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithIp } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/22")}, - // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - // { - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/22")}, - // NumberOfIPAddresses: to.Ptr("800"), - // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - // }, - // }}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/26"), - // to.Ptr("10.0.0.64/28")}, - // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - // { - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/26"), - // to.Ptr("10.0.0.64/28")}, - // NumberOfIPAddresses: to.Ptr("80"), - // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateServiceEndpoints.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + // }, + // Encryption: &armnetwork.VirtualNetworkEncryption{ + // Enabled: to.Ptr(true), + // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnets: []*armnetwork.Subnet{ + // { + // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.0.0/24"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/VirtualNetworkCreateWithIpamPool.json +func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithIpamPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ + poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ Location: to.Ptr("eastus"), Properties: &armnetwork.VirtualNetworkPropertiesFormat{ AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, + IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ + { + NumberOfIPAddresses: to.Ptr("65536"), + Pool: &armnetwork.IpamPoolPrefixAllocationPool{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), + }, + }, + }, }, Subnets: []*armnetwork.Subnet{ { Name: to.Ptr("test-1"), Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ { - Service: to.Ptr("Microsoft.Storage"), - }}, + NumberOfIPAddresses: to.Ptr("80"), + Pool: &armnetwork.IpamPoolPrefixAllocationPool{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), + }, + }, + }, }, - }}, + }, + }, }, }, nil) if err != nil { @@ -623,324 +718,306 @@ func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSe } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientCreateOrUpdateResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("eastus2euap"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/22"), + // }, + // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ + // { + // AllocatedAddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/22"), + // }, + // NumberOfIPAddresses: to.Ptr("800"), + // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), + // }, + // }, + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/26"), + // to.Ptr("10.0.0.64/28"), // }, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, + // AllocatedAddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/26"), + // to.Ptr("10.0.0.64/28"), + // }, + // NumberOfIPAddresses: to.Ptr("80"), + // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), + // }, + // }, // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateUpdating), + // }, // }, // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateServiceEndpointPolicy.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy() { +// Generated from example definition: 2025-07-01/VirtualNetworkDelete.json +func ExampleVirtualNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus2euap"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), - }}, - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }}, - }, - }, nil) + poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rg1", "test-vnet", 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) + log.Fatalf("failed to poll 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ - // }, - // ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), - // }}, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } + // res = armnetwork.VirtualNetworksClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateSubnet.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnet() { +// Generated from example definition: 2025-07-01/VirtualNetworkGet.json +func ExampleVirtualNetworksClient_Get_getVirtualNetwork() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) + res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientGetResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // }, + // DefaultPublicNatGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), + // AddressPrefix: to.Ptr("10.0.1.0/24"), + // IPConfigurations: []*armnetwork.IPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), + // }, + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCreateSubnetWithAddressPrefixes.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnetContainingAddressPrefixes() { +// Generated from example definition: 2025-07-01/VirtualNetworkGetWithServiceAssociationLink.json +func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithServiceAssociationLinks() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-2"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/28"), - to.Ptr("10.0.1.0/28")}, - }, - }}, - }, - }, nil) + res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientGetResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-2"), - // Name: to.Ptr("test-2"), + // Name: to.Ptr("subnet1"), + // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/28"), - // to.Ptr("10.1.0.0/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // AddressPrefix: to.Ptr("10.0.214.0/24"), + // Delegations: []*armnetwork.Delegation{ + // { + // Name: to.Ptr("aciDelegation"), + // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/aciDelegation"), + // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ + // Actions: []*string{ + // to.Ptr("Microsoft.Network/virtualNetworks/subnets/action"), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), + // }, + // }, + // }, + // IPConfigurationProfiles: []*armnetwork.IPConfigurationProfile{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceAssociationLinks: []*armnetwork.ServiceAssociationLink{ + // { + // Name: to.Ptr("serviceAssociationLink1"), + // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/serviceAssociationLinks/serviceAssociationLink1"), + // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ + // LinkedResourceType: to.Ptr("Microsoft.Provider/resourceType"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ + // }, + // }, // }, // }, - // } + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkUpdateTags.json -func ExampleVirtualNetworksClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VirtualNetworkGetWithSubnetDelegation.json +func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithADelegatedSubnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworksClient().UpdateTags(ctx, "rg1", "test-vnet", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", 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.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VirtualNetworksClientGetResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ + // { + // Name: to.Ptr("subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), + // Properties: &armnetwork.SubnetPropertiesFormat{ + // AddressPrefix: to.Ptr("10.0.1.0/24"), + // Delegations: []*armnetwork.Delegation{ + // { + // Name: to.Ptr("myDelegation"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), + // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ + // Actions: []*string{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), + // }, + // }, + // }, + // IPConfigurations: []*armnetwork.IPConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Purpose: to.Ptr(""), + // }, + // }, // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkListAll.json -func ExampleVirtualNetworksClient_NewListAllPager() { +// Generated from example definition: 2025-07-01/VirtualNetworkList.json +func ExampleVirtualNetworksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualNetworksClient().NewListAllPager(nil) + pager := clientFactory.NewVirtualNetworksClient().NewListPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -951,20 +1028,22 @@ func ExampleVirtualNetworksClient_NewListAllPager() { _ = 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.VirtualNetworkListResult = armnetwork.VirtualNetworkListResult{ - // Value: []*armnetwork.VirtualNetwork{ - // { - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8")}, + // page = armnetwork.VirtualNetworksClientListResponse{ + // VirtualNetworkListResult: armnetwork.VirtualNetworkListResult{ + // Value: []*armnetwork.VirtualNetwork{ + // { + // Name: to.Ptr("vnet1"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, // }, // DefaultPublicNatGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), // }, // DhcpOptions: &armnetwork.DhcpOptions{ // DNSServers: []*string{ @@ -973,13 +1052,14 @@ func ExampleVirtualNetworksClient_NewListAllPager() { // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ // AddressPrefix: to.Ptr("10.0.0.0/24"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, @@ -987,43 +1067,47 @@ func ExampleVirtualNetworksClient_NewListAllPager() { // { // Name: to.Ptr("vnet2"), // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2"), // Location: to.Ptr("westus"), // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ // AddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DefaultPublicNatGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // to.Ptr("10.0.0.0/16"), // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // to.Ptr("8.8.8.8")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, + // }, + // DefaultPublicNatGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // }, + // DhcpOptions: &armnetwork.DhcpOptions{ + // DNSServers: []*string{ + // to.Ptr("8.8.8.8"), // }, - // }}, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnets: []*armnetwork.Subnet{ + // }, + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkList.json -func ExampleVirtualNetworksClient_NewListPager() { +// Generated from example definition: 2025-07-01/VirtualNetworkListAll.json +func ExampleVirtualNetworksClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualNetworksClient().NewListPager("rg1", nil) + pager := clientFactory.NewVirtualNetworksClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1034,20 +1118,22 @@ func ExampleVirtualNetworksClient_NewListPager() { _ = 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.VirtualNetworkListResult = armnetwork.VirtualNetworkListResult{ - // Value: []*armnetwork.VirtualNetwork{ - // { - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8")}, + // page = armnetwork.VirtualNetworksClientListAllResponse{ + // VirtualNetworkListResult: armnetwork.VirtualNetworkListResult{ + // Value: []*armnetwork.VirtualNetwork{ + // { + // Name: to.Ptr("vnet1"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/8"), + // }, // }, // DefaultPublicNatGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), // }, // DhcpOptions: &armnetwork.DhcpOptions{ // DNSServers: []*string{ @@ -1056,13 +1142,14 @@ func ExampleVirtualNetworksClient_NewListPager() { // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // Subnets: []*armnetwork.Subnet{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Name: to.Ptr("test-1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), // Properties: &armnetwork.SubnetPropertiesFormat{ // AddressPrefix: to.Ptr("10.0.0.0/24"), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ // }, // }, @@ -1070,68 +1157,93 @@ func ExampleVirtualNetworksClient_NewListPager() { // { // Name: to.Ptr("vnet2"), // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), // Location: to.Ptr("westus"), // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ // AddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // to.Ptr("10.0.0.0/16"), // }, - // DefaultPublicNatGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // to.Ptr("8.8.8.8")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, + // }, + // DefaultPublicNatGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-ngw"), + // }, + // DhcpOptions: &armnetwork.DhcpOptions{ + // DNSServers: []*string{ + // to.Ptr("8.8.8.8"), // }, - // }}, - // } + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnets: []*armnetwork.Subnet{ + // }, + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkCheckIPAddressAvailability.json -func ExampleVirtualNetworksClient_CheckIPAddressAvailability() { +// Generated from example definition: 2025-07-01/VirtualNetworkGetDdosProtectionStatus.json +func ExampleVirtualNetworksClient_BeginListDdosProtectionStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworksClient().CheckIPAddressAvailability(ctx, "rg1", "test-vnet", "10.0.1.4", nil) + poller, err := clientFactory.NewVirtualNetworksClient().BeginListDdosProtectionStatus(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions{ + Top: to.Ptr[int32](75)}) 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.IPAddressAvailabilityResult = armnetwork.IPAddressAvailabilityResult{ - // Available: to.Ptr(false), - // AvailableIPAddresses: []*string{ - // to.Ptr("10.0.1.5"), - // to.Ptr("10.0.1.6"), - // to.Ptr("10.0.1.7"), - // to.Ptr("10.0.1.8"), - // to.Ptr("10.0.1.9")}, - // } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll the result: %v", err) + } + for res.More() { + page, err := res.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 = armnetwork.VirtualNetworksClientListDdosProtectionStatusResponse{ + // VirtualNetworkDdosProtectionStatusResult: armnetwork.VirtualNetworkDdosProtectionStatusResult{ + // Value: []*armnetwork.PublicIPDdosProtectionStatusResult{ + // { + // DdosProtectionPlanID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), + // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), + // PublicIPAddress: to.Ptr("10.0.1.5"), + // PublicIPAddressID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), + // }, + // { + // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedFalse), + // PublicIPAddress: to.Ptr("10.0.1.6"), + // PublicIPAddressID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), + // }, + // }, + // }, + // } + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkListUsage.json +// Generated from example definition: 2025-07-01/VirtualNetworkListUsage.json func ExampleVirtualNetworksClient_NewListUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1146,76 +1258,80 @@ func ExampleVirtualNetworksClient_NewListUsagePager() { _ = 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.VirtualNetworkListUsageResult = armnetwork.VirtualNetworkListUsageResult{ - // Value: []*armnetwork.VirtualNetworkUsage{ - // { - // Name: &armnetwork.VirtualNetworkUsageName{ - // LocalizedValue: to.Ptr("Subnet size and usage"), - // Value: to.Ptr("SubnetSpace"), + // page = armnetwork.VirtualNetworksClientListUsageResponse{ + // VirtualNetworkListUsageResult: armnetwork.VirtualNetworkListUsageResult{ + // Value: []*armnetwork.VirtualNetworkUsage{ + // { + // Name: &armnetwork.VirtualNetworkUsageName{ + // LocalizedValue: to.Ptr("Subnet size and usage"), + // Value: to.Ptr("SubnetSpace"), + // }, + // CurrentValue: to.Ptr[float64](-1), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/GatewaySubnet"), + // Limit: to.Ptr[float64](-1), + // Unit: to.Ptr("Count"), // }, - // CurrentValue: to.Ptr[float64](-1), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/GatewaySubnet"), - // Limit: to.Ptr[float64](-1), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armnetwork.VirtualNetworkUsageName{ - // LocalizedValue: to.Ptr("Subnet size and usage"), - // Value: to.Ptr("SubnetSpace"), + // { + // Name: &armnetwork.VirtualNetworkUsageName{ + // LocalizedValue: to.Ptr("Subnet size and usage"), + // Value: to.Ptr("SubnetSpace"), + // }, + // CurrentValue: to.Ptr[float64](2), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/newSubnet"), + // Limit: to.Ptr[float64](3), + // Unit: to.Ptr("Count"), // }, - // CurrentValue: to.Ptr[float64](2), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/newSubnet"), - // Limit: to.Ptr[float64](3), - // Unit: to.Ptr("Count"), - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkGetDdosProtectionStatus.json -func ExampleVirtualNetworksClient_BeginListDdosProtectionStatus() { +// Generated from example definition: 2025-07-01/VirtualNetworkUpdateTags.json +func ExampleVirtualNetworksClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworksClient().BeginListDdosProtectionStatus(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions{Top: to.Ptr[int32](75), - SkipToken: nil, - }) + res, err := clientFactory.NewVirtualNetworksClient().UpdateTags(ctx, "rg1", "test-vnet", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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) - } - for res.More() { - page, err := res.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.VirtualNetworkDdosProtectionStatusResult = armnetwork.VirtualNetworkDdosProtectionStatusResult{ - // Value: []*armnetwork.PublicIPDdosProtectionStatusResult{ - // { - // DdosProtectionPlanID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), - // PublicIPAddress: to.Ptr("10.0.1.5"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }, - // { - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedFalse), - // PublicIPAddress: to.Ptr("10.0.1.6"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), - // }}, - // } - } + // 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 = armnetwork.VirtualNetworksClientUpdateTagsResponse{ + // VirtualNetwork: armnetwork.VirtualNetwork{ + // Name: to.Ptr("test-vnet"), + // Type: to.Ptr("Microsoft.Network/virtualNetworks"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Subnets: []*armnetwork.Subnet{ + // }, + // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ + // }, + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go index 4fedeb14dca2..2f5161449cdc 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualNetworkTapsClient contains the methods for the VirtualNetworkTaps group. // Don't use this type directly, use NewVirtualNetworkTapsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualNetworkTapsClient struct { internal *arm.Client subscriptionID string } // NewVirtualNetworkTapsClient creates a new instance of VirtualNetworkTapsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkTapsClient, error) { @@ -41,12 +41,10 @@ func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// BeginCreateOrUpdate - Creates or updates a Virtual Network Tap. +// BeginCreateOrUpdate - Create a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - tapName - The name of the virtual network tap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - tapName - The name of virtual network tap. // - parameters - Parameters supplied to the create or update virtual network tap operation. // - options - VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate // method. @@ -57,8 +55,7 @@ func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkTapsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -68,10 +65,8 @@ func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, } } -// CreateOrUpdate - Creates or updates a Virtual Network Tap. +// CreateOrUpdate - Create a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkTapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *VirtualNetworkTapsClient) createOrUpdate(ctx context.Context, reso // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, _ *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,30 +103,25 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. return nil, errors.New("parameter tapName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } return req, nil } -// BeginDelete - Deletes the specified virtual network tap. +// BeginDelete - Delete a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - tapName - The name of the virtual network tap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - tapName - The name of virtual network tap. // - options - VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete // method. func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkTapsClientDeleteResponse], error) { @@ -137,8 +131,7 @@ func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkTapsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -148,10 +141,8 @@ func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourc } } -// Delete - Deletes the specified virtual network tap. +// Delete - Delete a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, res // deleteCreateRequest creates the Delete request. func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, tapName string, _ *VirtualNetworkTapsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, return nil, errors.New("parameter tapName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } -// Get - Gets information about the specified virtual network tap. +// Get - Get a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - tapName - The name of virtual network tap. // - options - VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. func (client *VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (VirtualNetworkTapsClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, tapName string, _ *VirtualNetworkTapsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,17 +231,13 @@ func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, re return nil, errors.New("parameter tapName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -264,8 +252,6 @@ func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) ( } // NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager // method. func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { @@ -303,8 +289,8 @@ func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -319,9 +305,7 @@ func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Respons } // NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager // method. func (client *VirtualNetworkTapsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) *runtime.Pager[VirtualNetworkTapsClientListByResourceGroupResponse] { @@ -350,21 +334,21 @@ func (client *VirtualNetworkTapsClient) NewListByResourceGroupPager(resourceGrou // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworkTapsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -378,12 +362,10 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp * return result, nil } -// UpdateTags - Updates an VirtualNetworkTap tags. +// UpdateTags - Update a VirtualNetworkTap // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - tapName - The name of the tap. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - tapName - The name of virtual network tap. // - tapParameters - Parameters supplied to update VirtualNetworkTap tags. // - options - VirtualNetworkTapsClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkTapsClient.UpdateTags // method. @@ -412,6 +394,10 @@ func (client *VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resource // updateTagsCreateRequest creates the UpdateTags request. func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject, _ *VirtualNetworkTapsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -420,18 +406,15 @@ func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Cont return nil, errors.New("parameter tapName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go index db6b557da9ca..704acde6ec6c 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go @@ -1,184 +1,146 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapDelete.json -func ExampleVirtualNetworkTapsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualNetworkTapCreate.json +func ExampleVirtualNetworkTapsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginDelete(ctx, "rg1", "test-vtap", nil) + poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginCreateOrUpdate(ctx, "rg1", "test-vtap", armnetwork.VirtualNetworkTap{ + Location: to.Ptr("centraluseuap"), + Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1"), + }, + }, + }, 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapGet.json -func ExampleVirtualNetworkTapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkTapsClient().Get(ctx, "rg1", "testvtap", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to poll 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.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // res = armnetwork.VirtualNetworkTapsClientCreateOrUpdateResponse{ + // VirtualNetworkTap: armnetwork.VirtualNetworkTap{ + // Name: to.Ptr("testvtap"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapCreate.json -func ExampleVirtualNetworkTapsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualNetworkTapDelete.json +func ExampleVirtualNetworkTapsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginCreateOrUpdate(ctx, "rg1", "test-vtap", armnetwork.VirtualNetworkTap{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1"), - }, - }, - }, nil) + poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginDelete(ctx, "rg1", "test-vtap", 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) + log.Fatalf("failed to poll 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.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, + // res = armnetwork.VirtualNetworkTapsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapUpdateTags.json -func ExampleVirtualNetworkTapsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VirtualNetworkTapGet.json +func ExampleVirtualNetworkTapsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualNetworkTapsClient().UpdateTags(ctx, "rg1", "test-vtap", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewVirtualNetworkTapsClient().Get(ctx, "rg1", "testvtap", 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.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("test-vtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/test-vtap"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // res = armnetwork.VirtualNetworkTapsClientGetResponse{ + // VirtualNetworkTap: armnetwork.VirtualNetworkTap{ + // Name: to.Ptr("testvtap"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapListAll.json +// Generated from example definition: 2025-07-01/VirtualNetworkTapListAll.json func ExampleVirtualNetworkTapsClient_NewListAllPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -193,58 +155,63 @@ func ExampleVirtualNetworkTapsClient_NewListAllPager() { _ = 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.VirtualNetworkTapListResult = armnetwork.VirtualNetworkTapListResult{ - // Value: []*armnetwork.VirtualNetworkTap{ - // { - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // page = armnetwork.VirtualNetworkTapsClientListAllResponse{ + // VirtualNetworkTapListResult: armnetwork.VirtualNetworkTapListResult{ + // Value: []*armnetwork.VirtualNetworkTap{ + // { + // Name: to.Ptr("testvtap"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // }, - // { - // Name: to.Ptr("testvtap2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // { + // Name: to.Ptr("testvtap2"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualNetworkTapList.json +// Generated from example definition: 2025-07-01/VirtualNetworkTapList.json func ExampleVirtualNetworkTapsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -259,46 +226,100 @@ func ExampleVirtualNetworkTapsClient_NewListByResourceGroupPager() { _ = 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.VirtualNetworkTapListResult = armnetwork.VirtualNetworkTapListResult{ - // Value: []*armnetwork.VirtualNetworkTap{ - // { - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // page = armnetwork.VirtualNetworkTapsClientListByResourceGroupResponse{ + // VirtualNetworkTapListResult: armnetwork.VirtualNetworkTapListResult{ + // Value: []*armnetwork.VirtualNetworkTap{ + // { + // Name: to.Ptr("testvtap"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // }, - // { - // Name: to.Ptr("testvtap2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // { + // Name: to.Ptr("testvtap2"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // Etag: to.Ptr("etag"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), + // Location: to.Ptr("centraluseuap"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/VirtualNetworkTapUpdateTags.json +func ExampleVirtualNetworkTapsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualNetworkTapsClient().UpdateTags(ctx, "rg1", "test-vtap", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VirtualNetworkTapsClientUpdateTagsResponse{ + // VirtualNetworkTap: armnetwork.VirtualNetworkTap{ + // Name: to.Ptr("test-vtap"), + // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/test-vtap"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ + // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), + // }, + // DestinationPort: to.Ptr[int32](4789), + // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningState("Succeded")), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go index 3afdbc1d43b7..1b0b49c4beb5 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualRouterPeeringsClient contains the methods for the VirtualRouterPeerings group. // Don't use this type directly, use NewVirtualRouterPeeringsClient() instead. +// +// Generated from API version 2025-07-01 type VirtualRouterPeeringsClient struct { internal *arm.Client subscriptionID string } // NewVirtualRouterPeeringsClient creates a new instance of VirtualRouterPeeringsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualRouterPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRouterPeeringsClient, error) { @@ -43,11 +43,9 @@ func NewVirtualRouterPeeringsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. -// - peeringName - The name of the Virtual Router Peering. +// - peeringName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - parameters - Parameters supplied to the create or update Virtual Router Peering operation. // - options - VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate // method. @@ -58,8 +56,7 @@ func (client *VirtualRouterPeeringsClient) BeginCreateOrUpdate(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRouterPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,8 +68,6 @@ func (client *VirtualRouterPeeringsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualRouterPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualRouterPeeringsClient.BeginCreateOrUpdate" @@ -97,6 +92,10 @@ func (client *VirtualRouterPeeringsClient) createOrUpdate(ctx context.Context, r // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, _ *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -109,18 +108,15 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,11 +125,9 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes the specified peering from a Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. -// - peeringName - The name of the peering. +// - peeringName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete // method. func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*runtime.Poller[VirtualRouterPeeringsClientDeleteResponse], error) { @@ -143,8 +137,7 @@ func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRouterPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,8 +149,6 @@ func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, reso // Delete - Deletes the specified peering from a Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualRouterPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRouterPeeringsClient.BeginDelete" @@ -182,6 +173,10 @@ func (client *VirtualRouterPeeringsClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, _ *VirtualRouterPeeringsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -194,28 +189,21 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. -// - peeringName - The name of the Virtual Router Peering. +// - peeringName - The name of the resource that is unique within a resource group. This name can be used to access the resource. // - options - VirtualRouterPeeringsClientGetOptions contains the optional parameters for the VirtualRouterPeeringsClient.Get // method. func (client *VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientGetOptions) (VirtualRouterPeeringsClientGetResponse, error) { @@ -243,6 +231,10 @@ func (client *VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGrou // getCreateRequest creates the Get request. func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, _ *VirtualRouterPeeringsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -255,17 +247,13 @@ func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter peeringName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +268,7 @@ func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response } // NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.NewListPager // method. @@ -312,6 +298,10 @@ func (client *VirtualRouterPeeringsClient) NewListPager(resourceGroupName string // listCreateRequest creates the List request. func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, _ *VirtualRouterPeeringsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -320,17 +310,13 @@ func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context return nil, errors.New("parameter virtualRouterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go index c2e2da13c004..3858799bd755 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go @@ -1,118 +1,124 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeeringDelete.json -func ExampleVirtualRouterPeeringsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualRouterPeeringPut.json +func ExampleVirtualRouterPeeringsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginDelete(ctx, "rg1", "virtualRouter", "peering1", nil) + poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", "peering1", armnetwork.VirtualRouterPeering{ + Properties: &armnetwork.VirtualRouterPeeringProperties{ + PeerAsn: to.Ptr[int64](20000), + PeerIP: to.Ptr("192.168.1.5"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualRouterPeeringsClientCreateOrUpdateResponse{ + // VirtualRouterPeering: armnetwork.VirtualRouterPeering{ + // Name: to.Ptr("peering1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // Properties: &armnetwork.VirtualRouterPeeringProperties{ + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeeringGet.json -func ExampleVirtualRouterPeeringsClient_Get() { +// Generated from example definition: 2025-07-01/VirtualRouterPeeringDelete.json +func ExampleVirtualRouterPeeringsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualRouterPeeringsClient().Get(ctx, "rg1", "virtualRouter", "peering1", nil) + poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginDelete(ctx, "rg1", "virtualRouter", "peering1", 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 poll 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.VirtualRouterPeering = armnetwork.VirtualRouterPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, + // res = armnetwork.VirtualRouterPeeringsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeeringPut.json -func ExampleVirtualRouterPeeringsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualRouterPeeringGet.json +func ExampleVirtualRouterPeeringsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", "peering1", armnetwork.VirtualRouterPeering{ - Properties: &armnetwork.VirtualRouterPeeringProperties{ - PeerAsn: to.Ptr[int64](20000), - PeerIP: to.Ptr("192.168.1.5"), - }, - }, nil) + res, err := clientFactory.NewVirtualRouterPeeringsClient().Get(ctx, "rg1", "virtualRouter", "peering1", 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.VirtualRouterPeering = armnetwork.VirtualRouterPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VirtualRouterPeeringsClientGetResponse{ + // VirtualRouterPeering: armnetwork.VirtualRouterPeering{ + // Name: to.Ptr("peering1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // Properties: &armnetwork.VirtualRouterPeeringProperties{ + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPeeringList.json +// Generated from example definition: 2025-07-01/VirtualRouterPeeringList.json func ExampleVirtualRouterPeeringsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -127,18 +133,21 @@ func ExampleVirtualRouterPeeringsClient_NewListPager() { _ = 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.VirtualRouterPeeringListResult = armnetwork.VirtualRouterPeeringListResult{ - // Value: []*armnetwork.VirtualRouterPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.VirtualRouterPeeringsClientListResponse{ + // VirtualRouterPeeringListResult: armnetwork.VirtualRouterPeeringListResult{ + // Value: []*armnetwork.VirtualRouterPeering{ + // { + // Name: to.Ptr("peering1"), + // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // Properties: &armnetwork.VirtualRouterPeeringProperties{ + // PeerAsn: to.Ptr[int64](20000), + // PeerIP: to.Ptr("192.168.1.5"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go index 07a3a196af17..67fe5d062585 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualRoutersClient contains the methods for the VirtualRouters group. // Don't use this type directly, use NewVirtualRoutersClient() instead. +// +// Generated from API version 2025-07-01 type VirtualRoutersClient struct { internal *arm.Client subscriptionID string } // NewVirtualRoutersClient creates a new instance of VirtualRoutersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualRoutersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRoutersClient, error) { @@ -43,9 +43,7 @@ func NewVirtualRoutersClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. // - parameters - Parameters supplied to the create or update Virtual Router. // - options - VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *VirtualRoutersClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRoutersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VirtualRoutersClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualRoutersClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginCreateOrUpdate" @@ -96,6 +91,10 @@ func (client *VirtualRoutersClient) createOrUpdate(ctx context.Context, resource // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, _ *VirtualRoutersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,18 +103,15 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter virtualRouterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete // method. @@ -137,8 +131,7 @@ func (client *VirtualRoutersClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRoutersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +143,6 @@ func (client *VirtualRoutersClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginDelete" @@ -176,6 +167,10 @@ func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, _ *VirtualRoutersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -184,26 +179,19 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter virtualRouterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. func (client *VirtualRoutersClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (VirtualRoutersClientGetResponse, error) { @@ -231,6 +219,10 @@ func (client *VirtualRoutersClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,10 +231,6 @@ func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter virtualRouterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -251,8 +239,8 @@ func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -267,8 +255,6 @@ func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (Virt } // NewListPager - Gets all the Virtual Routers in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.NewListPager method. func (client *VirtualRoutersClient) NewListPager(options *VirtualRoutersClientListOptions) *runtime.Pager[VirtualRoutersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListResponse]{ @@ -305,8 +291,8 @@ func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, _ *Vi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -321,9 +307,7 @@ func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (Vir } // NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager // method. func (client *VirtualRoutersClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) *runtime.Pager[VirtualRoutersClientListByResourceGroupResponse] { @@ -352,21 +336,21 @@ func (client *VirtualRoutersClient) NewListByResourceGroupPager(resourceGroupNam // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualRoutersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go index 483ded6a2eeb..15a0236f76ca 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go @@ -1,155 +1,165 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterDelete.json -func ExampleVirtualRoutersClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualRouterPut.json +func ExampleVirtualRoutersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualRoutersClient().BeginDelete(ctx, "rg1", "virtualRouter", nil) + poller, err := clientFactory.NewVirtualRoutersClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", armnetwork.VirtualRouter{ + Location: to.Ptr("West US"), + Properties: &armnetwork.VirtualRouterPropertiesFormat{ + HostedGateway: &armnetwork.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VirtualRoutersClientCreateOrUpdateResponse{ + // VirtualRouter: armnetwork.VirtualRouter{ + // Name: to.Ptr("virtualRouter"), + // Type: to.Ptr("Microsoft.Network/virtualRouters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualRouterPropertiesFormat{ + // HostedGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // }, + // Peerings: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualRouterAsn: to.Ptr[int64](10000), + // VirtualRouterIPs: []*string{ + // to.Ptr("192.168.1.1"), + // to.Ptr("192.168.1.2"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterGet.json -func ExampleVirtualRoutersClient_Get() { +// Generated from example definition: 2025-07-01/VirtualRouterDelete.json +func ExampleVirtualRoutersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualRoutersClient().Get(ctx, "rg1", "virtualRouter", &armnetwork.VirtualRoutersClientGetOptions{Expand: nil}) + poller, err := clientFactory.NewVirtualRoutersClient().BeginDelete(ctx, "rg1", "virtualRouter", 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 poll 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.VirtualRouter = armnetwork.VirtualRouter{ - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // }, - // } + // res = armnetwork.VirtualRoutersClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterPut.json -func ExampleVirtualRoutersClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-07-01/VirtualRouterGet.json +func ExampleVirtualRoutersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualRoutersClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", armnetwork.VirtualRouter{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualRouterPropertiesFormat{ - HostedGateway: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - }, - }, - }, nil) + res, err := clientFactory.NewVirtualRoutersClient().Get(ctx, "rg1", "virtualRouter", 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.VirtualRouter = armnetwork.VirtualRouter{ - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // res = armnetwork.VirtualRoutersClientGetResponse{ + // VirtualRouter: armnetwork.VirtualRouter{ + // Name: to.Ptr("virtualRouter"), + // Type: to.Ptr("Microsoft.Network/virtualRouters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualRouterPropertiesFormat{ + // HostedGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // }, + // Peerings: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualRouterAsn: to.Ptr[int64](10000), + // VirtualRouterIPs: []*string{ + // to.Ptr("192.168.1.1"), + // to.Ptr("192.168.1.2"), + // }, // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterListByResourceGroup.json -func ExampleVirtualRoutersClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VirtualRouterListBySubscription.json +func ExampleVirtualRoutersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualRoutersClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewVirtualRoutersClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -160,48 +170,53 @@ func ExampleVirtualRoutersClient_NewListByResourceGroupPager() { _ = 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.VirtualRouterListResult = armnetwork.VirtualRouterListResult{ - // Value: []*armnetwork.VirtualRouter{ - // { - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // page = armnetwork.VirtualRoutersClientListResponse{ + // VirtualRouterListResult: armnetwork.VirtualRouterListResult{ + // Value: []*armnetwork.VirtualRouter{ + // { + // Name: to.Ptr("virtualRouter"), + // Type: to.Ptr("Microsoft.Network/virtualRouters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualRouterPropertiesFormat{ + // HostedGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // }, + // Peerings: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualRouterAsn: to.Ptr[int64](10000), + // VirtualRouterIPs: []*string{ + // to.Ptr("192.168.1.1"), + // to.Ptr("192.168.1.2"), + // }, // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // }}, - // } + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualRouterListBySubscription.json -func ExampleVirtualRoutersClient_NewListPager() { +// Generated from example definition: 2025-07-01/VirtualRouterListByResourceGroup.json +func ExampleVirtualRoutersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualRoutersClient().NewListPager(nil) + pager := clientFactory.NewVirtualRoutersClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -212,32 +227,37 @@ func ExampleVirtualRoutersClient_NewListPager() { _ = 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.VirtualRouterListResult = armnetwork.VirtualRouterListResult{ - // Value: []*armnetwork.VirtualRouter{ - // { - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // page = armnetwork.VirtualRoutersClientListByResourceGroupResponse{ + // VirtualRouterListResult: armnetwork.VirtualRouterListResult{ + // Value: []*armnetwork.VirtualRouter{ + // { + // Name: to.Ptr("virtualRouter"), + // Type: to.Ptr("Microsoft.Network/virtualRouters"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualRouterPropertiesFormat{ + // HostedGateway: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), + // }, + // Peerings: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualRouterAsn: to.Ptr[int64](10000), + // VirtualRouterIPs: []*string{ + // to.Ptr("192.168.1.1"), + // to.Ptr("192.168.1.2"), + // }, // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // }}, - // } + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go index a76220a5e72d..0fc252406a1b 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go index e2ff0ff99901..8fe560f3e10a 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VirtualWansClient contains the methods for the VirtualWans group. // Don't use this type directly, use NewVirtualWansClient() instead. +// +// Generated from API version 2025-07-01 type VirtualWansClient struct { internal *arm.Client subscriptionID string } // NewVirtualWansClient creates a new instance of VirtualWansClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualWansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualWansClient, error) { @@ -43,10 +43,8 @@ func NewVirtualWansClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualWan. -// - virtualWANName - The name of the VirtualWAN being created or updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN being retrieved. // - wanParameters - Parameters supplied to create or update VirtualWAN. // - options - VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate // method. @@ -57,8 +55,7 @@ func (client *VirtualWansClient) BeginCreateOrUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualWansClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VirtualWansClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualWansClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { return nil, err } @@ -124,10 +120,8 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualWan. -// - virtualWANName - The name of the VirtualWAN being deleted. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN being retrieved. // - options - VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*runtime.Poller[VirtualWansClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -136,8 +130,7 @@ func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualWansClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginDelete" @@ -192,17 +183,14 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualWan. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualWANName - The name of the VirtualWAN being retrieved. // - options - VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. func (client *VirtualWansClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientGetOptions) (VirtualWansClientGetResponse, error) { @@ -230,6 +218,10 @@ func (client *VirtualWansClient) Get(ctx context.Context, resourceGroupName stri // getCreateRequest creates the Get request. func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, _ *VirtualWansClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,17 +230,13 @@ func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter virtualWANName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -263,8 +251,6 @@ func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (Virtual } // NewListPager - Lists all the VirtualWANs in a subscription. -// -// Generated from API version 2025-05-01 // - options - VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.NewListPager method. func (client *VirtualWansClient) NewListPager(options *VirtualWansClientListOptions) *runtime.Pager[VirtualWansClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListResponse]{ @@ -301,8 +287,8 @@ func (client *VirtualWansClient) listCreateRequest(ctx context.Context, _ *Virtu return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -317,9 +303,7 @@ func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (Virtua } // NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualWan. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager // method. func (client *VirtualWansClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) *runtime.Pager[VirtualWansClientListByResourceGroupResponse] { @@ -361,8 +345,8 @@ func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -378,10 +362,8 @@ func (client *VirtualWansClient) listByResourceGroupHandleResponse(resp *http.Re // UpdateTags - Updates a VirtualWAN tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VirtualWan. -// - virtualWANName - The name of the VirtualWAN being updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN being retrieved. // - wanParameters - Parameters supplied to Update VirtualWAN tags. // - options - VirtualWansClientUpdateTagsOptions contains the optional parameters for the VirtualWansClient.UpdateTags method. func (client *VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (VirtualWansClientUpdateTagsResponse, error) { @@ -426,9 +408,10 @@ func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go index b575ca3f6bb4..960697b7691d 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go @@ -1,215 +1,174 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANGet.json -func ExampleVirtualWansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualWansClient().Get(ctx, "rg1", "wan1", 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.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANPut.json +// Generated from example definition: 2025-07-01/VirtualWANPut.json func ExampleVirtualWansClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualWansClient().BeginCreateOrUpdate(ctx, "rg1", "wan1", armnetwork.VirtualWAN{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.VirtualWanProperties{ Type: to.Ptr("Basic"), DisableVPNEncryption: to.Ptr(false), }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // res = armnetwork.VirtualWansClientCreateOrUpdateResponse{ + // VirtualWAN: armnetwork.VirtualWAN{ + // Name: to.Ptr("wan1"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANUpdateTags.json -func ExampleVirtualWansClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VirtualWANDelete.json +func ExampleVirtualWansClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualWansClient().UpdateTags(ctx, "rg1", "wan1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewVirtualWansClient().BeginDelete(ctx, "rg1", "virtualWan1", 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 poll 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.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, + // res = armnetwork.VirtualWansClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANDelete.json -func ExampleVirtualWansClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VirtualWANGet.json +func ExampleVirtualWansClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVirtualWansClient().BeginDelete(ctx, "rg1", "virtualWan1", nil) + res, err := clientFactory.NewVirtualWansClient().Get(ctx, "rg1", "wan1", 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) - } + // 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 = armnetwork.VirtualWansClientGetResponse{ + // VirtualWAN: armnetwork.VirtualWAN{ + // Name: to.Ptr("wan1"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), + // }, + // }, + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANListByResourceGroup.json -func ExampleVirtualWansClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VirtualWANList.json +func ExampleVirtualWansClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualWansClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewVirtualWansClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -220,82 +179,89 @@ func ExampleVirtualWansClient_NewListByResourceGroupPager() { _ = 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.ListVirtualWANsResult = armnetwork.ListVirtualWANsResult{ - // Value: []*armnetwork.VirtualWAN{ - // { - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // page = armnetwork.VirtualWansClientListResponse{ + // ListVirtualWANsResult: armnetwork.ListVirtualWANsResult{ + // Value: []*armnetwork.VirtualWAN{ + // { + // Name: to.Ptr("wan1"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("wan2"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub3"), + // { + // Name: to.Ptr("wan2"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan2"), + // Location: to.Ptr("East US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub4"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite3"), + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite4"), - // }}, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VirtualWANList.json -func ExampleVirtualWansClient_NewListPager() { +// Generated from example definition: 2025-07-01/VirtualWANListByResourceGroup.json +func ExampleVirtualWansClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVirtualWansClient().NewListPager(nil) + pager := clientFactory.NewVirtualWansClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -306,66 +272,132 @@ func ExampleVirtualWansClient_NewListPager() { _ = 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.ListVirtualWANsResult = armnetwork.ListVirtualWANsResult{ - // Value: []*armnetwork.VirtualWAN{ - // { - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // page = armnetwork.VirtualWansClientListByResourceGroupResponse{ + // ListVirtualWANsResult: armnetwork.ListVirtualWANsResult{ + // Value: []*armnetwork.VirtualWAN{ + // { + // Name: to.Ptr("wan1"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("wan2"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub1"), + // { + // Name: to.Ptr("wan2"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan2"), + // Location: to.Ptr("East US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub3"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub4"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite1"), + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite3"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite4"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-07-01/VirtualWANUpdateTags.json +func ExampleVirtualWansClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualWansClient().UpdateTags(ctx, "rg1", "wan1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VirtualWansClientUpdateTagsResponse{ + // VirtualWAN: armnetwork.VirtualWAN{ + // Name: to.Ptr("wan1"), + // Type: to.Ptr("Microsoft.Network/virtualWANs"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VirtualWanProperties{ + // Type: to.Ptr("Basic"), + // DisableVPNEncryption: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHubs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), + // }, + // }, + // VPNSites: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go index 732c2779e197..bd8d3cca7937 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNConnectionsClient contains the methods for the VPNConnections group. // Don't use this type directly, use NewVPNConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VPNConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVPNConnectionsClient creates a new instance of VPNConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNConnectionsClient, error) { @@ -44,11 +44,9 @@ func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing // connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. -// - gatewayName - The name of the gateway. -// - connectionName - The name of the connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. +// - connectionName - The name of the vpn connection. // - vpnConnectionParameters - Parameters supplied to create or Update a VPN Connection. // - options - VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate // method. @@ -72,8 +70,6 @@ func (client *VPNConnectionsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginCreateOrUpdate" @@ -119,9 +115,10 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnConnectionParameters); err != nil { return nil, err } @@ -130,11 +127,9 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. -// - gatewayName - The name of the gateway. -// - connectionName - The name of the connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. +// - connectionName - The name of the vpn connection. // - options - VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete // method. func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*runtime.Poller[VPNConnectionsClientDeleteResponse], error) { @@ -144,8 +139,7 @@ func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -157,8 +151,6 @@ func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginDelete" @@ -204,18 +196,15 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - options - VPNConnectionsClientGetOptions contains the optional parameters for the VPNConnectionsClient.Get method. func (client *VPNConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (VPNConnectionsClientGetResponse, error) { @@ -264,8 +253,8 @@ func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -280,9 +269,7 @@ func (client *VPNConnectionsClient) getHandleResponse(resp *http.Response) (VPNC } // NewListByVPNGatewayPager - Retrieves all vpn connections for a particular virtual wan vpn gateway. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.NewListByVPNGatewayPager // method. @@ -329,8 +316,8 @@ func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -346,10 +333,8 @@ func (client *VPNConnectionsClient) listByVPNGatewayHandleResponse(resp *http.Re // BeginStartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - vpnConnectionName - The name of the vpn connection. // - options - VPNConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStartPacketCapture // method. @@ -360,8 +345,7 @@ func (client *VPNConnectionsClient) BeginStartPacketCapture(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -373,8 +357,6 @@ func (client *VPNConnectionsClient) BeginStartPacketCapture(ctx context.Context, // StartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginStartPacketCapture" @@ -399,6 +381,10 @@ func (client *VPNConnectionsClient) startPacketCapture(ctx context.Context, reso // startPacketCaptureCreateRequest creates the StartPacketCapture request. func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -411,19 +397,16 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. return nil, errors.New("parameter vpnConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -434,10 +417,8 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. // BeginStopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - vpnConnectionName - The name of the vpn connection. // - options - VPNConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStopPacketCapture // method. @@ -448,8 +429,7 @@ func (client *VPNConnectionsClient) BeginStopPacketCapture(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -461,8 +441,6 @@ func (client *VPNConnectionsClient) BeginStopPacketCapture(ctx context.Context, // StopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginStopPacketCapture" @@ -487,6 +465,10 @@ func (client *VPNConnectionsClient) stopPacketCapture(ctx context.Context, resou // stopPacketCaptureCreateRequest creates the StopPacketCapture request. func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -499,19 +481,16 @@ func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.C return nil, errors.New("parameter vpnConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go index bf335e6b254e..7fa3180d586e 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go @@ -1,171 +1,59 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionGet.json -func ExampleVPNConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNConnectionsClient().Get(ctx, "rg1", "gateway1", "vpnConnection1", 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.VPNConnection = armnetwork.VPNConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeResponderOnly), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeInitiatorOnly), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionPut.json +// Generated from example definition: 2025-07-01/VpnConnectionPut.json func ExampleVPNConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVPNConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "vpnConnection1", armnetwork.VPNConnection{ Properties: &armnetwork.VPNConnectionProperties{ RemoteVPNSite: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), }, RoutingConfiguration: &armnetwork.RoutingConfiguration{ AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), }, InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), }, OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), }, PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ IDs: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + }, + }, Labels: []*string{ to.Ptr("label1"), - to.Ptr("label2")}, + to.Ptr("label2"), + }, }, }, TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{}, @@ -179,10 +67,11 @@ func ExampleVPNConnectionsClient_BeginCreateOrUpdate() { VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), VPNSiteLink: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), }, }, - }}, + }, + }, }, }, nil) if err != nil { @@ -190,57 +79,60 @@ func ExampleVPNConnectionsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VPNConnection = armnetwork.VPNConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // res = armnetwork.VPNConnectionsClientCreateOrUpdateResponse{ + // VPNConnection: armnetwork.VPNConnection{ + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, // }, // }, // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ // }, // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), // Name: to.Ptr("Connection-Link1"), // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ // ConnectionBandwidth: to.Ptr[int32](200), // EgressBytesTransferred: to.Ptr[int64](0), @@ -256,22 +148,24 @@ func ExampleVPNConnectionsClient_BeginCreateOrUpdate() { // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), // }, // }, - // }}, + // }, + // }, // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionDelete.json +// Generated from example definition: 2025-07-01/VpnConnectionDelete.json func ExampleVPNConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -279,127 +173,355 @@ func ExampleVPNConnectionsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VPNConnectionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionStartPacketCaptureFilterData.json -func ExampleVPNConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVpnConnectionWithFilter() { +// Generated from example definition: 2025-07-01/VpnConnectionGet.json +func ExampleVPNConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ - FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), - LinkConnectionNames: []*string{ - to.Ptr("siteLink1"), - to.Ptr("siteLink2")}, - }, - }) + res, err := clientFactory.NewVPNConnectionsClient().Get(ctx, "rg1", "gateway1", "vpnConnection1", 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNConnectionsClientGetResponse{ + // VPNConnection: armnetwork.VPNConnection{ + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // }, + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeResponderOnly), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Connection-Link2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeInitiatorOnly), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), + // }, + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionStartPacketCapture.json +// Generated from example definition: 2025-07-01/VpnConnectionList.json +func ExampleVPNConnectionsClient_NewListByVPNGatewayPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVPNConnectionsClient().NewListByVPNGatewayPager("rg1", "gateway1", 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 = armnetwork.VPNConnectionsClientListByVPNGatewayResponse{ + // ListVPNConnectionsResult: armnetwork.ListVPNConnectionsResult{ + // Value: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // InboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), + // }, + // OutboundRouteMap: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // }, + // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Connection-Link2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VpnConnectionStartPacketCapture.json func ExampleVPNConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVpnConnectionWithoutFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ - LinkConnectionNames: []*string{ - to.Ptr("siteLink1"), - to.Ptr("siteLink2")}, - }, - }) + poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{ + Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ + LinkConnectionNames: []*string{ + to.Ptr("siteLink1"), + to.Ptr("siteLink2"), + }, + }}) 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNConnectionsClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionStopPacketCapture.json -func ExampleVPNConnectionsClient_BeginStopPacketCapture() { +// Generated from example definition: 2025-07-01/VpnConnectionStartPacketCaptureFilterData.json +func ExampleVPNConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVpnConnectionWithFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStopPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStopParameters{ - LinkConnectionNames: []*string{ - to.Ptr("vpnSiteLink1"), - to.Ptr("vpnSiteLink2")}, - SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), - }, - }) + poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{ + Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ + FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + LinkConnectionNames: []*string{ + to.Ptr("siteLink1"), + to.Ptr("siteLink2"), + }, + }}) 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNConnectionsClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnConnectionList.json -func ExampleVPNConnectionsClient_NewListByVPNGatewayPager() { +// Generated from example definition: 2025-07-01/VpnConnectionStopPacketCapture.json +func ExampleVPNConnectionsClient_BeginStopPacketCapture() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNConnectionsClient().NewListByVPNGatewayPager("rg1", "gateway1", 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.ListVPNConnectionsResult = armnetwork.ListVPNConnectionsResult{ - // } + poller, err := clientFactory.NewVPNConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStopPacketCaptureOptions{ + Parameters: &armnetwork.VPNConnectionPacketCaptureStopParameters{ + LinkConnectionNames: []*string{ + to.Ptr("vpnSiteLink1"), + to.Ptr("vpnSiteLink2"), + }, + SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + }}) + 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 poll 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 = armnetwork.VPNConnectionsClientStopPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go index c3989f2871ef..4eb43bae3f53 100644 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNGatewaysClient contains the methods for the VPNGateways group. // Don't use this type directly, use NewVPNGatewaysClient() instead. +// +// Generated from API version 2025-07-01 type VPNGatewaysClient struct { internal *arm.Client subscriptionID string } // NewVPNGatewaysClient creates a new instance of VPNGatewaysClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNGatewaysClient, error) { @@ -43,9 +43,7 @@ func NewVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to create or Update a virtual wan vpn gateway. // - options - VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate @@ -57,8 +55,7 @@ func (client *VPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { return nil, err } @@ -124,9 +120,7 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*runtime.Poller[VPNGatewaysClientDeleteResponse], error) { @@ -136,8 +130,7 @@ func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginDelete" @@ -192,17 +183,14 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. func (client *VPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (VPNGatewaysClientGetResponse, error) { @@ -247,8 +235,8 @@ func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -263,8 +251,6 @@ func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGate } // NewListPager - Lists all the VpnGateways in a subscription. -// -// Generated from API version 2025-05-01 // - options - VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.NewListPager method. func (client *VPNGatewaysClient) NewListPager(options *VPNGatewaysClientListOptions) *runtime.Pager[VPNGatewaysClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListResponse]{ @@ -301,8 +287,8 @@ func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, _ *VPNGa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -317,9 +303,7 @@ func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGat } // NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager // method. func (client *VPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[VPNGatewaysClientListByResourceGroupResponse] { @@ -361,8 +345,8 @@ func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -378,9 +362,7 @@ func (client *VPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Re // BeginReset - Resets the primary of the vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*runtime.Poller[VPNGatewaysClientResetResponse], error) { @@ -390,8 +372,7 @@ func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -403,8 +384,6 @@ func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupNa // Reset - Resets the primary of the vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginReset" @@ -429,6 +408,10 @@ func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName st // resetCreateRequest creates the Reset request. func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -437,29 +420,23 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") + reqQP.Set("api-version", version20250701) if options != nil && options.IPConfigurationID != nil { reqQP.Set("ipConfigurationId", *options.IPConfigurationID) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginStartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture // method. @@ -470,8 +447,7 @@ func (client *VPNGatewaysClient) BeginStartPacketCapture(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -483,8 +459,6 @@ func (client *VPNGatewaysClient) BeginStartPacketCapture(ctx context.Context, re // StartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStartPacketCapture" @@ -509,6 +483,10 @@ func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourc // startPacketCaptureCreateRequest creates the StartPacketCapture request. func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -517,19 +495,16 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -540,9 +515,7 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con // BeginStopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture // method. @@ -553,8 +526,7 @@ func (client *VPNGatewaysClient) BeginStopPacketCapture(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -566,8 +538,6 @@ func (client *VPNGatewaysClient) BeginStopPacketCapture(ctx context.Context, res // StopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStopPacketCapture" @@ -592,6 +562,10 @@ func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resource // stopPacketCaptureCreateRequest creates the StopPacketCapture request. func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -600,19 +574,16 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont return nil, errors.New("parameter gatewayName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -623,9 +594,7 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont // BeginUpdateTags - Updates virtual wan vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to update a virtual wan vpn gateway tags. // - options - VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags @@ -637,8 +606,7 @@ func (client *VPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -650,8 +618,6 @@ func (client *VPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGr // UpdateTags - Updates virtual wan vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginUpdateTags" @@ -693,9 +659,10 @@ func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go index 809b8dd7a17f..2178e4551330 100644 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go @@ -1,246 +1,47 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayGet.json -func ExampleVPNGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNGatewaysClient().Get(ctx, "rg1", "gateway1", 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.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // Name: to.Ptr("nat04"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayPut.json +// Generated from example definition: 2025-07-01/VpnGatewayPut.json func ExampleVPNGatewaysClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", armnetwork.VPNGateway{ Location: to.Ptr("westcentralus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.VPNGatewayProperties{ BgpSettings: &armnetwork.BgpSettings{ Asn: to.Ptr[int64](65515), BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ { CustomBgpIPAddresses: []*string{ - to.Ptr("169.254.21.5")}, + to.Ptr("169.254.21.5"), + }, IPConfigurationID: to.Ptr("Instance0"), }, { CustomBgpIPAddresses: []*string{ - to.Ptr("169.254.21.10")}, + to.Ptr("169.254.21.10"), + }, IPConfigurationID: to.Ptr("Instance1"), - }}, + }, + }, PeerWeight: to.Ptr[int32](0), }, Connections: []*armnetwork.VPNConnection{ @@ -248,7 +49,7 @@ func ExampleVPNGatewaysClient_BeginCreateOrUpdate() { Name: to.Ptr("vpnConnection1"), Properties: &armnetwork.VPNConnectionProperties{ RemoteVPNSite: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), }, VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ { @@ -257,17 +58,20 @@ func ExampleVPNGatewaysClient_BeginCreateOrUpdate() { ConnectionBandwidth: to.Ptr[int32](200), EgressNatRules: []*armnetwork.SubResource{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - }}, + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + }, + }, SharedKey: to.Ptr("key"), VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), VPNSiteLink: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), }, }, - }}, + }, + }, }, - }}, + }, + }, EnableBgpRouteTranslationForNat: to.Ptr(false), IsRoutingPreferenceInternet: to.Ptr(false), NatRules: []*armnetwork.VPNGatewayNatRule{ @@ -278,1043 +82,1383 @@ func ExampleVPNGatewaysClient_BeginCreateOrUpdate() { ExternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("192.168.0.0/26"), - }}, + }, + }, InternalMappings: []*armnetwork.VPNNatRuleMapping{ { AddressSpace: to.Ptr("0.0.0.0/26"), - }}, + }, + }, IPConfigurationID: to.Ptr(""), Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), }, - }}, + }, + }, VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), }, }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, }, 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) + log.Fatalf("failed to poll 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.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, + // res = armnetwork.VPNGatewaysClientCreateOrUpdateResponse{ + // VPNGateway: armnetwork.VPNGateway{ + // Name: to.Ptr("gateway1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }}, - // }, - // }}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), // }, // }, - // } + // }, + // }, + // }, + // }, + // }, + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // { + // Name: to.Ptr("nat03"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayUpdateTags.json -func ExampleVPNGatewaysClient_BeginUpdateTags() { +// Generated from example definition: 2025-07-01/VpnGatewayDelete.json +func ExampleVPNGatewaysClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "gateway1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewVPNGatewaysClient().BeginDelete(ctx, "rg1", "gateway1", 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) + log.Fatalf("failed to poll 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.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, + // res = armnetwork.VPNGatewaysClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/VpnGatewayGet.json +func ExampleVPNGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVPNGatewaysClient().Get(ctx, "rg1", "gateway1", 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 = armnetwork.VPNGatewaysClientGetResponse{ + // VPNGateway: armnetwork.VPNGateway{ + // Name: to.Ptr("gateway1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, // }, + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IngressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // }, + // }, + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ + // }, + // { + // Name: to.Ptr("Connection-Link2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), // }, // }, - // } + // }, + // }, + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // { + // Name: to.Ptr("nat03"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), + // }, + // }, + // { + // Name: to.Ptr("nat04"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayDelete.json -func ExampleVPNGatewaysClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VpnGatewayList.json +func ExampleVPNGatewaysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginDelete(ctx, "rg1", "gateway1", nil) + pager := clientFactory.NewVPNGatewaysClient().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 = armnetwork.VPNGatewaysClientListResponse{ + // ListVPNGatewaysResult: armnetwork.ListVPNGatewaysResult{ + // Value: []*armnetwork.VPNGateway{ + // { + // Name: to.Ptr("gateway1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IngressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // }, + // }, + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Connection-Link2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // { + // Name: to.Ptr("nat03"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), + // }, + // }, + // { + // Name: to.Ptr("nat04"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("gateway2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), + // Properties: &armnetwork.VPNConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](100), + // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VpnGatewayListByResourceGroup.json +func ExampleVPNGatewaysClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.VPNGatewaysClientListByResourceGroupResponse{ + // ListVPNGatewaysResult: armnetwork.ListVPNGatewaysResult{ + // Value: []*armnetwork.VPNGateway{ + // { + // Name: to.Ptr("gateway1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableInternetSecurity: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("Connection-Link2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // EgressBytesTransferred: to.Ptr[int64](0), + // EgressNatRules: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // }, + // }, + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // { + // Name: to.Ptr("nat03"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), + // Properties: &armnetwork.VPNGatewayNatRuleProperties{ + // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), + // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), + // }, + // }, + // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("192.168.0.0/26"), + // }, + // }, + // InternalMappings: []*armnetwork.VPNNatRuleMapping{ + // { + // AddressSpace: to.Ptr("0.0.0.0/26"), + // }, + // }, + // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), + // }, + // }, + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("gateway2"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), + // Properties: &armnetwork.VPNConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](100), + // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayReset.json +// Generated from example definition: 2025-07-01/VpnGatewayReset.json func ExampleVPNGatewaysClient_BeginReset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginResetOptions{IPConfigurationID: nil}) + poller, err := clientFactory.NewVPNGatewaysClient().BeginReset(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, + // res = armnetwork.VPNGatewaysClientResetResponse{ + // VPNGateway: armnetwork.VPNGateway{ + // Name: to.Ptr("vpngw"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65514), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](100), + // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), // }, - // } + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayStartPacketCaptureFilterData.json -func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithFilter() { +// Generated from example definition: 2025-07-01/VpnGatewayStartPacketCapture.json +func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithoutFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNGatewayPacketCaptureStartParameters{ - FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), - }, - }) + poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNGatewaysClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayStartPacketCapture.json -func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithoutFilter() { +// Generated from example definition: 2025-07-01/VpnGatewayStartPacketCaptureFilterData.json +func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithFilter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) + poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{ + Parameters: &armnetwork.VPNGatewayPacketCaptureStartParameters{ + FilterData: to.Ptr("{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + }}) 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNGatewaysClientStartPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayStopPacketCapture.json +// Generated from example definition: 2025-07-01/VpnGatewayStopPacketCapture.json func ExampleVPNGatewaysClient_BeginStopPacketCapture() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStopPacketCaptureOptions{Parameters: &armnetwork.VPNGatewayPacketCaptureStopParameters{ - SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), - }, - }) + poller, err := clientFactory.NewVPNGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStopPacketCaptureOptions{ + Parameters: &armnetwork.VPNGatewayPacketCaptureStopParameters{ + SasURL: to.Ptr("https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + }}) 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) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" + // res = armnetwork.VPNGatewaysClientStopPacketCaptureResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayListByResourceGroup.json -func ExampleVPNGatewaysClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VpnGatewayUpdateTags.json +func ExampleVPNGatewaysClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNGatewaysResult = armnetwork.ListVPNGatewaysResult{ - // Value: []*armnetwork.VPNGateway{ - // { - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("gateway2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnGatewayList.json -func ExampleVPNGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "gateway1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNGatewaysClient().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.ListVPNGatewaysResult = armnetwork.ListVPNGatewaysResult{ - // Value: []*armnetwork.VPNGateway{ - // { - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // Name: to.Ptr("nat04"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("gateway2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.VPNGatewaysClientUpdateTagsResponse{ + // VPNGateway: armnetwork.VPNGateway{ + // Name: to.Ptr("gateway1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNGatewayProperties{ + // BgpSettings: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](65515), + // BgpPeeringAddress: to.Ptr("10.0.1.30"), + // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.5"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.4"), + // }, + // IPConfigurationID: to.Ptr("Instance0"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.178"), + // }, + // }, + // { + // CustomBgpIPAddresses: []*string{ + // to.Ptr("169.254.21.10"), + // }, + // DefaultBgpIPAddresses: []*string{ + // to.Ptr("10.30.0.5"), + // }, + // IPConfigurationID: to.Ptr("Instance1"), + // TunnelIPAddresses: []*string{ + // to.Ptr("104.208.48.179"), + // }, + // }, + // }, + // PeerWeight: to.Ptr[int32](0), + // }, + // Connections: []*armnetwork.VPNConnection{ + // { + // Name: to.Ptr("vpnConnection1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), + // Properties: &armnetwork.VPNConnectionProperties{ + // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RemoteVPNSite: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // }, + // RoutingConfiguration: &armnetwork.RoutingConfiguration{ + // AssociatedRouteTable: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ + // IDs: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), + // }, + // }, + // Labels: []*string{ + // to.Ptr("label1"), + // to.Ptr("label2"), + // }, + // }, + // VnetRoutes: &armnetwork.VnetRoute{ + // StaticRoutes: []*armnetwork.StaticRoute{ + // }, + // }, + // }, + // RoutingWeight: to.Ptr[int32](0), + // }, + // }, + // }, + // EnableBgpRouteTranslationForNat: to.Ptr(false), + // IsRoutingPreferenceInternet: to.Ptr(false), + // NatRules: []*armnetwork.VPNGatewayNatRule{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualHub: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go index 533c994add18..077e9b326b3d 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNLinkConnectionsClient contains the methods for the VPNLinkConnections group. // Don't use this type directly, use NewVPNLinkConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VPNLinkConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVPNLinkConnectionsClient creates a new instance of VPNLinkConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNLinkConnectionsClient, error) { @@ -42,10 +42,8 @@ func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenC } // NewGetAllSharedKeysPager - Lists all shared keys of VpnLink connection specified. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - options - VPNLinkConnectionsClientGetAllSharedKeysOptions contains the optional parameters for the VPNLinkConnectionsClient.NewGetAllSharedKeysPager @@ -101,8 +99,8 @@ func (client *VPNLinkConnectionsClient) getAllSharedKeysCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -118,10 +116,8 @@ func (client *VPNLinkConnectionsClient) getAllSharedKeysHandleResponse(resp *htt // GetDefaultSharedKey - Gets the shared key of VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - options - VPNLinkConnectionsClientGetDefaultSharedKeyOptions contains the optional parameters for the VPNLinkConnectionsClient.GetDefaultSharedKey @@ -176,8 +172,8 @@ func (client *VPNLinkConnectionsClient) getDefaultSharedKeyCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -193,10 +189,8 @@ func (client *VPNLinkConnectionsClient) getDefaultSharedKeyHandleResponse(resp * // BeginGetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - options - VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas @@ -208,8 +202,7 @@ func (client *VPNLinkConnectionsClient) BeginGetIkeSas(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNLinkConnectionsClientGetIkeSasResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -221,8 +214,6 @@ func (client *VPNLinkConnectionsClient) BeginGetIkeSas(ctx context.Context, reso // GetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNLinkConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginGetIkeSas" @@ -272,16 +263,14 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByVPNConnectionPager - Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the vpn gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. // - options - VPNLinkConnectionsClientListByVPNConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.NewListByVPNConnectionPager @@ -333,8 +322,8 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -350,10 +339,8 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionHandleResponse(resp * // ListDefaultSharedKey - Gets the value of the shared key of VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - options - VPNLinkConnectionsClientListDefaultSharedKeyOptions contains the optional parameters for the VPNLinkConnectionsClient.ListDefaultSharedKey @@ -408,8 +395,8 @@ func (client *VPNLinkConnectionsClient) listDefaultSharedKeyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -425,10 +412,8 @@ func (client *VPNLinkConnectionsClient) listDefaultSharedKeyHandleResponse(resp // BeginResetConnection - Resets the VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - options - VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection @@ -440,8 +425,7 @@ func (client *VPNLinkConnectionsClient) BeginResetConnection(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNLinkConnectionsClientResetConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -453,8 +437,6 @@ func (client *VPNLinkConnectionsClient) BeginResetConnection(ctx context.Context // ResetConnection - Resets the VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNLinkConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginResetConnection" @@ -504,21 +486,17 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // BeginSetOrInitDefaultSharedKey - Sets or auto generates the shared key based on the user input. If users give a shared -// key value, it does the set operation. If key length is given, the operation creates a random key of the -// pre-defined length. +// key value, it does the set operation. If key length is given, the operation creates a random key of the pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. -// - gatewayName - The name of the gateway. -// - connectionName - The name of the connection. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. +// - connectionName - The name of the vpn connection. // - linkConnectionName - The name of the vpn link connection. // - connectionSharedKeyParameters - Parameters supplied to set or auto generate the shared key for the vpn link connection. // - options - VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey @@ -530,8 +508,7 @@ func (client *VPNLinkConnectionsClient) BeginSetOrInitDefaultSharedKey(ctx conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNLinkConnectionsClientSetOrInitDefaultSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -542,11 +519,8 @@ func (client *VPNLinkConnectionsClient) BeginSetOrInitDefaultSharedKey(ctx conte } // SetOrInitDefaultSharedKey - Sets or auto generates the shared key based on the user input. If users give a shared key value, -// it does the set operation. If key length is given, the operation creates a random key of the -// pre-defined length. +// it does the set operation. If key length is given, the operation creates a random key of the pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKey(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, connectionSharedKeyParameters ConnectionSharedKeyResult, options *VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey" @@ -596,9 +570,10 @@ func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKeyCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectionSharedKeyParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go index 634642b6f566..b0c74513c739 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go @@ -1,49 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionReset.json -func ExampleVPNLinkConnectionsClient_BeginResetConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginResetConnection(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", 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/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionSharedKeysGet.json +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionSharedKeysGet.json func ExampleVPNLinkConnectionsClient_NewGetAllSharedKeysPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -58,28 +34,31 @@ func ExampleVPNLinkConnectionsClient_NewGetAllSharedKeysPager() { _ = 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.ConnectionSharedKeyResultList = armnetwork.ConnectionSharedKeyResultList{ - // Value: []*armnetwork.ConnectionSharedKeyResult{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](16), + // page = armnetwork.VPNLinkConnectionsClientGetAllSharedKeysResponse{ + // ConnectionSharedKeyResultList: armnetwork.ConnectionSharedKeyResultList{ + // Value: []*armnetwork.ConnectionSharedKeyResult{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), + // Properties: &armnetwork.SharedKeyProperties{ + // SharedKeyLength: to.Ptr[int32](16), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyGet.json +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionDefaultSharedKeyGet.json func ExampleVPNLinkConnectionsClient_GetDefaultSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -90,60 +69,118 @@ func ExampleVPNLinkConnectionsClient_GetDefaultSharedKey() { // 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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](16), + // res = armnetwork.VPNLinkConnectionsClientGetDefaultSharedKeyResponse{ + // ConnectionSharedKeyResult: armnetwork.ConnectionSharedKeyResult{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), + // Properties: &armnetwork.SharedKeyProperties{ + // SharedKeyLength: to.Ptr[int32](16), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyPut.json -func ExampleVPNLinkConnectionsClient_BeginSetOrInitDefaultSharedKey() { +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionGetIkeSas.json +func ExampleVPNLinkConnectionsClient_BeginGetIkeSas() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginSetOrInitDefaultSharedKey(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", armnetwork.ConnectionSharedKeyResult{ - Properties: &armnetwork.SharedKeyProperties{ - SharedKey: to.Ptr("ABCDEF123456"), - }, - }, nil) + poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginGetIkeSas(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", 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) + log.Fatalf("failed to poll 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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](12), - // }, + // res = armnetwork.VPNLinkConnectionsClientGetIkeSasResponse{ + // Value: to.Ptr("\"{\"Status\":\"Successful\",\"Data\":null}\""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyList.json +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionList.json +func ExampleVPNLinkConnectionsClient_NewListByVPNConnectionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVPNLinkConnectionsClient().NewListByVPNConnectionPager("rg1", "gateway1", "vpnConnection1", 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 = armnetwork.VPNLinkConnectionsClientListByVPNConnectionResponse{ + // ListVPNSiteLinkConnectionsResult: armnetwork.ListVPNSiteLinkConnectionsResult{ + // Value: []*armnetwork.VPNSiteLinkConnection{ + // { + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // DpdTimeoutSeconds: to.Ptr[int32](0), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNGatewayCustomBgpAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.1"), + // IPConfigurationID: to.Ptr("Instance0"), + // }, + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.3"), + // IPConfigurationID: to.Ptr("Instance1"), + // }, + // }, + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionDefaultSharedKeyList.json func ExampleVPNLinkConnectionsClient_ListDefaultSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -154,65 +191,74 @@ func ExampleVPNLinkConnectionsClient_ListDefaultSharedKey() { // 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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKey: to.Ptr("AzureAbc1234"), - // SharedKeyLength: to.Ptr[int32](12), + // res = armnetwork.VPNLinkConnectionsClientListDefaultSharedKeyResponse{ + // ConnectionSharedKeyResult: armnetwork.ConnectionSharedKeyResult{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), + // Properties: &armnetwork.SharedKeyProperties{ + // SharedKey: to.Ptr("AzureAbc1234"), + // SharedKeyLength: to.Ptr[int32](12), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionGetIkeSas.json -func ExampleVPNLinkConnectionsClient_BeginGetIkeSas() { +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionReset.json +func ExampleVPNLinkConnectionsClient_BeginResetConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginGetIkeSas(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) + poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginResetConnection(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionList.json -func ExampleVPNLinkConnectionsClient_NewListByVPNConnectionPager() { +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionDefaultSharedKeyPut.json +func ExampleVPNLinkConnectionsClient_BeginSetOrInitDefaultSharedKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNLinkConnectionsClient().NewListByVPNConnectionPager("rg1", "gateway1", "vpnConnection1", 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.ListVPNSiteLinkConnectionsResult = armnetwork.ListVPNSiteLinkConnectionsResult{ - // } + poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginSetOrInitDefaultSharedKey(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", armnetwork.ConnectionSharedKeyResult{ + Properties: &armnetwork.SharedKeyProperties{ + SharedKey: to.Ptr("ABCDEF123456"), + }, + }, 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 poll 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 = armnetwork.VPNLinkConnectionsClientSetOrInitDefaultSharedKeyResponse{ + // ConnectionSharedKeyResult: armnetwork.ConnectionSharedKeyResult{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), + // Properties: &armnetwork.SharedKeyProperties{ + // SharedKeyLength: to.Ptr[int32](12), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go index 61d82b1dfa6e..a5c569a9a8c6 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNServerConfigurationsClient contains the methods for the VPNServerConfigurations group. // Don't use this type directly, use NewVPNServerConfigurationsClient() instead. +// +// Generated from API version 2025-07-01 type VPNServerConfigurationsClient struct { internal *arm.Client subscriptionID string } // NewVPNServerConfigurationsClient creates a new instance of VPNServerConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNServerConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsClient, error) { @@ -43,10 +43,9 @@ func NewVPNServerConfigurationsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration being created or updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - vpnServerConfigurationParameters - Parameters supplied to create or update VpnServerConfiguration. // - options - VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate // method. @@ -57,8 +56,7 @@ func (client *VPNServerConfigurationsClient) BeginCreateOrUpdate(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +68,6 @@ func (client *VPNServerConfigurationsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNServerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginCreateOrUpdate" @@ -113,9 +109,10 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { return nil, err } @@ -124,10 +121,9 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration being deleted. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete // method. func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*runtime.Poller[VPNServerConfigurationsClientDeleteResponse], error) { @@ -137,8 +133,7 @@ func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,8 +145,6 @@ func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginDelete" @@ -193,18 +186,16 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration being retrieved. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get // method. func (client *VPNServerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (VPNServerConfigurationsClientGetResponse, error) { @@ -249,8 +240,8 @@ func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -265,8 +256,6 @@ func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Respon } // NewListPager - Lists all the VpnServerConfigurations in a subscription. -// -// Generated from API version 2025-05-01 // - options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager // method. func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { @@ -304,8 +293,8 @@ func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -320,9 +309,7 @@ func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Respo } // NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager // method. func (client *VPNServerConfigurationsClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) *runtime.Pager[VPNServerConfigurationsClientListByResourceGroupResponse] { @@ -364,8 +351,8 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -381,10 +368,9 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(r // ListRadiusSecrets - List all Radius servers with respective radius secrets from VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - options - VPNServerConfigurationsClientListRadiusSecretsOptions contains the optional parameters for the VPNServerConfigurationsClient.ListRadiusSecrets // method. func (client *VPNServerConfigurationsClient) ListRadiusSecrets(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientListRadiusSecretsOptions) (VPNServerConfigurationsClientListRadiusSecretsResponse, error) { @@ -412,6 +398,10 @@ func (client *VPNServerConfigurationsClient) ListRadiusSecrets(ctx context.Conte // listRadiusSecretsCreateRequest creates the ListRadiusSecrets request. func (client *VPNServerConfigurationsClient) listRadiusSecretsCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, _ *VPNServerConfigurationsClientListRadiusSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/listRadiusSecrets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -420,17 +410,13 @@ func (client *VPNServerConfigurationsClient) listRadiusSecretsCreateRequest(ctx return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -446,10 +432,9 @@ func (client *VPNServerConfigurationsClient) listRadiusSecretsHandleResponse(res // UpdateTags - Updates VpnServerConfiguration tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnServerConfiguration. -// - vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnServerConfigurationName - The name of the resource that is unique within a resource group. This name can be used to +// access the resource. // - vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. // - options - VPNServerConfigurationsClientUpdateTagsOptions contains the optional parameters for the VPNServerConfigurationsClient.UpdateTags // method. @@ -495,9 +480,10 @@ func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go index 5871e0a9e004..f9bb28898db5 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go @@ -1,151 +1,35 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationGet.json -func ExampleVPNServerConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNServerConfigurationsClient().Get(ctx, "rg1", "vpnServerConfiguration1", 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.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationPut.json +// Generated from example definition: 2025-07-01/VpnServerConfigurationPut.json func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginCreateOrUpdate(ctx, "rg1", "vpnServerConfiguration1", armnetwork.VPNServerConfiguration{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.VPNServerConfigurationProperties{ ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), Name: to.Ptr("policyGroup1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ IsDefault: to.Ptr(true), PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -153,13 +37,14 @@ func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { Name: to.Ptr("policy1"), AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), AttributeValue: to.Ptr("6ad1bd08"), - }}, + }, + }, Priority: to.Ptr[int32](0), }, }, { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), Name: to.Ptr("policyGroup2"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ IsDefault: to.Ptr(true), PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ @@ -167,26 +52,31 @@ func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { Name: to.Ptr("policy2"), AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), AttributeValue: to.Ptr("red.com"), - }}, + }, + }, Priority: to.Ptr[int32](0), }, - }}, + }, + }, RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ { Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - }}, + }, + }, RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ { Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - }}, + }, + }, RadiusServers: []*armnetwork.RadiusServer{ { RadiusServerAddress: to.Ptr("10.0.0.0"), RadiusServerScore: to.Ptr[int64](25), RadiusServerSecret: to.Ptr("radiusServerSecret"), - }}, + }, + }, VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ { DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), @@ -197,19 +87,26 @@ func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), SaDataSizeKilobytes: to.Ptr[int32](429497), SaLifeTimeSeconds: to.Ptr[int32](86472), - }}, + }, + }, VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ { Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - }}, + }, + }, VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ { Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - }}, + }, + }, VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), }, }, nil) if err != nil { @@ -217,76 +114,82 @@ func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.VPNServerConfigurationsClientCreateOrUpdateResponse{ + // VPNServerConfiguration: armnetwork.VPNServerConfiguration{ + // Name: to.Ptr("vpnServerConfiguration1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, + // }, + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), + // }, + // }, + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.0.0.0"), + // RadiusServerScore: to.Ptr[int64](25), + // }, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ // { // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), @@ -297,164 +200,193 @@ func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), // SaDataSizeKilobytes: to.Ptr[int32](429497), // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, + // }, + // }, // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, + // }, + // }, // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, + // }, + // }, // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), // }, - // } + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationUpdateTags.json -func ExampleVPNServerConfigurationsClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VpnServerConfigurationDelete.json +func ExampleVPNServerConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVPNServerConfigurationsClient().UpdateTags(ctx, "rg1", "vpnServerConfiguration1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginDelete(ctx, "rg1", "vpnServerConfiguration1", 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 poll 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.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // } + // res = armnetwork.VPNServerConfigurationsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationDelete.json -func ExampleVPNServerConfigurationsClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VpnServerConfigurationGet.json +func ExampleVPNServerConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginDelete(ctx, "rg1", "vpnServerConfiguration1", nil) + res, err := clientFactory.NewVPNServerConfigurationsClient().Get(ctx, "rg1", "vpnServerConfiguration1", 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) - } + // 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 = armnetwork.VPNServerConfigurationsClientGetResponse{ + // VPNServerConfiguration: armnetwork.VPNServerConfiguration{ + // Name: to.Ptr("vpnServerConfiguration1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), + // }, + // }, + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.0.0.0"), + // RadiusServerScore: to.Ptr[int64](25), + // }, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, + // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ + // { + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86472), + // }, + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), + // }, + // }, + // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationListByResourceGroup.json -func ExampleVPNServerConfigurationsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VpnServerConfigurationList.json +func ExampleVPNServerConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNServerConfigurationsClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewVPNServerConfigurationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -465,69 +397,74 @@ func ExampleVPNServerConfigurationsClient_NewListByResourceGroupPager() { _ = 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.ListVPNServerConfigurationsResult = armnetwork.ListVPNServerConfigurationsResult{ - // Value: []*armnetwork.VPNServerConfiguration{ - // { - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.VPNServerConfigurationsClientListResponse{ + // ListVPNServerConfigurationsResult: armnetwork.ListVPNServerConfigurationsResult{ + // Value: []*armnetwork.VPNServerConfiguration{ + // { + // Name: to.Ptr("vpnServerConfiguration1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RadiusServerAddress: to.Ptr("8.9.9.9"), + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ // { // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), @@ -538,123 +475,148 @@ func ExampleVPNServerConfigurationsClient_NewListByResourceGroupPager() { // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), // SaDataSizeKilobytes: to.Ptr[int32](429497), // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, + // }, + // }, // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, + // }, + // }, // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, + // }, + // }, // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), // }, // }, - // { - // Name: to.Ptr("vpnServerConfiguration2"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // { + // Name: to.Ptr("vpnServerConfiguration2"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), + // Location: to.Ptr("East US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // } + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), + // }, + // }, + // RadiusServers: []*armnetwork.RadiusServer{ + // { + // RadiusServerAddress: to.Ptr("10.0.0.0"), + // RadiusServerScore: to.Ptr[int64](25), + // }, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, + // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ + // { + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86472), + // }, + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), + // }, + // }, + // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnServerConfigurationList.json -func ExampleVPNServerConfigurationsClient_NewListPager() { +// Generated from example definition: 2025-07-01/VpnServerConfigurationListByResourceGroup.json +func ExampleVPNServerConfigurationsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNServerConfigurationsClient().NewListPager(nil) + pager := clientFactory.NewVPNServerConfigurationsClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -665,69 +627,74 @@ func ExampleVPNServerConfigurationsClient_NewListPager() { _ = 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.ListVPNServerConfigurationsResult = armnetwork.ListVPNServerConfigurationsResult{ - // Value: []*armnetwork.VPNServerConfiguration{ - // { - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // page = armnetwork.VPNServerConfigurationsClientListByResourceGroupResponse{ + // ListVPNServerConfigurationsResult: armnetwork.ListVPNServerConfigurationsResult{ + // Value: []*armnetwork.VPNServerConfiguration{ + // { + // Name: to.Ptr("vpnServerConfiguration1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), // }, // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RadiusServerAddress: to.Ptr("8.9.9.9"), + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ // { // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), @@ -738,123 +705,139 @@ func ExampleVPNServerConfigurationsClient_NewListPager() { // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), // SaDataSizeKilobytes: to.Ptr[int32](429497), // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, + // }, + // }, // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, + // }, + // }, // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ // { // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, + // }, + // }, // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), // }, // }, - // { - // Name: to.Ptr("vpnServerConfiguration2"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // { + // Name: to.Ptr("vpnServerConfiguration2"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, // }, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, + // Priority: to.Ptr[int32](0), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, - // } + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // RadiusServerAddress: to.Ptr("8.9.9.9"), + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), + // }, + // }, + // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ + // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate), + // }, + // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ + // { + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86472), + // }, + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), + // }, + // }, + // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AllVpnServerConfigurationRadiusServerSecretsList.json +// Generated from example definition: 2025-07-01/AllVpnServerConfigurationRadiusServerSecretsList.json func ExampleVPNServerConfigurationsClient_ListRadiusSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("72f988bf-86f1-41af-91ab-2d7cd011db47", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -865,15 +848,138 @@ func ExampleVPNServerConfigurationsClient_ListRadiusSecrets() { // 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.RadiusAuthServerListResult = armnetwork.RadiusAuthServerListResult{ - // Value: []*armnetwork.RadiusAuthServer{ - // { - // RadiusServerAddress: to.Ptr("1.1.1.1"), - // RadiusServerSecret: to.Ptr("abc1234"), + // res = armnetwork.VPNServerConfigurationsClientListRadiusSecretsResponse{ + // RadiusAuthServerListResult: armnetwork.RadiusAuthServerListResult{ + // Value: []*armnetwork.RadiusAuthServer{ + // { + // RadiusServerAddress: to.Ptr("1.1.1.1"), + // RadiusServerSecret: to.Ptr("*****"), + // }, + // { + // RadiusServerAddress: to.Ptr("2.2.2.2"), + // RadiusServerSecret: to.Ptr("*****"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/VpnServerConfigurationUpdateTags.json +func ExampleVPNServerConfigurationsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVPNServerConfigurationsClient().UpdateTags(ctx, "rg1", "vpnServerConfiguration1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VPNServerConfigurationsClientUpdateTagsResponse{ + // VPNServerConfiguration: armnetwork.VPNServerConfiguration{ + // Name: to.Ptr("vpnServerConfiguration1"), + // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNServerConfigurationProperties{ + // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ + // { + // Name: to.Ptr("policyGroup1"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // P2SConnectionConfigurations: []*armnetwork.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), + // }, + // }, + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy1"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), + // AttributeValue: to.Ptr("6ad1bd08"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // }, + // }, + // { + // Name: to.Ptr("policyGroup2"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), + // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ + // IsDefault: to.Ptr(true), + // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ + // { + // Name: to.Ptr("policy2"), + // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), + // AttributeValue: to.Ptr("red.com"), + // }, + // }, + // Priority: to.Ptr[int32](0), + // }, + // }, + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // RadiusServerAddress: to.Ptr("8.9.9.9"), + // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), + // }, + // }, + // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ + // { + // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), + // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), + // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), + // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), + // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), + // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), + // SaDataSizeKilobytes: to.Ptr[int32](429497), + // SaLifeTimeSeconds: to.Ptr[int32](86472), + // }, + // }, + // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), + // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), + // }, + // }, + // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ + // { + // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), + // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), + // }, + // }, + // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ + // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), // }, - // { - // RadiusServerAddress: to.Ptr("2.2.2.2"), - // RadiusServerSecret: to.Ptr("mnop12345"), - // }}, + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go index d13b5221a863..68c8212dcfbf 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -20,14 +19,15 @@ import ( // VPNServerConfigurationsAssociatedWithVirtualWanClient contains the methods for the VPNServerConfigurationsAssociatedWithVirtualWan // group. // Don't use this type directly, use NewVPNServerConfigurationsAssociatedWithVirtualWanClient() instead. +// +// Generated from API version 2025-07-01 type VPNServerConfigurationsAssociatedWithVirtualWanClient struct { internal *arm.Client subscriptionID string } // NewVPNServerConfigurationsAssociatedWithVirtualWanClient creates a new instance of VPNServerConfigurationsAssociatedWithVirtualWanClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsAssociatedWithVirtualWanClient, error) { @@ -44,10 +44,8 @@ func NewVPNServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID str // BeginList - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name. -// - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN. // - options - VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the // VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList method. func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*runtime.Poller[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse], error) { @@ -57,8 +55,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(c return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(c // List - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList" @@ -113,8 +108,8 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go index 1ede968d200e..9a440babe40d 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/GetVirtualWanVpnServerConfigurations.json +// Generated from example definition: 2025-07-01/GetVirtualWanVpnServerConfigurations.json func ExampleVPNServerConfigurationsAssociatedWithVirtualWanClient_BeginList() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -31,14 +28,17 @@ func ExampleVPNServerConfigurationsAssociatedWithVirtualWanClient_BeginList() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VPNServerConfigurationsResponse = armnetwork.VPNServerConfigurationsResponse{ - // VPNServerConfigurationResourceIDs: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig2")}, - // } + // res = armnetwork.VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse{ + // VPNServerConfigurationsResponse: armnetwork.VPNServerConfigurationsResponse{ + // VPNServerConfigurationResourceIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go index 3e71424f8990..3159435f17d3 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNSiteLinkConnectionsClient contains the methods for the VPNSiteLinkConnections group. // Don't use this type directly, use NewVPNSiteLinkConnectionsClient() instead. +// +// Generated from API version 2025-07-01 type VPNSiteLinkConnectionsClient struct { internal *arm.Client subscriptionID string } // NewVPNSiteLinkConnectionsClient creates a new instance of VPNSiteLinkConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNSiteLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinkConnectionsClient, error) { @@ -43,12 +43,10 @@ func NewVPNSiteLinkConnectionsClient(subscriptionID string, credential azcore.To // Get - Retrieves the details of a vpn site link connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnGateway. -// - gatewayName - The name of the gateway. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - gatewayName - The name of the vpn gateway. // - connectionName - The name of the vpn connection. -// - linkConnectionName - The name of the vpn connection. +// - linkConnectionName - The name of the vpn link connection. // - options - VPNSiteLinkConnectionsClientGetOptions contains the optional parameters for the VPNSiteLinkConnectionsClient.Get // method. func (client *VPNSiteLinkConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (VPNSiteLinkConnectionsClientGetResponse, error) { @@ -101,8 +99,8 @@ func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go index db794c4561eb..4c684f6d888b 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkConnectionGet.json +// Generated from example definition: 2025-07-01/VpnSiteLinkConnectionGet.json func ExampleVPNSiteLinkConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,36 +29,39 @@ func ExampleVPNSiteLinkConnectionsClient_Get() { // 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.VPNSiteLinkConnection = armnetwork.VPNSiteLinkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // DpdTimeoutSeconds: to.Ptr[int32](0), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNGatewayCustomBgpAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("Instance0"), + // res = armnetwork.VPNSiteLinkConnectionsClientGetResponse{ + // VPNSiteLinkConnection: armnetwork.VPNSiteLinkConnection{ + // Name: to.Ptr("Connection-Link1"), + // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), + // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ + // ConnectionBandwidth: to.Ptr[int32](200), + // DpdTimeoutSeconds: to.Ptr[int32](0), + // EgressBytesTransferred: to.Ptr[int64](0), + // EnableBgp: to.Ptr(false), + // EnableRateLimiting: to.Ptr(false), + // IngressBytesTransferred: to.Ptr[int64](0), + // IPSecPolicies: []*armnetwork.IPSecPolicy{ + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // RoutingWeight: to.Ptr[int32](0), + // UseLocalAzureIPAddress: to.Ptr(false), + // UsePolicyBasedTrafficSelectors: to.Ptr(false), + // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), + // VPNGatewayCustomBgpAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.1"), + // IPConfigurationID: to.Ptr("Instance0"), + // }, + // { + // CustomBgpIPAddress: to.Ptr("169.254.21.3"), + // IPConfigurationID: to.Ptr("Instance1"), + // }, + // }, + // VPNSiteLink: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("Instance1"), - // }}, - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), // }, // }, // } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go index 0acb3dd2853f..b3c6b2eb836f 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNSiteLinksClient contains the methods for the VPNSiteLinks group. // Don't use this type directly, use NewVPNSiteLinksClient() instead. +// +// Generated from API version 2025-07-01 type VPNSiteLinksClient struct { internal *arm.Client subscriptionID string } // NewVPNSiteLinksClient creates a new instance of VPNSiteLinksClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNSiteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinksClient, error) { @@ -43,11 +43,10 @@ func NewVPNSiteLinksClient(subscriptionID string, credential azcore.TokenCredent // Get - Retrieves the details of a VPN site link. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. -// - vpnSiteName - The name of the VpnSite. -// - vpnSiteLinkName - The name of the VpnSiteLink being retrieved. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnSiteName - The name of the VpnSite being retrieved. +// - vpnSiteLinkName - The name of the resource that is unique within a resource group. This name can be used to access the +// resource. // - options - VPNSiteLinksClientGetOptions contains the optional parameters for the VPNSiteLinksClient.Get method. func (client *VPNSiteLinksClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (VPNSiteLinksClientGetResponse, error) { var err error @@ -95,8 +94,8 @@ func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -111,10 +110,8 @@ func (client *VPNSiteLinksClient) getHandleResponse(resp *http.Response) (VPNSit } // NewListByVPNSitePager - Lists all the vpnSiteLinks in a resource group for a vpn site. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. -// - vpnSiteName - The name of the VpnSite. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnSiteName - The name of the VpnSite being retrieved. // - options - VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.NewListByVPNSitePager // method. func (client *VPNSiteLinksClient) NewListByVPNSitePager(resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) *runtime.Pager[VPNSiteLinksClientListByVPNSiteResponse] { @@ -160,8 +157,8 @@ func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go index cf7706249a8d..043a398f1068 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkGet.json +// Generated from example definition: 2025-07-01/VpnSiteLinkGet.json func ExampleVPNSiteLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,33 +29,35 @@ func ExampleVPNSiteLinksClient_Get() { // 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.VPNSiteLink = armnetwork.VPNSiteLink{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), + // res = armnetwork.VPNSiteLinksClientGetResponse{ + // VPNSiteLink: armnetwork.VPNSiteLink{ + // Name: to.Ptr("vpnSiteLink1"), + // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), + // Properties: &armnetwork.VPNSiteLinkProperties{ + // BgpProperties: &armnetwork.VPNLinkBgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // IPAddress: to.Ptr("50.50.50.56"), + // LinkProperties: &armnetwork.VPNLinkProviderProperties{ + // LinkSpeedInMbps: to.Ptr[int32](0), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteLinkListByVpnSite.json +// Generated from example definition: 2025-07-01/VpnSiteLinkListByVpnSite.json func ExampleVPNSiteLinksClient_NewListByVPNSitePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -73,42 +72,45 @@ func ExampleVPNSiteLinksClient_NewListByVPNSitePager() { _ = 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.ListVPNSiteLinksResult = armnetwork.ListVPNSiteLinksResult{ - // Value: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // page = armnetwork.VPNSiteLinksClientListByVPNSiteResponse{ + // ListVPNSiteLinksResult: armnetwork.ListVPNSiteLinksResult{ + // Value: []*armnetwork.VPNSiteLink{ + // { + // Name: to.Ptr("vpnSiteLink1"), + // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), + // Properties: &armnetwork.VPNSiteLinkProperties{ + // BgpProperties: &armnetwork.VPNLinkBgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // IPAddress: to.Ptr("50.50.50.56"), + // LinkProperties: &armnetwork.VPNLinkProviderProperties{ + // LinkSpeedInMbps: to.Ptr[int32](200), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink2"), - // Name: to.Ptr("vpnSiteLink2"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.1"), + // { + // Name: to.Ptr("vpnSiteLink2"), + // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink2"), + // Properties: &armnetwork.VPNSiteLinkProperties{ + // BgpProperties: &armnetwork.VPNLinkBgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.1"), + // }, + // IPAddress: to.Ptr("40.40.40.46"), + // LinkProperties: &armnetwork.VPNLinkProviderProperties{ + // LinkSpeedInMbps: to.Ptr[int32](200), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // IPAddress: to.Ptr("40.40.40.46"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsites_client.go b/sdk/resourcemanager/network/armnetwork/vpnsites_client.go index 937f17a749be..c00599c1df7d 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsites_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNSitesClient contains the methods for the VPNSites group. // Don't use this type directly, use NewVPNSitesClient() instead. +// +// Generated from API version 2025-07-01 type VPNSitesClient struct { internal *arm.Client subscriptionID string } // NewVPNSitesClient creates a new instance of VPNSitesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesClient, error) { @@ -43,10 +43,8 @@ func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. -// - vpnSiteName - The name of the VpnSite being created or updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnSiteName - The name of the VpnSite being retrieved. // - vpnSiteParameters - Parameters supplied to create or update VpnSite. // - options - VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate // method. @@ -57,8 +55,7 @@ func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginCreateOrUpdate" @@ -113,9 +108,10 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { return nil, err } @@ -124,10 +120,8 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a VpnSite. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. -// - vpnSiteName - The name of the VpnSite being deleted. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnSiteName - The name of the VpnSite being retrieved. // - options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*runtime.Poller[VPNSitesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -136,8 +130,7 @@ func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -149,8 +142,6 @@ func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a VpnSite. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginDelete" @@ -192,17 +183,14 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieves the details of a VPN site. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - vpnSiteName - The name of the VpnSite being retrieved. // - options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. func (client *VPNSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (VPNSitesClientGetResponse, error) { @@ -247,8 +235,8 @@ func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -263,8 +251,6 @@ func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesCl } // NewListPager - Lists all the VpnSites in a subscription. -// -// Generated from API version 2025-05-01 // - options - VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.NewListPager method. func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) *runtime.Pager[VPNSitesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListResponse]{ @@ -301,8 +287,8 @@ func (client *VPNSitesClient) listCreateRequest(ctx context.Context, _ *VPNSites return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -317,9 +303,7 @@ func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesC } // NewListByResourceGroupPager - Lists all the vpnSites in a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager // method. func (client *VPNSitesClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) *runtime.Pager[VPNSitesClientListByResourceGroupResponse] { @@ -361,8 +345,8 @@ func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -378,10 +362,8 @@ func (client *VPNSitesClient) listByResourceGroupHandleResponse(resp *http.Respo // UpdateTags - Updates VpnSite tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name of the VpnSite. -// - vpnSiteName - The name of the VpnSite being updated. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vpnSiteName - The name of the VpnSite being retrieved. // - vpnSiteParameters - Parameters supplied to update VpnSite tags. // - options - VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method. func (client *VPNSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (VPNSitesClientUpdateTagsResponse, error) { @@ -426,9 +408,10 @@ func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go index f23e56892ac0..b19af2df9fa5 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go @@ -1,103 +1,35 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteGet.json -func ExampleVPNSitesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSitesClient().Get(ctx, "rg1", "vpnSite1", 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.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // VPNSiteLinks: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkProviderName: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSitePut.json +// Generated from example definition: 2025-07-01/VpnSitePut.json func ExampleVPNSitesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVPNSitesClient().BeginCreateOrUpdate(ctx, "rg1", "vpnSite1", armnetwork.VPNSite{ Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, Properties: &armnetwork.VPNSiteProperties{ AddressSpace: &armnetwork.AddressSpace{ AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, + to.Ptr("10.0.0.0/16"), + }, }, IsSecuritySite: to.Ptr(false), O365Policy: &armnetwork.O365PolicyProperties{ @@ -108,7 +40,7 @@ func ExampleVPNSitesClient_BeginCreateOrUpdate() { }, }, VirtualWan: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), }, VPNSiteLinks: []*armnetwork.VPNSiteLink{ { @@ -125,7 +57,11 @@ func ExampleVPNSitesClient_BeginCreateOrUpdate() { LinkSpeedInMbps: to.Ptr[int32](0), }, }, - }}, + }, + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("value1"), }, }, nil) if err != nil { @@ -133,24 +69,23 @@ func ExampleVPNSitesClient_BeginCreateOrUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // res = armnetwork.VPNSitesClientCreateOrUpdateResponse{ + // VPNSite: armnetwork.VPNSite{ + // Name: to.Ptr("vpnSite1"), + // Type: to.Ptr("Microsoft.Network/vpnSites"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNSiteProperties{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // DeviceProperties: &armnetwork.DeviceProperties{ // LinkSpeedInMbps: to.Ptr[int32](0), @@ -158,14 +93,14 @@ func ExampleVPNSitesClient_BeginCreateOrUpdate() { // IsSecuritySite: to.Ptr(false), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), // }, // VPNSiteLinks: []*armnetwork.VPNSiteLink{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Name: to.Ptr("vpnSiteLink1"), // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Properties: &armnetwork.VPNSiteLinkProperties{ // BgpProperties: &armnetwork.VPNLinkBgpSettings{ // Asn: to.Ptr[int64](1234), @@ -178,99 +113,121 @@ func ExampleVPNSitesClient_BeginCreateOrUpdate() { // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteUpdateTags.json -func ExampleVPNSitesClient_UpdateTags() { +// Generated from example definition: 2025-07-01/VpnSiteDelete.json +func ExampleVPNSitesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVPNSitesClient().UpdateTags(ctx, "rg1", "vpnSite1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) + poller, err := clientFactory.NewVPNSitesClient().BeginDelete(ctx, "rg1", "vpnSite1", 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 poll 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.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // }, - // }, - // } + // res = armnetwork.VPNSitesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteDelete.json -func ExampleVPNSitesClient_BeginDelete() { +// Generated from example definition: 2025-07-01/VpnSiteGet.json +func ExampleVPNSitesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewVPNSitesClient().BeginDelete(ctx, "rg1", "vpnSite1", nil) + res, err := clientFactory.NewVPNSitesClient().Get(ctx, "rg1", "vpnSite1", 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) - } + // 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 = armnetwork.VPNSitesClientGetResponse{ + // VPNSite: armnetwork.VPNSite{ + // Name: to.Ptr("vpnSite1"), + // Type: to.Ptr("Microsoft.Network/vpnSites"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNSiteProperties{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // }, + // DeviceProperties: &armnetwork.DeviceProperties{ + // LinkSpeedInMbps: to.Ptr[int32](0), + // }, + // IsSecuritySite: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // }, + // VPNSiteLinks: []*armnetwork.VPNSiteLink{ + // { + // Name: to.Ptr("vpnSiteLink1"), + // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), + // Properties: &armnetwork.VPNSiteLinkProperties{ + // BgpProperties: &armnetwork.VPNLinkBgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // IPAddress: to.Ptr("50.50.50.56"), + // LinkProperties: &armnetwork.VPNLinkProviderProperties{ + // LinkProviderName: to.Ptr("vendor1"), + // LinkSpeedInMbps: to.Ptr[int32](0), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteListByResourceGroup.json -func ExampleVPNSitesClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-07-01/VpnSiteList.json +func ExampleVPNSitesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNSitesClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewVPNSitesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -281,21 +238,20 @@ func ExampleVPNSitesClient_NewListByResourceGroupPager() { _ = 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.ListVPNSitesResult = armnetwork.ListVPNSitesResult{ - // Value: []*armnetwork.VPNSite{ - // { - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // page = armnetwork.VPNSitesClientListResponse{ + // ListVPNSitesResult: armnetwork.ListVPNSitesResult{ + // Value: []*armnetwork.VPNSite{ + // { + // Name: to.Ptr("vpnSite1"), + // Type: to.Ptr("Microsoft.Network/vpnSites"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNSiteProperties{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // DeviceProperties: &armnetwork.DeviceProperties{ // LinkSpeedInMbps: to.Ptr[int32](0), @@ -303,14 +259,14 @@ func ExampleVPNSitesClient_NewListByResourceGroupPager() { // IsSecuritySite: to.Ptr(false), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), // }, // VPNSiteLinks: []*armnetwork.VPNSiteLink{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Name: to.Ptr("vpnSiteLink1"), // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Properties: &armnetwork.VPNSiteLinkProperties{ // BgpProperties: &armnetwork.VPNLinkBgpSettings{ // Asn: to.Ptr[int64](1234), @@ -322,55 +278,63 @@ func ExampleVPNSitesClient_NewListByResourceGroupPager() { // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, // { // Name: to.Ptr("vpnSite2"), // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), + // Location: to.Ptr("East US"), // Properties: &armnetwork.VPNSiteProperties{ // AddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.1.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // to.Ptr("10.0.0.0/16"), // }, // }, - // }}, - // } + // BgpProperties: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // DeviceProperties: &armnetwork.DeviceProperties{ + // DeviceModel: to.Ptr("model01"), + // DeviceVendor: to.Ptr("vendor1"), + // LinkSpeedInMbps: to.Ptr[int32](200), + // }, + // IPAddress: to.Ptr("10.1.0.0"), + // IsSecuritySite: to.Ptr(false), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSiteList.json -func ExampleVPNSitesClient_NewListPager() { +// Generated from example definition: 2025-07-01/VpnSiteListByResourceGroup.json +func ExampleVPNSitesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewVPNSitesClient().NewListPager(nil) + pager := clientFactory.NewVPNSitesClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -381,21 +345,20 @@ func ExampleVPNSitesClient_NewListPager() { _ = 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.ListVPNSitesResult = armnetwork.ListVPNSitesResult{ - // Value: []*armnetwork.VPNSite{ - // { - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, + // page = armnetwork.VPNSitesClientListByResourceGroupResponse{ + // ListVPNSitesResult: armnetwork.ListVPNSitesResult{ + // Value: []*armnetwork.VPNSite{ + // { + // Name: to.Ptr("vpnSite1"), + // Type: to.Ptr("Microsoft.Network/vpnSites"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNSiteProperties{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, // }, // DeviceProperties: &armnetwork.DeviceProperties{ // LinkSpeedInMbps: to.Ptr[int32](0), @@ -403,14 +366,14 @@ func ExampleVPNSitesClient_NewListPager() { // IsSecuritySite: to.Ptr(false), // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), // }, // VPNSiteLinks: []*armnetwork.VPNSiteLink{ // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Name: to.Ptr("vpnSiteLink1"), // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), // Properties: &armnetwork.VPNSiteLinkProperties{ // BgpProperties: &armnetwork.VPNLinkBgpSettings{ // Asn: to.Ptr[int64](1234), @@ -422,40 +385,105 @@ func ExampleVPNSitesClient_NewListPager() { // }, // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), // }, - // }}, + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), // }, // }, // { // Name: to.Ptr("vpnSite2"), // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), + // Location: to.Ptr("West US"), // Properties: &armnetwork.VPNSiteProperties{ // AddressSpace: &armnetwork.AddressSpace{ // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.1.0.0"), - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan1"), + // to.Ptr("10.0.0.0/16"), // }, // }, - // }}, - // } + // BgpProperties: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // DeviceProperties: &armnetwork.DeviceProperties{ + // DeviceModel: to.Ptr("model01"), + // DeviceVendor: to.Ptr("vendor1"), + // LinkSpeedInMbps: to.Ptr[int32](200), + // }, + // IPAddress: to.Ptr("10.1.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/VpnSiteUpdateTags.json +func ExampleVPNSitesClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + res, err := clientFactory.NewVPNSitesClient().UpdateTags(ctx, "rg1", "vpnSite1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("value2"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armnetwork.VPNSitesClientUpdateTagsResponse{ + // VPNSite: armnetwork.VPNSite{ + // Name: to.Ptr("vpnSite1"), + // Type: to.Ptr("Microsoft.Network/vpnSites"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), + // Location: to.Ptr("West US"), + // Properties: &armnetwork.VPNSiteProperties{ + // AddressSpace: &armnetwork.AddressSpace{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // }, + // BgpProperties: &armnetwork.BgpSettings{ + // Asn: to.Ptr[int64](1234), + // BgpPeeringAddress: to.Ptr("192.168.0.0"), + // }, + // DeviceProperties: &armnetwork.DeviceProperties{ + // DeviceModel: to.Ptr("model01"), + // DeviceVendor: to.Ptr("vendor1"), + // LinkSpeedInMbps: to.Ptr[int32](200), + // }, + // IPAddress: to.Ptr("10.0.0.0"), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // VirtualWan: &armnetwork.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), + // }, + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go index 87233814fd81..1efd3ade1b91 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // VPNSitesConfigurationClient contains the methods for the VPNSitesConfiguration group. // Don't use this type directly, use NewVPNSitesConfigurationClient() instead. +// +// Generated from API version 2025-07-01 type VPNSitesConfigurationClient struct { internal *arm.Client subscriptionID string } // NewVPNSitesConfigurationClient creates a new instance of VPNSitesConfigurationClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewVPNSitesConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesConfigurationClient, error) { @@ -43,10 +43,8 @@ func NewVPNSitesConfigurationClient(subscriptionID string, credential azcore.Tok // BeginDownload - Gives the sas-url to download the configurations for vpn-sites in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The resource group name. -// - virtualWANName - The name of the VirtualWAN for which configuration of all vpn-sites is needed. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualWANName - The name of the VirtualWAN. // - request - Parameters supplied to download vpn-sites configuration. // - options - VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload // method. @@ -57,8 +55,7 @@ func (client *VPNSitesConfigurationClient) BeginDownload(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesConfigurationClientDownloadResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,8 +67,6 @@ func (client *VPNSitesConfigurationClient) BeginDownload(ctx context.Context, re // Download - Gives the sas-url to download the configurations for vpn-sites in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *VPNSitesConfigurationClient) download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*http.Response, error) { var err error const operationName = "VPNSitesConfigurationClient.BeginDownload" @@ -113,9 +108,9 @@ func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go index a892d5efe8dc..3031ea039bf4 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go @@ -1,41 +1,44 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/VpnSitesConfigurationDownload.json +// Generated from example definition: 2025-07-01/VpnSitesConfigurationDownload.json func ExampleVPNSitesConfigurationClient_BeginDownload() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVPNSitesConfigurationClient().BeginDownload(ctx, "rg1", "wan1", armnetwork.GetVPNSitesConfigurationRequest{ OutputBlobSasURL: to.Ptr("https://blobcortextesturl.blob.core.windows.net/folderforconfig/vpnFile?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), VPNSites: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll 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 = armnetwork.VPNSitesConfigurationClientDownloadResponse{ + // } } diff --git a/sdk/resourcemanager/network/armnetwork/watchers_client.go b/sdk/resourcemanager/network/armnetwork/watchers_client.go index a04a5847393c..41bd4d024090 100644 --- a/sdk/resourcemanager/network/armnetwork/watchers_client.go +++ b/sdk/resourcemanager/network/armnetwork/watchers_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -17,16 +16,17 @@ import ( "strings" ) -// WatchersClient contains the methods for the NetworkWatchers group. +// WatchersClient contains the methods for the Watchers group. // Don't use this type directly, use NewWatchersClient() instead. +// +// Generated from API version 2025-07-01 type WatchersClient struct { internal *arm.Client subscriptionID string } // NewWatchersClient creates a new instance of WatchersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchersClient, error) { @@ -44,10 +44,8 @@ func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCheckConnectivity - Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the network watcher resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that determine how the connectivity check will be performed. // - options - WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity // method. @@ -58,8 +56,7 @@ func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientCheckConnectivityResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -72,8 +69,6 @@ func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resour // CheckConnectivity - Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) checkConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginCheckConnectivity" @@ -98,6 +93,10 @@ func (client *WatchersClient) checkConnectivity(ctx context.Context, resourceGro // checkConnectivityCreateRequest creates the CheckConnectivity request. func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, _ *WatchersClientBeginCheckConnectivityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -106,18 +105,15 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -126,9 +122,7 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context // CreateOrUpdate - Creates or updates a network watcher in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the network watcher resource. // - options - WatchersClientCreateOrUpdateOptions contains the optional parameters for the WatchersClient.CreateOrUpdate method. @@ -157,6 +151,10 @@ func (client *WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher, _ *WatchersClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -165,18 +163,15 @@ func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -194,9 +189,7 @@ func (client *WatchersClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes the specified network watcher resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*runtime.Poller[WatchersClientDeleteResponse], error) { @@ -206,8 +199,7 @@ func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -219,8 +211,6 @@ func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified network watcher resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginDelete" @@ -245,6 +235,10 @@ func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, _ *WatchersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -253,26 +247,19 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets the specified network watcher by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. func (client *WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientGetOptions) (WatchersClientGetResponse, error) { @@ -300,6 +287,10 @@ func (client *WatchersClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, _ *WatchersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -308,17 +299,13 @@ func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -335,10 +322,8 @@ func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersCl // BeginGetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets // the relative latency score for internet service providers from a specified location to Azure regions. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the network watcher resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that determine Azure reachability report configuration. // - options - WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport // method. @@ -349,8 +334,7 @@ func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetAzureReachabilityReportResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -363,8 +347,6 @@ func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Contex // GetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets the // relative latency score for internet service providers from a specified location to Azure regions. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetAzureReachabilityReport" @@ -389,6 +371,10 @@ func (client *WatchersClient) getAzureReachabilityReport(ctx context.Context, re // getAzureReachabilityReportCreateRequest creates the GetAzureReachabilityReport request. func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, _ *WatchersClientBeginGetAzureReachabilityReportOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -397,18 +383,15 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -417,10 +400,8 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex // BeginGetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the network watcher resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. // - options - WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus // method. @@ -431,8 +412,7 @@ func (client *WatchersClient) BeginGetFlowLogStatus(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetFlowLogStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -444,8 +424,6 @@ func (client *WatchersClient) BeginGetFlowLogStatus(ctx context.Context, resourc // GetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetFlowLogStatus" @@ -470,6 +448,10 @@ func (client *WatchersClient) getFlowLogStatus(ctx context.Context, resourceGrou // getFlowLogStatusCreateRequest creates the GetFlowLogStatus request. func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, _ *WatchersClientBeginGetFlowLogStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -478,18 +460,15 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -499,12 +478,9 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, // BeginGetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug // network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and // the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. -// The API returns whether traffic was allowed or denied, the rules evaluated for -// the specified flow and the evaluation results. +// The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters to get network configuration diagnostic. // - options - WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic @@ -516,8 +492,7 @@ func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetNetworkConfigurationDiagnosticResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -528,13 +503,10 @@ func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context } // GetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug network -// behavior. It provides detailed information on what security rules were applied to a specified traffic flow and -// the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. -// The API returns whether traffic was allowed or denied, the rules evaluated for -// the specified flow and the evaluation results. +// behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result +// of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns +// whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetNetworkConfigurationDiagnostic" @@ -559,6 +531,10 @@ func (client *WatchersClient) getNetworkConfigurationDiagnostic(ctx context.Cont // getNetworkConfigurationDiagnosticCreateRequest creates the GetNetworkConfigurationDiagnostic request. func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, _ *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -567,18 +543,15 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -587,9 +560,7 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx // BeginGetNextHop - Gets the next hop from the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the source and destination endpoint. // - options - WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop @@ -601,8 +572,7 @@ func (client *WatchersClient) BeginGetNextHop(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetNextHopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -614,8 +584,6 @@ func (client *WatchersClient) BeginGetNextHop(ctx context.Context, resourceGroup // GetNextHop - Gets the next hop from the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetNextHop" @@ -640,6 +608,10 @@ func (client *WatchersClient) getNextHop(ctx context.Context, resourceGroupName // getNextHopCreateRequest creates the GetNextHop request. func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, _ *WatchersClientBeginGetNextHopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -648,18 +620,15 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -668,9 +637,7 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou // GetTopology - Gets the current network topology by resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the representation of topology. // - options - WatchersClientGetTopologyOptions contains the optional parameters for the WatchersClient.GetTopology method. @@ -699,6 +666,10 @@ func (client *WatchersClient) GetTopology(ctx context.Context, resourceGroupName // getTopologyCreateRequest creates the GetTopology request. func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters, _ *WatchersClientGetTopologyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -707,18 +678,15 @@ func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, reso return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -736,10 +704,8 @@ func (client *WatchersClient) getTopologyHandleResponse(resp *http.Response) (Wa // BeginGetTroubleshooting - Initiate troubleshooting on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the resource to troubleshoot. // - options - WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting // method. @@ -750,8 +716,7 @@ func (client *WatchersClient) BeginGetTroubleshooting(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -763,8 +728,6 @@ func (client *WatchersClient) BeginGetTroubleshooting(ctx context.Context, resou // GetTroubleshooting - Initiate troubleshooting on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetTroubleshooting" @@ -789,6 +752,10 @@ func (client *WatchersClient) getTroubleshooting(ctx context.Context, resourceGr // getTroubleshootingCreateRequest creates the GetTroubleshooting request. func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, _ *WatchersClientBeginGetTroubleshootingOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -797,18 +764,15 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -817,10 +781,8 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex // BeginGetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the resource to query the troubleshooting result. // - options - WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult // method. @@ -831,8 +793,7 @@ func (client *WatchersClient) BeginGetTroubleshootingResult(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResultResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -844,8 +805,6 @@ func (client *WatchersClient) BeginGetTroubleshootingResult(ctx context.Context, // GetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetTroubleshootingResult" @@ -870,6 +829,10 @@ func (client *WatchersClient) getTroubleshootingResult(ctx context.Context, reso // getTroubleshootingResultCreateRequest creates the GetTroubleshootingResult request. func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, _ *WatchersClientBeginGetTroubleshootingResultOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -878,18 +841,15 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -898,9 +858,7 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. // BeginGetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the VM to check security groups for. // - options - WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules @@ -912,8 +870,7 @@ func (client *WatchersClient) BeginGetVMSecurityRules(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetVMSecurityRulesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -925,8 +882,6 @@ func (client *WatchersClient) BeginGetVMSecurityRules(ctx context.Context, resou // GetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) getVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetVMSecurityRules" @@ -951,6 +906,10 @@ func (client *WatchersClient) getVMSecurityRules(ctx context.Context, resourceGr // getVMSecurityRulesCreateRequest creates the GetVMSecurityRules request. func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, _ *WatchersClientBeginGetVMSecurityRulesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -959,18 +918,15 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -978,28 +934,25 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex } // NewListPager - Gets all network watchers by resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WatchersClientListOptions contains the optional parameters for the WatchersClient.NewListPager method. func (client *WatchersClient) NewListPager(resourceGroupName string, options *WatchersClientListOptions) *runtime.Pager[WatchersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WatchersClientListResponse]{ More: func(page WatchersClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WatchersClientListResponse) (WatchersClientListResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WatchersClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, options) - if err != nil { - return WatchersClientListResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) if err != nil { return WatchersClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -1009,21 +962,21 @@ func (client *WatchersClient) NewListPager(resourceGroupName string, options *Wa // listCreateRequest creates the List request. func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *WatchersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1038,27 +991,24 @@ func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersC } // NewListAllPager - Gets all network watchers by subscription. -// -// Generated from API version 2025-05-01 // - options - WatchersClientListAllOptions contains the optional parameters for the WatchersClient.NewListAllPager method. func (client *WatchersClient) NewListAllPager(options *WatchersClientListAllOptions) *runtime.Pager[WatchersClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[WatchersClientListAllResponse]{ More: func(page WatchersClientListAllResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WatchersClientListAllResponse) (WatchersClientListAllResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WatchersClient.NewListAllPager") - req, err := client.listAllCreateRequest(ctx, options) - if err != nil { - return WatchersClientListAllResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listAllCreateRequest(ctx, options) + }, nil) if err != nil { return WatchersClientListAllResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientListAllResponse{}, runtime.NewResponseError(resp) - } return client.listAllHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -1077,8 +1027,8 @@ func (client *WatchersClient) listAllCreateRequest(ctx context.Context, _ *Watch return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1095,10 +1045,8 @@ func (client *WatchersClient) listAllHandleResponse(resp *http.Response) (Watche // BeginListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all // available internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the network watcher resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that scope the list of available providers. // - options - WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders // method. @@ -1109,8 +1057,7 @@ func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientListAvailableProvidersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1123,8 +1070,6 @@ func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, r // ListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all available // internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) listAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginListAvailableProviders" @@ -1149,6 +1094,10 @@ func (client *WatchersClient) listAvailableProviders(ctx context.Context, resour // listAvailableProvidersCreateRequest creates the ListAvailableProviders request. func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, _ *WatchersClientBeginListAvailableProvidersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1157,18 +1106,15 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1177,10 +1123,8 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co // BeginSetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the network watcher resource group. -// - networkWatcherName - The name of the network watcher resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the configuration of flow log. // - options - WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration // method. @@ -1191,8 +1135,7 @@ func (client *WatchersClient) BeginSetFlowLogConfiguration(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientSetFlowLogConfigurationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1204,8 +1147,6 @@ func (client *WatchersClient) BeginSetFlowLogConfiguration(ctx context.Context, // SetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) setFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginSetFlowLogConfiguration" @@ -1230,6 +1171,10 @@ func (client *WatchersClient) setFlowLogConfiguration(ctx context.Context, resou // setFlowLogConfigurationCreateRequest creates the SetFlowLogConfiguration request. func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, _ *WatchersClientBeginSetFlowLogConfigurationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1238,18 +1183,15 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1258,9 +1200,7 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C // UpdateTags - Updates a network watcher tags. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters supplied to update network watcher tags. // - options - WatchersClientUpdateTagsOptions contains the optional parameters for the WatchersClient.UpdateTags method. @@ -1289,6 +1229,10 @@ func (client *WatchersClient) UpdateTags(ctx context.Context, resourceGroupName // updateTagsCreateRequest creates the UpdateTags request. func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject, _ *WatchersClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1297,18 +1241,15 @@ func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resou return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1326,9 +1267,7 @@ func (client *WatchersClient) updateTagsHandleResponse(resp *http.Response) (Wat // BeginVerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the IP flow to be verified. // - options - WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow @@ -1340,8 +1279,7 @@ func (client *WatchersClient) BeginVerifyIPFlow(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientVerifyIPFlowResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1353,8 +1291,6 @@ func (client *WatchersClient) BeginVerifyIPFlow(ctx context.Context, resourceGro // VerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WatchersClient) verifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginVerifyIPFlow" @@ -1379,6 +1315,10 @@ func (client *WatchersClient) verifyIPFlow(ctx context.Context, resourceGroupNam // verifyIPFlowCreateRequest creates the VerifyIPFlow request. func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, _ *WatchersClientBeginVerifyIPFlowOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1387,18 +1327,15 @@ func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, res return nil, errors.New("parameter networkWatcherName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go index a658f72eb317..736e0b93d96d 100644 --- a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go @@ -1,97 +1,129 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - - "time" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" + "time" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherCreate.json -func ExampleWatchersClient_CreateOrUpdate() { +// Generated from example definition: 2025-07-01/NetworkWatcherConnectivityCheck.json +func ExampleWatchersClient_BeginCheckConnectivity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewWatchersClient().CreateOrUpdate(ctx, "rg1", "nw1", armnetwork.Watcher{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.WatcherPropertiesFormat{}, + poller, err := clientFactory.NewWatchersClient().BeginCheckConnectivity(ctx, "rg1", "nw1", armnetwork.ConnectivityParameters{ + Destination: &armnetwork.ConnectivityDestination{ + Address: to.Ptr("192.168.100.4"), + Port: to.Ptr[int32](3389), + }, + PreferredIPVersion: to.Ptr(armnetwork.IPVersionIPv4), + Source: &armnetwork.ConnectivitySource{ + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + }, }, 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 poll 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.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.WatchersClientCheckConnectivityResponse{ + // ConnectivityInformation: armnetwork.ConnectivityInformation{ + // AvgLatencyInMs: to.Ptr[int32](1), + // ConnectionStatus: to.Ptr(armnetwork.ConnectionStatusConnected), + // Hops: []*armnetwork.ConnectivityHop{ + // { + // Type: to.Ptr("Source"), + // Address: to.Ptr("10.1.1.4"), + // ID: to.Ptr("7dbbe7aa-60ba-4650-831e-63d775d38e9e"), + // Issues: []*armnetwork.ConnectivityIssue{ + // }, + // NextHopIDs: []*string{ + // to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"), + // }, + // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1"), + // }, + // { + // Type: to.Ptr("VirtualNetwork"), + // Address: to.Ptr("192.168.100.4"), + // ID: to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"), + // Issues: []*armnetwork.ConnectivityIssue{ + // }, + // NextHopIDs: []*string{ + // }, + // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), + // }, + // }, + // MaxLatencyInMs: to.Ptr[int32](4), + // MinLatencyInMs: to.Ptr[int32](1), + // ProbesFailed: to.Ptr[int32](0), + // ProbesSent: to.Ptr[int32](100), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherGet.json -func ExampleWatchersClient_Get() { +// Generated from example definition: 2025-07-01/NetworkWatcherCreate.json +func ExampleWatchersClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewWatchersClient().Get(ctx, "rg1", "nw1", nil) + res, err := clientFactory.NewWatchersClient().CreateOrUpdate(ctx, "rg1", "nw1", armnetwork.Watcher{ + Location: to.Ptr("eastus"), + Properties: &armnetwork.WatcherPropertiesFormat{}, + }, 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.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.WatchersClientCreateOrUpdateResponse{ + // Watcher: armnetwork.Watcher{ + // Name: to.Ptr("nw1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherDelete.json +// Generated from example definition: 2025-07-01/NetworkWatcherDelete.json func ExampleWatchersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -101,830 +133,856 @@ func ExampleWatchersClient_BeginDelete() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherUpdateTags.json -func ExampleWatchersClient_UpdateTags() { +// Generated from example definition: 2025-07-01/NetworkWatcherGet.json +func ExampleWatchersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewWatchersClient().UpdateTags(ctx, "rg1", "nw1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) + res, err := clientFactory.NewWatchersClient().Get(ctx, "rg1", "nw1", 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.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // res = armnetwork.WatchersClientGetResponse{ + // Watcher: armnetwork.Watcher{ + // Name: to.Ptr("nw1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherList.json -func ExampleWatchersClient_NewListPager() { +// Generated from example definition: 2025-07-01/NetworkWatcherAzureReachabilityReportGet.json +func ExampleWatchersClient_BeginGetAzureReachabilityReport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewWatchersClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WatcherListResult = armnetwork.WatcherListResult{ - // Value: []*armnetwork.Watcher{ - // { - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nw2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherListAll.json -func ExampleWatchersClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) + poller, err := clientFactory.NewWatchersClient().BeginGetAzureReachabilityReport(ctx, "rg1", "nw1", armnetwork.AzureReachabilityReportParameters{ + AzureLocations: []*string{ + to.Ptr("West US"), + }, + EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-10T00:00:00Z"); return t }()), + ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ + Country: to.Ptr("United States"), + State: to.Ptr("washington"), + }, + Providers: []*string{ + to.Ptr("Frontier Communications of America, Inc. - ASN 5650"), + }, + StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00Z"); return t }()), + }, nil) if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWatchersClient().NewListAllPager(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.WatcherListResult = armnetwork.WatcherListResult{ - // Value: []*armnetwork.Watcher{ - // { - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nw2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } + log.Fatalf("failed to poll 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 = armnetwork.WatchersClientGetAzureReachabilityReportResponse{ + // AzureReachabilityReport: armnetwork.AzureReachabilityReport{ + // AggregationLevel: to.Ptr("State"), + // ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ + // Country: to.Ptr("United States"), + // State: to.Ptr("washington"), + // }, + // ReachabilityReport: []*armnetwork.AzureReachabilityReportItem{ + // { + // AzureLocation: to.Ptr("West US"), + // Latencies: []*armnetwork.AzureReachabilityReportLatencyInfo{ + // { + // Score: to.Ptr[int32](94), + // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00Z"); return t}()), + // }, + // { + // Score: to.Ptr[int32](94), + // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-08T00:00:00Z"); return t}()), + // }, + // { + // Score: to.Ptr[int32](94), + // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-09T00:00:00Z"); return t}()), + // }, + // }, + // Provider: to.Ptr("Frontier Communications of America, Inc. - ASN 5650"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherTopologyGet.json -func ExampleWatchersClient_GetTopology() { +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogStatusQuery.json +func ExampleWatchersClient_BeginGetFlowLogStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewWatchersClient().GetTopology(ctx, "rg1", "nw1", armnetwork.TopologyParameters{ - TargetResourceGroupName: to.Ptr("rg2"), + poller, err := clientFactory.NewWatchersClient().BeginGetFlowLogStatus(ctx, "rg1", "nw1", armnetwork.FlowLogStatusParameters{ + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), }, 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 poll 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.Topology = armnetwork.Topology{ - // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-02T19:31:55.946Z"); return t}()), - // ID: to.Ptr("ce592f46-8164-4bf2-ad36-b8e4acf6fb68"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T00:00:13.200Z"); return t}()), - // Resources: []*armnetwork.TopologyResource{ - // { - // Name: to.Ptr("MultiTierApp0"), - // Associations: []*armnetwork.TopologyAssociation{ - // { - // Name: to.Ptr("appNic0"), - // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic0"), + // res = armnetwork.WatchersClientGetFlowLogStatusResponse{ + // FlowLogInformation: armnetwork.FlowLogInformation{ + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), // }, - // { - // Name: to.Ptr("appNic10"), - // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic10"), - // }}, - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"), - // Location: to.Ptr("westus"), - // }}, + // }, + // }, + // Properties: &armnetwork.FlowLogProperties{ + // Enabled: to.Ptr(true), + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), + // }, + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherIpFlowVerify.json -func ExampleWatchersClient_BeginVerifyIPFlow() { +// Generated from example definition: 2025-07-01/NetworkWatcherNetworkConfigurationDiagnostic.json +func ExampleWatchersClient_BeginGetNetworkConfigurationDiagnostic() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginVerifyIPFlow(ctx, "rg1", "nw1", armnetwork.VerificationIPFlowParameters{ - Direction: to.Ptr(armnetwork.DirectionOutbound), - LocalIPAddress: to.Ptr("10.2.0.4"), - LocalPort: to.Ptr("80"), - RemoteIPAddress: to.Ptr("121.10.1.1"), - RemotePort: to.Ptr("80"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - Protocol: to.Ptr(armnetwork.IPFlowProtocolTCP), + poller, err := clientFactory.NewWatchersClient().BeginGetNetworkConfigurationDiagnostic(ctx, "rg1", "nw1", armnetwork.ConfigurationDiagnosticParameters{ + Profiles: []*armnetwork.ConfigurationDiagnosticProfile{ + { + Destination: to.Ptr("12.11.12.14"), + DestinationPort: to.Ptr("12100"), + Direction: to.Ptr(armnetwork.DirectionInbound), + Source: to.Ptr("10.1.0.4"), + Protocol: to.Ptr("TCP"), + }, + }, + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), }, 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) + log.Fatalf("failed to poll 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.VerificationIPFlowResult = armnetwork.VerificationIPFlowResult{ - // Access: to.Ptr(armnetwork.AccessAllow), - // RuleName: to.Ptr("Rule1"), + // res = armnetwork.WatchersClientGetNetworkConfigurationDiagnosticResponse{ + // ConfigurationDiagnosticResponse: armnetwork.ConfigurationDiagnosticResponse{ + // Results: []*armnetwork.ConfigurationDiagnosticResult{ + // { + // NetworkSecurityGroupResult: &armnetwork.SecurityGroupResult{ + // EvaluatedNetworkSecurityGroups: []*armnetwork.EvaluatedNetworkSecurityGroup{ + // { + // AppliedTo: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AppSubnet"), + // MatchedRule: &armnetwork.MatchedRule{ + // Action: to.Ptr("Allow"), + // RuleName: to.Ptr("UserRule_fe_rule"), + // }, + // NetworkSecurityGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ + // { + // Name: to.Ptr("UserRule_Cleanuptool-Allow-100"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(false), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(false), + // SourcePortMatched: to.Ptr(true), + // }, + // { + // Name: to.Ptr("UserRule_Cleanuptool-Allow-101"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(false), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(true), + // SourcePortMatched: to.Ptr(true), + // }, + // { + // Name: to.Ptr("UserRule_Cleanuptool-Allow-102"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(false), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(false), + // SourcePortMatched: to.Ptr(true), + // }, + // { + // Name: to.Ptr("UserRule_Cleanuptool-Deny-103"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(false), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(true), + // SourcePortMatched: to.Ptr(true), + // }, + // { + // Name: to.Ptr("UserRule_fe_rule"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(true), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(true), + // SourcePortMatched: to.Ptr(true), + // }, + // }, + // }, + // { + // AppliedTo: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/networkInterfaces/nic"), + // MatchedRule: &armnetwork.MatchedRule{ + // Action: to.Ptr("Allow"), + // RuleName: to.Ptr("UserRule_fe_rule"), + // }, + // NetworkSecurityGroupID: to.Ptr("/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG"), + // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ + // { + // Name: to.Ptr("UserRule_fe_rule"), + // DestinationMatched: to.Ptr(true), + // DestinationPortMatched: to.Ptr(true), + // ProtocolMatched: to.Ptr(true), + // SourceMatched: to.Ptr(true), + // SourcePortMatched: to.Ptr(true), + // }, + // }, + // }, + // }, + // SecurityRuleAccessResult: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // }, + // Profile: &armnetwork.ConfigurationDiagnosticProfile{ + // Destination: to.Ptr("12.11.12.14"), + // DestinationPort: to.Ptr("12100"), + // Direction: to.Ptr(armnetwork.DirectionInbound), + // Source: to.Ptr("10.1.0.4"), + // Protocol: to.Ptr("TCP"), + // }, + // }, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherNextHopGet.json +// Generated from example definition: 2025-07-01/NetworkWatcherNextHopGet.json func ExampleWatchersClient_BeginGetNextHop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewWatchersClient().BeginGetNextHop(ctx, "rg1", "nw1", armnetwork.NextHopParameters{ DestinationIPAddress: to.Ptr("10.0.0.10"), SourceIPAddress: to.Ptr("10.0.0.5"), - TargetNicResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + TargetNicResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), }, 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) + log.Fatalf("failed to poll 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.NextHopResult = armnetwork.NextHopResult{ - // NextHopIPAddress: to.Ptr("10.0.0.1"), - // NextHopType: to.Ptr(armnetwork.NextHopTypeVnetLocal), - // RouteTableID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/routeTables/rt1"), + // res = armnetwork.WatchersClientGetNextHopResponse{ + // NextHopResult: armnetwork.NextHopResult{ + // NextHopIPAddress: to.Ptr("10.0.0.1"), + // NextHopType: to.Ptr(armnetwork.NextHopTypeVnetLocal), + // RouteTableID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/routeTables/rt1"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherSecurityGroupViewGet.json -func ExampleWatchersClient_BeginGetVMSecurityRules() { +// Generated from example definition: 2025-07-01/NetworkWatcherTopologyGet.json +func ExampleWatchersClient_GetTopology() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginGetVMSecurityRules(ctx, "rg1", "nw1", armnetwork.SecurityGroupViewParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + res, err := clientFactory.NewWatchersClient().GetTopology(ctx, "rg1", "nw1", armnetwork.TopologyParameters{ + TargetResourceGroupName: to.Ptr("rg2"), }, 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.SecurityGroupViewResult = armnetwork.SecurityGroupViewResult{ - // NetworkInterfaces: []*armnetwork.SecurityGroupNetworkInterface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1"), - // SecurityRuleAssociations: &armnetwork.SecurityRuleAssociations{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // res = armnetwork.WatchersClientGetTopologyResponse{ + // Topology: armnetwork.Topology{ + // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-02T19:31:55.9461781Z"); return t}()), + // ID: to.Ptr("ce592f46-8164-4bf2-ad36-b8e4acf6fb68"), + // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T00:00:13.2005337Z"); return t}()), + // Resources: []*armnetwork.TopologyResource{ + // { + // Name: to.Ptr("MultiTierApp0"), + // Associations: []*armnetwork.TopologyAssociation{ // { - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/networkSecurityGroups//defaultSecurityRules/"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ + // Name: to.Ptr("appNic0"), + // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic0"), + // }, // { - // Name: to.Ptr("DefaultOutboundDenyAll"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("0-65535"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), - // }}, - // SubnetAssociation: &armnetwork.SubnetAssociation{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/AppNSG/securityRules/fe_rule"), - // Name: to.Ptr("fe_rule"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow Frontend"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("10.1.0.0/24"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolTCP), - // }, - // }}, + // Name: to.Ptr("appNic10"), + // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), + // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic10"), + // }, // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"), + // Location: to.Ptr("westus"), // }, - // }}, + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherTroubleshootGet.json +// Generated from example definition: 2025-07-01/NetworkWatcherTroubleshootGet.json func ExampleWatchersClient_BeginGetTroubleshooting() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewWatchersClient().BeginGetTroubleshooting(ctx, "rg1", "nw1", armnetwork.TroubleshootingParameters{ Properties: &armnetwork.TroubleshootingProperties{ - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), + StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), StoragePath: to.Ptr("https://st1.blob.core.windows.net/cn1"), }, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), }, 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) + log.Fatalf("failed to poll 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.TroubleshootingResult = armnetwork.TroubleshootingResult{ - // Code: to.Ptr("UnHealthy"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), - // Results: []*armnetwork.TroubleshootingDetails{ - // { - // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), - // ID: to.Ptr("000000"), - // ReasonType: to.Ptr("VipUnResponsive"), - // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ - // { - // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), - // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), - // ActionURIText: to.Ptr("Verify"), + // res = armnetwork.WatchersClientGetTroubleshootingResponse{ + // TroubleshootingResult: armnetwork.TroubleshootingResult{ + // Code: to.Ptr("UnHealthy"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), + // Results: []*armnetwork.TroubleshootingDetails{ + // { + // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), + // ID: to.Ptr("000000"), + // ReasonType: to.Ptr("VipUnResponsive"), + // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ + // { + // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), + // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), + // ActionURIText: to.Ptr("Verify"), + // }, + // { + // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), + // ActionURI: to.Ptr("http://azure.microsoft.com/support"), + // ActionURIText: to.Ptr("contact support"), + // }, // }, - // { - // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), - // ActionURI: to.Ptr("http://azure.microsoft.com/support"), - // ActionURIText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.044Z"); return t}()), + // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), + // }, + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.0442834Z"); return t}()), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherTroubleshootResultQuery.json +// Generated from example definition: 2025-07-01/NetworkWatcherTroubleshootResultQuery.json func ExampleWatchersClient_BeginGetTroubleshootingResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewWatchersClient().BeginGetTroubleshootingResult(ctx, "rg1", "nw1", armnetwork.QueryTroubleshootingParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), }, 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) + log.Fatalf("failed to poll 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.TroubleshootingResult = armnetwork.TroubleshootingResult{ - // Code: to.Ptr("UnHealthy"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), - // Results: []*armnetwork.TroubleshootingDetails{ - // { - // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), - // ID: to.Ptr("000000"), - // ReasonType: to.Ptr("VipUnResponsive"), - // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ - // { - // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), - // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), - // ActionURIText: to.Ptr("Verify"), + // res = armnetwork.WatchersClientGetTroubleshootingResultResponse{ + // TroubleshootingResult: armnetwork.TroubleshootingResult{ + // Code: to.Ptr("UnHealthy"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), + // Results: []*armnetwork.TroubleshootingDetails{ + // { + // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), + // ID: to.Ptr("000000"), + // ReasonType: to.Ptr("VipUnResponsive"), + // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ + // { + // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), + // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), + // ActionURIText: to.Ptr("Verify"), + // }, + // { + // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), + // ActionURI: to.Ptr("http://azure.microsoft.com/support"), + // ActionURIText: to.Ptr("contact support"), + // }, // }, - // { - // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), - // ActionURI: to.Ptr("http://azure.microsoft.com/support"), - // ActionURIText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.044Z"); return t}()), + // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), + // }, + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.0442834Z"); return t}()), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogConfigure.json -func ExampleWatchersClient_BeginSetFlowLogConfiguration() { +// Generated from example definition: 2025-07-01/NetworkWatcherSecurityGroupViewGet.json +func ExampleWatchersClient_BeginGetVMSecurityRules() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginSetFlowLogConfiguration(ctx, "rg1", "nw1", armnetwork.FlowLogInformation{ - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetwork.FlowLogProperties{ - Enabled: to.Ptr(true), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - }, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + poller, err := clientFactory.NewWatchersClient().BeginGetVMSecurityRules(ctx, "rg1", "nw1", armnetwork.SecurityGroupViewParameters{ + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), }, 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) + log.Fatalf("failed to poll 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.FlowLogInformation = armnetwork.FlowLogInformation{ - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), + // res = armnetwork.WatchersClientGetVMSecurityRulesResponse{ + // SecurityGroupViewResult: armnetwork.SecurityGroupViewResult{ + // NetworkInterfaces: []*armnetwork.SecurityGroupNetworkInterface{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1"), + // SecurityRuleAssociations: &armnetwork.SecurityRuleAssociations{ + // DefaultSecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("AllowVnetInBound"), + // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/networkSecurityGroups//defaultSecurityRules/"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](65000), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("VirtualNetwork"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), + // }, + // }, + // }, + // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ + // { + // Name: to.Ptr("DefaultOutboundDenyAll"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("0-65535"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), + // Priority: to.Ptr[int32](65500), + // SourceAddressPrefix: to.Ptr("*"), + // SourcePortRange: to.Ptr("0-65535"), + // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), + // }, + // }, + // SubnetAssociation: &armnetwork.SubnetAssociation{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SecurityRules: []*armnetwork.SecurityRule{ + // { + // Name: to.Ptr("fe_rule"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/AppNSG/securityRules/fe_rule"), + // Properties: &armnetwork.SecurityRulePropertiesFormat{ + // Description: to.Ptr("Allow Frontend"), + // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("*"), + // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), + // Priority: to.Ptr[int32](100), + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // SourceAddressPrefix: to.Ptr("10.1.0.0/24"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolTCP), + // }, + // }, + // }, + // }, + // }, // }, // }, // }, - // Properties: &armnetwork.FlowLogProperties{ - // Enabled: to.Ptr(true), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - // }, - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherFlowLogStatusQuery.json -func ExampleWatchersClient_BeginGetFlowLogStatus() { +// Generated from example definition: 2025-07-01/NetworkWatcherList.json +func ExampleWatchersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginGetFlowLogStatus(ctx, "rg1", "nw1", armnetwork.FlowLogStatusParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - }, nil) + pager := clientFactory.NewWatchersClient().NewListPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.WatchersClientListResponse{ + // WatcherListResult: armnetwork.WatcherListResult{ + // Value: []*armnetwork.Watcher{ + // { + // Name: to.Ptr("nw1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // Name: to.Ptr("nw2"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/NetworkWatcherListAll.json +func ExampleWatchersClient_NewListAllPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewWatchersClient().NewListAllPager(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 = armnetwork.WatchersClientListAllResponse{ + // WatcherListResult: armnetwork.WatcherListResult{ + // Value: []*armnetwork.Watcher{ + // { + // Name: to.Ptr("nw1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // Name: to.Ptr("nw2"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), + // Location: to.Ptr("westus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } } - // 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.FlowLogInformation = armnetwork.FlowLogInformation{ - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogProperties{ - // Enabled: to.Ptr(true), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - // }, - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherConnectivityCheck.json -func ExampleWatchersClient_BeginCheckConnectivity() { +// Generated from example definition: 2025-07-01/NetworkWatcherAvailableProvidersListGet.json +func ExampleWatchersClient_BeginListAvailableProviders() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginCheckConnectivity(ctx, "rg1", "nw1", armnetwork.ConnectivityParameters{ - Destination: &armnetwork.ConnectivityDestination{ - Address: to.Ptr("192.168.100.4"), - Port: to.Ptr[int32](3389), - }, - PreferredIPVersion: to.Ptr(armnetwork.IPVersionIPv4), - Source: &armnetwork.ConnectivitySource{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + poller, err := clientFactory.NewWatchersClient().BeginListAvailableProviders(ctx, "rg1", "nw1", armnetwork.AvailableProvidersListParameters{ + AzureLocations: []*string{ + to.Ptr("West US"), }, + City: to.Ptr("seattle"), + Country: to.Ptr("United States"), + State: to.Ptr("washington"), }, 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) + log.Fatalf("failed to poll 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.ConnectivityInformation = armnetwork.ConnectivityInformation{ - // AvgLatencyInMs: to.Ptr[int32](1), - // ConnectionStatus: to.Ptr(armnetwork.ConnectionStatusConnected), - // Hops: []*armnetwork.ConnectivityHop{ - // { - // Type: to.Ptr("Source"), - // Address: to.Ptr("10.1.1.4"), - // ID: to.Ptr("7dbbe7aa-60ba-4650-831e-63d775d38e9e"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ - // to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9")}, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1"), - // }, + // res = armnetwork.WatchersClientListAvailableProvidersResponse{ + // AvailableProvidersList: armnetwork.AvailableProvidersList{ + // Countries: []*armnetwork.AvailableProvidersListCountry{ // { - // Type: to.Ptr("VirtualNetwork"), - // Address: to.Ptr("192.168.100.4"), - // ID: to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ + // CountryName: to.Ptr("United States"), + // States: []*armnetwork.AvailableProvidersListState{ + // { + // Cities: []*armnetwork.AvailableProvidersListCity{ + // { + // CityName: to.Ptr("seattle"), + // Providers: []*string{ + // to.Ptr("Comcast Cable Communications, Inc. - ASN 7922"), + // to.Ptr("Comcast Cable Communications, LLC - ASN 7922"), + // to.Ptr("Level 3 Communications, Inc. (GBLX) - ASN 3549"), + // to.Ptr("Qwest Communications Company, LLC - ASN 209"), + // }, + // }, + // }, + // StateName: to.Ptr("washington"), + // }, // }, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // MaxLatencyInMs: to.Ptr[int32](4), - // MinLatencyInMs: to.Ptr[int32](1), - // ProbesFailed: to.Ptr[int32](0), - // ProbesSent: to.Ptr[int32](100), - // } + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherAzureReachabilityReportGet.json -func ExampleWatchersClient_BeginGetAzureReachabilityReport() { +// Generated from example definition: 2025-07-01/NetworkWatcherFlowLogConfigure.json +func ExampleWatchersClient_BeginSetFlowLogConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginGetAzureReachabilityReport(ctx, "rg1", "nw1", armnetwork.AzureReachabilityReportParameters{ - AzureLocations: []*string{ - to.Ptr("West US")}, - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-10T00:00:00.000Z"); return t }()), - ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ - Country: to.Ptr("United States"), - State: to.Ptr("washington"), + poller, err := clientFactory.NewWatchersClient().BeginSetFlowLogConfiguration(ctx, "rg1", "nw1", armnetwork.FlowLogInformation{ + Identity: &armnetwork.ManagedServiceIdentity{ + Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, + }, }, - Providers: []*string{ - to.Ptr("Frontier Communications of America, Inc. - ASN 5650")}, - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00.000Z"); return t }()), + Properties: &armnetwork.FlowLogProperties{ + Enabled: to.Ptr(true), + StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), + }, + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), }, 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) + log.Fatalf("failed to poll 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.AzureReachabilityReport = armnetwork.AzureReachabilityReport{ - // AggregationLevel: to.Ptr("State"), - // ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ - // Country: to.Ptr("United States"), - // State: to.Ptr("washington"), - // }, - // ReachabilityReport: []*armnetwork.AzureReachabilityReportItem{ - // { - // AzureLocation: to.Ptr("West US"), - // Latencies: []*armnetwork.AzureReachabilityReportLatencyInfo{ - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00.000Z"); return t}()), - // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-08T00:00:00.000Z"); return t}()), + // res = armnetwork.WatchersClientSetFlowLogConfigurationResponse{ + // FlowLogInformation: armnetwork.FlowLogInformation{ + // Identity: &armnetwork.ManagedServiceIdentity{ + // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.ManagedServiceIdentityUserAssignedIdentities{ + // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), + // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-09T00:00:00.000Z"); return t}()), - // }}, - // Provider: to.Ptr("Frontier Communications of America, Inc. - ASN 5650"), - // }}, + // }, + // }, + // Properties: &armnetwork.FlowLogProperties{ + // Enabled: to.Ptr(true), + // StorageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), + // }, + // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherAvailableProvidersListGet.json -func ExampleWatchersClient_BeginListAvailableProviders() { +// Generated from example definition: 2025-07-01/NetworkWatcherUpdateTags.json +func ExampleWatchersClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginListAvailableProviders(ctx, "rg1", "nw1", armnetwork.AvailableProvidersListParameters{ - AzureLocations: []*string{ - to.Ptr("West US")}, - City: to.Ptr("seattle"), - Country: to.Ptr("United States"), - State: to.Ptr("washington"), + res, err := clientFactory.NewWatchersClient().UpdateTags(ctx, "rg1", "nw1", armnetwork.TagsObject{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, }, 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.AvailableProvidersList = armnetwork.AvailableProvidersList{ - // Countries: []*armnetwork.AvailableProvidersListCountry{ - // { - // CountryName: to.Ptr("United States"), - // States: []*armnetwork.AvailableProvidersListState{ - // { - // Cities: []*armnetwork.AvailableProvidersListCity{ - // { - // CityName: to.Ptr("seattle"), - // Providers: []*string{ - // to.Ptr("Comcast Cable Communications, Inc. - ASN 7922"), - // to.Ptr("Comcast Cable Communications, LLC - ASN 7922"), - // to.Ptr("Level 3 Communications, Inc. (GBLX) - ASN 3549"), - // to.Ptr("Qwest Communications Company, LLC - ASN 209")}, - // }}, - // StateName: to.Ptr("washington"), - // }}, - // }}, - // } + // res = armnetwork.WatchersClientUpdateTagsResponse{ + // Watcher: armnetwork.Watcher{ + // Name: to.Ptr("nw1"), + // Type: to.Ptr("Microsoft.Network/networkWatchers"), + // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetwork.WatcherPropertiesFormat{ + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/NetworkWatcherNetworkConfigurationDiagnostic.json -func ExampleWatchersClient_BeginGetNetworkConfigurationDiagnostic() { +// Generated from example definition: 2025-07-01/NetworkWatcherIpFlowVerify.json +func ExampleWatchersClient_BeginVerifyIPFlow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWatchersClient().BeginGetNetworkConfigurationDiagnostic(ctx, "rg1", "nw1", armnetwork.ConfigurationDiagnosticParameters{ - Profiles: []*armnetwork.ConfigurationDiagnosticProfile{ - { - Destination: to.Ptr("12.11.12.14"), - DestinationPort: to.Ptr("12100"), - Direction: to.Ptr(armnetwork.DirectionInbound), - Source: to.Ptr("10.1.0.4"), - Protocol: to.Ptr("TCP"), - }}, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + poller, err := clientFactory.NewWatchersClient().BeginVerifyIPFlow(ctx, "rg1", "nw1", armnetwork.VerificationIPFlowParameters{ + Direction: to.Ptr(armnetwork.DirectionOutbound), + LocalIPAddress: to.Ptr("10.2.0.4"), + LocalPort: to.Ptr("80"), + RemoteIPAddress: to.Ptr("121.10.1.1"), + RemotePort: to.Ptr("80"), + TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + Protocol: to.Ptr(armnetwork.IPFlowProtocolTCP), }, 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) + log.Fatalf("failed to poll 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.ConfigurationDiagnosticResponse = armnetwork.ConfigurationDiagnosticResponse{ - // Results: []*armnetwork.ConfigurationDiagnosticResult{ - // { - // NetworkSecurityGroupResult: &armnetwork.SecurityGroupResult{ - // EvaluatedNetworkSecurityGroups: []*armnetwork.EvaluatedNetworkSecurityGroup{ - // { - // AppliedTo: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AppSubnet"), - // MatchedRule: &armnetwork.MatchedRule{ - // Action: to.Ptr("Allow"), - // RuleName: to.Ptr("UserRule_fe_rule"), - // }, - // NetworkSecurityGroupID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-100"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(false), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-101"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-102"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(false), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Deny-103"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_fe_rule"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(true), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }}, - // }, - // { - // AppliedTo: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/networkInterfaces/nic"), - // MatchedRule: &armnetwork.MatchedRule{ - // Action: to.Ptr("Allow"), - // RuleName: to.Ptr("UserRule_fe_rule"), - // }, - // NetworkSecurityGroupID: to.Ptr("/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG"), - // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ - // { - // Name: to.Ptr("UserRule_fe_rule"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(true), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }}, - // }}, - // SecurityRuleAccessResult: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // }, - // Profile: &armnetwork.ConfigurationDiagnosticProfile{ - // Destination: to.Ptr("12.11.12.14"), - // DestinationPort: to.Ptr("12100"), - // Direction: to.Ptr(armnetwork.DirectionInbound), - // Source: to.Ptr("10.1.0.4"), - // Protocol: to.Ptr("TCP"), - // }, - // }}, + // res = armnetwork.WatchersClientVerifyIPFlowResponse{ + // VerificationIPFlowResult: armnetwork.VerificationIPFlowResult{ + // Access: to.Ptr(armnetwork.AccessAllow), + // RuleName: to.Ptr("Rule1"), + // }, // } } diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go index ccbe124333cd..8ce9b1144b17 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go index 134b3a05ed8f..61e979ece275 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // WebApplicationFirewallPoliciesClient contains the methods for the WebApplicationFirewallPolicies group. // Don't use this type directly, use NewWebApplicationFirewallPoliciesClient() instead. +// +// Generated from API version 2025-07-01 type WebApplicationFirewallPoliciesClient struct { internal *arm.Client subscriptionID string } // NewWebApplicationFirewallPoliciesClient creates a new instance of WebApplicationFirewallPoliciesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewWebApplicationFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebApplicationFirewallPoliciesClient, error) { @@ -43,9 +43,7 @@ func NewWebApplicationFirewallPoliciesClient(subscriptionID string, credential a // CreateOrUpdate - Creates or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - policyName - The name of the policy. // - parameters - Policy to be created. // - options - WebApplicationFirewallPoliciesClientCreateOrUpdateOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.CreateOrUpdate @@ -75,6 +73,10 @@ func (client *WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.C // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy, _ *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -83,18 +85,15 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest( return nil, errors.New("parameter policyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -112,9 +111,7 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateHandleResponse // BeginDelete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete // method. @@ -125,8 +122,7 @@ func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WebApplicationFirewallPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -138,8 +134,6 @@ func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Cont // Delete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WebApplicationFirewallPoliciesClient.BeginDelete" @@ -164,6 +158,10 @@ func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context. // deleteCreateRequest creates the Delete request. func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, _ *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -172,26 +170,19 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont return nil, errors.New("parameter policyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Retrieve protection policy with specified name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get // method. @@ -220,6 +211,10 @@ func (client *WebApplicationFirewallPoliciesClient) Get(ctx context.Context, res // getCreateRequest creates the Get request. func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, _ *WebApplicationFirewallPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -228,17 +223,13 @@ func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context return nil, errors.New("parameter policyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -253,9 +244,7 @@ func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http } // NewListPager - Lists all of the protection policies within a resource group. -// -// Generated from API version 2025-05-01 -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager // method. func (client *WebApplicationFirewallPoliciesClient) NewListPager(resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListResponse] { @@ -284,21 +273,21 @@ func (client *WebApplicationFirewallPoliciesClient) NewListPager(resourceGroupNa // listCreateRequest creates the List request. func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *WebApplicationFirewallPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -313,8 +302,6 @@ func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *htt } // NewListAllPager - Gets all the WAF policies in a subscription. -// -// Generated from API version 2025-05-01 // - options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager // method. func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { @@ -352,8 +339,8 @@ func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go index ae8d0ef4b769..395a130a5c2e 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go @@ -1,850 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_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/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/WafListPolicies.json -func ExampleWebApplicationFirewallPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebApplicationFirewallPolicyListResult = armnetwork.WebApplicationFirewallPolicyListResult{ - // Value: []*armnetwork.WebApplicationFirewallPolicy{ - // { - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ - // { - // RuleGroupName: to.Ptr("General"), - // Rules: []*string{ - // to.Ptr("200003")}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/WafListAllPolicies.json -func ExampleWebApplicationFirewallPoliciesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListAllPager(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.WebApplicationFirewallPolicyListResult = armnetwork.WebApplicationFirewallPolicyListResult{ - // Value: []*armnetwork.WebApplicationFirewallPolicy{ - // { - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ - // { - // RuleGroupName: to.Ptr("General"), - // Rules: []*string{ - // to.Ptr("200003")}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // Selector: to.Ptr("*"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/WafPolicyGet.json -func ExampleWebApplicationFirewallPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebApplicationFirewallPoliciesClient().Get(ctx, "rg1", "Policy1", 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.WebApplicationFirewallPolicy = armnetwork.WebApplicationFirewallPolicy{ - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // ApplicationGatewayForContainers: []*armnetwork.ApplicationGatewayForContainersReferenceDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/agc1"), - // }}, - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }, - // { - // Name: to.Ptr("Rule4"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](4), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule5"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionCAPTCHA), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.2.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](5), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - // Selector: to.Ptr("testHeader1"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEquals), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - // Selector: to.Ptr("testHeader2"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("930120"), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // }, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.1"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - // }}, - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-942-APPLICATION-ATTACK-SQLI"), - // Rules: []*string{ - // to.Ptr("942130"), - // to.Ptr("942110")}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-920-PROTOCOL-ENFORCEMENT"), - // Rules: []*string{ - // to.Ptr("920100"), - // to.Ptr("920120")}, - // }, - // { - // RuleGroupName: to.Ptr("General"), - // Rules: []*string{ - // to.Ptr("200003")}, - // }}, - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("REQUEST-942-APPLICATION-ATTACK-SQLI"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("942130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("942110"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeLog), - // RuleID: to.Ptr("942140"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-920-PROTOCOL-ENFORCEMENT"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("920100"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("920120"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("920130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("UnknownBots"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeCAPTCHA), - // RuleID: to.Ptr("300600"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("ExcessiveRequests"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("500100"), - // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CaptchaCookieExpirationInMins: to.Ptr[int32](100), - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/WafPolicyCreateOrUpdate.json +// Generated from example definition: 2025-07-01/WafPolicyCreateOrUpdate.json func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -859,13 +34,16 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { { MatchValues: []*string{ to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, MatchVariables: []*armnetwork.MatchVariable{ { VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, + }, + }, Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }}, + }, + }, Priority: to.Ptr[int32](1), RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), }, @@ -875,23 +53,28 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { MatchConditions: []*armnetwork.MatchCondition{ { MatchValues: []*string{ - to.Ptr("192.168.1.0/24")}, + to.Ptr("192.168.1.0/24"), + }, MatchVariables: []*armnetwork.MatchVariable{ { VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, + }, + }, Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), }, { MatchValues: []*string{ - to.Ptr("Windows")}, + to.Ptr("Windows"), + }, MatchVariables: []*armnetwork.MatchVariable{ { Selector: to.Ptr("UserAgent"), VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - }}, + }, + }, Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - }}, + }, + }, Priority: to.Ptr[int32](2), RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), }, @@ -903,20 +86,25 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { GroupByVariables: []*armnetwork.GroupByVariable{ { VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - }}, - }}, + }, + }, + }, + }, MatchConditions: []*armnetwork.MatchCondition{ { MatchValues: []*string{ to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, + to.Ptr("10.0.0.0/24"), + }, MatchVariables: []*armnetwork.MatchVariable{ { VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, + }, + }, NegationConditon: to.Ptr(true), Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }}, + }, + }, Priority: to.Ptr[int32](3), RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), RateLimitThreshold: to.Ptr[int32](10), @@ -928,55 +116,32 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { MatchConditions: []*armnetwork.MatchCondition{ { MatchValues: []*string{ - to.Ptr("192.168.1.0/24")}, + to.Ptr("192.168.1.0/24"), + }, MatchVariables: []*armnetwork.MatchVariable{ { VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, + }, + }, Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), }, { MatchValues: []*string{ - to.Ptr("Bot")}, + to.Ptr("Bot"), + }, MatchVariables: []*armnetwork.MatchVariable{ { Selector: to.Ptr("UserAgent"), VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - }}, + }, + }, Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - }}, + }, + }, Priority: to.Ptr[int32](4), RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), }, - { - Name: to.Ptr("Rule5"), - Action: to.Ptr(armnetwork.WebApplicationFirewallActionCAPTCHA), - MatchConditions: []*armnetwork.MatchCondition{ - { - MatchValues: []*string{ - to.Ptr("192.168.2.0/24")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, - NegationConditon: to.Ptr(false), - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }, - { - MatchValues: []*string{ - to.Ptr("Bot")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - Selector: to.Ptr("UserAgent"), - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - }}, - NegationConditon: to.Ptr(false), - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - }}, - Priority: to.Ptr[int32](5), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - }}, + }, ManagedRules: &armnetwork.ManagedRulesDefinition{ Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ { @@ -988,14 +153,17 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { Rules: []*armnetwork.ExclusionManagedRule{ { RuleID: to.Ptr("930120"), - }}, + }, + }, }, { RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - }}, + }, + }, RuleSetType: to.Ptr("OWASP"), RuleSetVersion: to.Ptr("3.2"), - }}, + }, + }, MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), Selector: to.Ptr("hello"), SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), @@ -1006,7 +174,8 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{}, RuleSetType: to.Ptr("OWASP"), RuleSetVersion: to.Ptr("3.1"), - }}, + }, + }, MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), Selector: to.Ptr("hello"), SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), @@ -1020,7 +189,8 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), Selector: to.Ptr("test"), SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - }}, + }, + }, ManagedRuleSets: []*armnetwork.ManagedRuleSet{ { RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ @@ -1036,8 +206,10 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), RuleID: to.Ptr("931130"), State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - }}, - }}, + }, + }, + }, + }, RuleSetType: to.Ptr("OWASP"), RuleSetVersion: to.Ptr("3.2"), }, @@ -1051,12 +223,9 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { RuleID: to.Ptr("300700"), State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), }, - { - Action: to.Ptr(armnetwork.ActionTypeCAPTCHA), - RuleID: to.Ptr("300600"), - State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - }}, - }}, + }, + }, + }, RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), RuleSetVersion: to.Ptr("1.0"), }, @@ -1070,24 +239,29 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { RuleID: to.Ptr("500100"), Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - }}, - }}, + }, + }, + }, + }, RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), RuleSetVersion: to.Ptr("1.0"), - }}, + }, + }, Exceptions: []*armnetwork.ExceptionEntry{ { ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ { RuleSetType: to.Ptr("OWASP"), RuleSetVersion: to.Ptr("3.2"), - }}, + }, + }, MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), Values: []*string{ to.Ptr("health"), to.Ptr("account/images"), - to.Ptr("default.aspx")}, + to.Ptr("default.aspx"), + }, }, { ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ @@ -1095,17 +269,20 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ { RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - }}, + }, + }, RuleSetType: to.Ptr("OWASP"), RuleSetVersion: to.Ptr("3.2"), - }}, + }, + }, MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), Selector: to.Ptr("User-Agent"), SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), Values: []*string{ to.Ptr("Mozilla/5.0"), - to.Ptr("Chrome/122.0.0.0")}, + to.Ptr("Chrome/122.0.0.0"), + }, }, { ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ @@ -1116,20 +293,24 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { Rules: []*armnetwork.ExclusionManagedRule{ { RuleID: to.Ptr("100100"), - }}, - }}, + }, + }, + }, + }, RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), RuleSetVersion: to.Ptr("1.0"), - }}, + }, + }, MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), Values: []*string{ to.Ptr("1.2.3.4"), - to.Ptr("10.0.0.1/6")}, - }}, + to.Ptr("10.0.0.1/6"), + }, + }, + }, }, PolicySettings: &armnetwork.PolicySettings{ - CaptchaCookieExpirationInMins: to.Ptr[int32](100), JsChallengeCookieExpirationInMins: to.Ptr[int32](100), LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ @@ -1143,7 +324,8 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - }}, + }, + }, State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), }, }, @@ -1155,34 +337,34 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { // 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.WebApplicationFirewallPolicy = armnetwork.WebApplicationFirewallPolicy{ - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, + // res = armnetwork.WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{ + // WebApplicationFirewallPolicy: armnetwork.WebApplicationFirewallPolicy{ + // Name: to.Ptr("Policy1"), + // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), + // Location: to.Ptr("WestUs"), + // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ + // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ + // { + // Name: to.Ptr("Rule1"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, // MatchVariables: []*armnetwork.MatchVariable{ // { // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, + // }, + // }, // NegationConditon: to.Ptr(false), // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), // Transforms: []*armnetwork.WebApplicationFirewallTransform{ // }, - // }}, + // }, + // }, // Priority: to.Ptr[int32](1), // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), @@ -1193,309 +375,318 @@ func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { // MatchConditions: []*armnetwork.MatchCondition{ // { // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // to.Ptr("192.168.1.0/24"), // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), // }, // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ + // MatchValues: []*string{ + // to.Ptr("Windows"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), + // }, // }, - // { - // Name: to.Ptr("Rule4"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](4), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](2), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("RateLimitRule3"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // GroupByUserSession: []*armnetwork.GroupByUserSession{ + // { + // GroupByVariables: []*armnetwork.GroupByVariable{ + // { + // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), + // }, + // }, + // }, + // }, + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(true), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // }, + // Priority: to.Ptr[int32](3), + // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), + // RateLimitThreshold: to.Ptr[int32](10), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), + // }, + // { + // Name: to.Ptr("Rule4"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // { + // MatchValues: []*string{ + // to.Ptr("Bot"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](4), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // }, + // ManagedRules: &armnetwork.ManagedRulesDefinition{ + // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ + // { + // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), + // Rules: []*armnetwork.ExclusionManagedRule{ + // { + // RuleID: to.Ptr("930120"), + // }, + // }, + // }, + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("hello"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // { + // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.1"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("hello"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // }, + // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ + // { + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("REQUEST-931-APPLICATION-ATTACK-RFI"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeLog), + // RuleID: to.Ptr("931120"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // { + // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), + // RuleID: to.Ptr("931130"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // { + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("UnknownBots"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeJSChallenge), + // RuleID: to.Ptr("300700"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // { + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("ExcessiveRequests"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeBlock), + // RuleID: to.Ptr("500100"), + // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // Exceptions: []*armnetwork.ExceptionEntry{ + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("health"), + // to.Ptr("account/images"), + // to.Ptr("default.aspx"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), + // Selector: to.Ptr("User-Agent"), + // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("Mozilla/5.0"), + // to.Ptr("Chrome/122.0.0.0"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ // { - // Name: to.Ptr("Rule5"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionCAPTCHA), - // MatchConditions: []*armnetwork.MatchCondition{ + // RuleGroupName: to.Ptr("BadBots"), + // Rules: []*armnetwork.ExclusionManagedRule{ // { - // MatchValues: []*string{ - // to.Ptr("192.168.2.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](5), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("930120"), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // }, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.1"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }}, - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("REQUEST-931-APPLICATION-ATTACK-RFI"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeLog), - // RuleID: to.Ptr("931120"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("931130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("UnknownBots"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeJSChallenge), - // RuleID: to.Ptr("300700"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeCAPTCHA), - // RuleID: to.Ptr("300600"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("ExcessiveRequests"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("500100"), - // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CaptchaCookieExpirationInMins: to.Ptr[int32](100), - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // } + // RuleID: to.Ptr("100100"), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), + // Values: []*string{ + // to.Ptr("1.2.3.4"), + // to.Ptr("10.0.0.1/6"), + // }, + // }, + // }, + // }, + // PolicySettings: &armnetwork.PolicySettings{ + // CustomBlockResponseBody: to.Ptr("SGVsbG8="), + // CustomBlockResponseStatusCode: to.Ptr[int32](405), + // FileUploadEnforcement: to.Ptr(true), + // FileUploadLimitInMb: to.Ptr[int32](4000), + // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), + // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ + // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // }, + // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), + // }, + // MaxRequestBodySizeInKb: to.Ptr[int32](2000), + // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), + // RequestBodyCheck: to.Ptr(true), + // RequestBodyEnforcement: to.Ptr(true), + // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), + // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/WafPolicyDelete.json +// Generated from example definition: 2025-07-01/WafPolicyDelete.json func ExampleWebApplicationFirewallPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1503,8 +694,917 @@ func ExampleWebApplicationFirewallPoliciesClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to poll 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 = armnetwork.WebApplicationFirewallPoliciesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-07-01/WafPolicyGet.json +func ExampleWebApplicationFirewallPoliciesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewWebApplicationFirewallPoliciesClient().Get(ctx, "rg1", "Policy1", nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armnetwork.WebApplicationFirewallPoliciesClientGetResponse{ + // WebApplicationFirewallPolicy: armnetwork.WebApplicationFirewallPolicy{ + // Name: to.Ptr("Policy1"), + // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), + // Location: to.Ptr("WestUs"), + // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ + // ApplicationGatewayForContainers: []*armnetwork.ApplicationGatewayForContainersReferenceDefinition{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/agc1"), + // }, + // }, + // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ + // { + // Name: to.Ptr("Rule1"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // Transforms: []*armnetwork.WebApplicationFirewallTransform{ + // }, + // }, + // }, + // Priority: to.Ptr[int32](1), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("Rule2"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // { + // MatchValues: []*string{ + // to.Ptr("Windows"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](2), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("RateLimitRule3"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // GroupByUserSession: []*armnetwork.GroupByUserSession{ + // { + // GroupByVariables: []*armnetwork.GroupByVariable{ + // { + // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), + // }, + // }, + // }, + // }, + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(true), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // }, + // Priority: to.Ptr[int32](3), + // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), + // RateLimitThreshold: to.Ptr[int32](10), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), + // }, + // { + // Name: to.Ptr("Rule4"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // { + // MatchValues: []*string{ + // to.Ptr("Bot"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](4), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // }, + // ManagedRules: &armnetwork.ManagedRulesDefinition{ + // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ + // { + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), + // Selector: to.Ptr("testHeader1"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEquals), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), + // Selector: to.Ptr("testHeader2"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), + // Selector: to.Ptr("hello"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // { + // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), + // Rules: []*armnetwork.ExclusionManagedRule{ + // { + // RuleID: to.Ptr("930120"), + // }, + // }, + // }, + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("hello"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + // }, + // { + // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.1"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("hello"), + // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), + // }, + // }, + // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ + // { + // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-942-APPLICATION-ATTACK-SQLI"), + // Rules: []*string{ + // to.Ptr("942130"), + // to.Ptr("942110"), + // }, + // }, + // { + // RuleGroupName: to.Ptr("REQUEST-920-PROTOCOL-ENFORCEMENT"), + // Rules: []*string{ + // to.Ptr("920100"), + // to.Ptr("920120"), + // }, + // }, + // { + // RuleGroupName: to.Ptr("General"), + // Rules: []*string{ + // to.Ptr("200003"), + // }, + // }, + // }, + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("REQUEST-942-APPLICATION-ATTACK-SQLI"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), + // RuleID: to.Ptr("942130"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), + // }, + // { + // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), + // RuleID: to.Ptr("942110"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), + // }, + // { + // Action: to.Ptr(armnetwork.ActionTypeLog), + // RuleID: to.Ptr("942140"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // { + // RuleGroupName: to.Ptr("REQUEST-920-PROTOCOL-ENFORCEMENT"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), + // RuleID: to.Ptr("920100"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), + // }, + // { + // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), + // RuleID: to.Ptr("920120"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), + // }, + // { + // Action: to.Ptr(armnetwork.ActionTypeBlock), + // RuleID: to.Ptr("920130"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // { + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("UnknownBots"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeJSChallenge), + // RuleID: to.Ptr("300700"), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // { + // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ + // { + // RuleGroupName: to.Ptr("ExcessiveRequests"), + // Rules: []*armnetwork.ManagedRuleOverride{ + // { + // Action: to.Ptr(armnetwork.ActionTypeBlock), + // RuleID: to.Ptr("500100"), + // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), + // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // Exceptions: []*armnetwork.ExceptionEntry{ + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("health"), + // to.Ptr("account/images"), + // to.Ptr("default.aspx"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), + // Selector: to.Ptr("User-Agent"), + // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("Mozilla/5.0"), + // to.Ptr("Chrome/122.0.0.0"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("BadBots"), + // Rules: []*armnetwork.ExclusionManagedRule{ + // { + // RuleID: to.Ptr("100100"), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), + // Values: []*string{ + // to.Ptr("1.2.3.4"), + // to.Ptr("10.0.0.1/6"), + // }, + // }, + // }, + // }, + // PolicySettings: &armnetwork.PolicySettings{ + // CustomBlockResponseBody: to.Ptr("SGVsbG8="), + // CustomBlockResponseStatusCode: to.Ptr[int32](405), + // FileUploadEnforcement: to.Ptr(true), + // FileUploadLimitInMb: to.Ptr[int32](4000), + // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), + // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ + // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // }, + // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), + // }, + // MaxRequestBodySizeInKb: to.Ptr[int32](2000), + // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), + // RequestBodyCheck: to.Ptr(true), + // RequestBodyEnforcement: to.Ptr(true), + // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), + // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-07-01/WafListPolicies.json +func ExampleWebApplicationFirewallPoliciesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armnetwork.WebApplicationFirewallPoliciesClientListResponse{ + // WebApplicationFirewallPolicyListResult: armnetwork.WebApplicationFirewallPolicyListResult{ + // Value: []*armnetwork.WebApplicationFirewallPolicy{ + // { + // Name: to.Ptr("Policy1"), + // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), + // Location: to.Ptr("WestUs"), + // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ + // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ + // { + // Name: to.Ptr("Rule1"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // Transforms: []*armnetwork.WebApplicationFirewallTransform{ + // }, + // }, + // }, + // Priority: to.Ptr[int32](1), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("Rule2"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // { + // MatchValues: []*string{ + // to.Ptr("Windows"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](2), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("RateLimitRule3"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // GroupByUserSession: []*armnetwork.GroupByUserSession{ + // { + // GroupByVariables: []*armnetwork.GroupByVariable{ + // { + // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), + // }, + // }, + // }, + // }, + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(true), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // }, + // Priority: to.Ptr[int32](3), + // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), + // RateLimitThreshold: to.Ptr[int32](10), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), + // }, + // }, + // ManagedRules: &armnetwork.ManagedRulesDefinition{ + // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ + // { + // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ + // { + // RuleGroupName: to.Ptr("General"), + // Rules: []*string{ + // to.Ptr("200003"), + // }, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // Exceptions: []*armnetwork.ExceptionEntry{ + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("health"), + // to.Ptr("account/images"), + // to.Ptr("default.aspx"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), + // Selector: to.Ptr("User-Agent"), + // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("Mozilla/5.0"), + // to.Ptr("Chrome/122.0.0.0"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("BadBots"), + // Rules: []*armnetwork.ExclusionManagedRule{ + // { + // RuleID: to.Ptr("100100"), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), + // Values: []*string{ + // to.Ptr("1.2.3.4"), + // to.Ptr("10.0.0.1/6"), + // }, + // }, + // }, + // }, + // PolicySettings: &armnetwork.PolicySettings{ + // CustomBlockResponseBody: to.Ptr("SGVsbG8="), + // CustomBlockResponseStatusCode: to.Ptr[int32](405), + // FileUploadEnforcement: to.Ptr(true), + // FileUploadLimitInMb: to.Ptr[int32](4000), + // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ + // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // }, + // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), + // }, + // MaxRequestBodySizeInKb: to.Ptr[int32](2000), + // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), + // RequestBodyCheck: to.Ptr(true), + // RequestBodyEnforcement: to.Ptr(true), + // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), + // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-07-01/WafListAllPolicies.json +func ExampleWebApplicationFirewallPoliciesClient_NewListAllPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListAllPager(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 = armnetwork.WebApplicationFirewallPoliciesClientListAllResponse{ + // WebApplicationFirewallPolicyListResult: armnetwork.WebApplicationFirewallPolicyListResult{ + // Value: []*armnetwork.WebApplicationFirewallPolicy{ + // { + // Name: to.Ptr("Policy1"), + // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), + // Location: to.Ptr("WestUs"), + // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ + // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ + // { + // Name: to.Ptr("Rule1"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // Transforms: []*armnetwork.WebApplicationFirewallTransform{ + // }, + // }, + // }, + // Priority: to.Ptr[int32](1), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("Rule2"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // { + // MatchValues: []*string{ + // to.Ptr("Windows"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // Selector: to.Ptr("UserAgent"), + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), + // }, + // }, + // NegationConditon: to.Ptr(false), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), + // }, + // }, + // Priority: to.Ptr[int32](2), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), + // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), + // }, + // { + // Name: to.Ptr("RateLimitRule3"), + // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), + // GroupByUserSession: []*armnetwork.GroupByUserSession{ + // { + // GroupByVariables: []*armnetwork.GroupByVariable{ + // { + // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), + // }, + // }, + // }, + // }, + // MatchConditions: []*armnetwork.MatchCondition{ + // { + // MatchValues: []*string{ + // to.Ptr("192.168.1.0/24"), + // to.Ptr("10.0.0.0/24"), + // }, + // MatchVariables: []*armnetwork.MatchVariable{ + // { + // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), + // }, + // }, + // NegationConditon: to.Ptr(true), + // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), + // }, + // }, + // Priority: to.Ptr[int32](3), + // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), + // RateLimitThreshold: to.Ptr[int32](10), + // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), + // }, + // }, + // ManagedRules: &armnetwork.ManagedRulesDefinition{ + // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ + // { + // ComputedDisabledRules: []*armnetwork.ManagedRuleSetRuleGroup{ + // { + // RuleGroupName: to.Ptr("General"), + // Rules: []*string{ + // to.Ptr("200003"), + // }, + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // Exceptions: []*armnetwork.ExceptionEntry{ + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("health"), + // to.Ptr("account/images"), + // to.Ptr("default.aspx"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), + // }, + // }, + // RuleSetType: to.Ptr("OWASP"), + // RuleSetVersion: to.Ptr("3.2"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), + // Selector: to.Ptr("User-Agent"), + // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), + // Values: []*string{ + // to.Ptr("Mozilla/5.0"), + // to.Ptr("Chrome/122.0.0.0"), + // }, + // }, + // { + // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ + // { + // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ + // { + // RuleGroupName: to.Ptr("BadBots"), + // Rules: []*armnetwork.ExclusionManagedRule{ + // { + // RuleID: to.Ptr("100100"), + // }, + // }, + // }, + // }, + // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), + // RuleSetVersion: to.Ptr("1.0"), + // }, + // }, + // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), + // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), + // Values: []*string{ + // to.Ptr("1.2.3.4"), + // to.Ptr("10.0.0.1/6"), + // }, + // }, + // }, + // }, + // PolicySettings: &armnetwork.PolicySettings{ + // CustomBlockResponseBody: to.Ptr("SGVsbG8="), + // CustomBlockResponseStatusCode: to.Ptr[int32](405), + // FileUploadEnforcement: to.Ptr(true), + // FileUploadLimitInMb: to.Ptr[int32](4000), + // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ + // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), + // Selector: to.Ptr("test"), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // { + // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), + // Selector: to.Ptr("*"), + // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), + // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), + // }, + // }, + // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), + // }, + // MaxRequestBodySizeInKb: to.Ptr[int32](2000), + // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), + // RequestBodyCheck: to.Ptr(true), + // RequestBodyEnforcement: to.Ptr(true), + // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), + // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), + // }, + // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), + // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), + // }, + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // "key2": to.Ptr("value2"), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/network/armnetwork/webcategories_client.go b/sdk/resourcemanager/network/armnetwork/webcategories_client.go index 197d991622bc..08be2efd62bf 100644 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client.go +++ b/sdk/resourcemanager/network/armnetwork/webcategories_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork @@ -19,14 +18,15 @@ import ( // WebCategoriesClient contains the methods for the WebCategories group. // Don't use this type directly, use NewWebCategoriesClient() instead. +// +// Generated from API version 2025-07-01 type WebCategoriesClient struct { internal *arm.Client subscriptionID string } // NewWebCategoriesClient creates a new instance of WebCategoriesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - Contains optional client configuration. Pass nil to accept the default values. func NewWebCategoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebCategoriesClient, error) { @@ -43,8 +43,6 @@ func NewWebCategoriesClient(subscriptionID string, credential azcore.TokenCreden // Get - Gets the specified Azure Web Category. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-05-01 // - name - The name of the azureWebCategory. // - options - WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. func (client *WebCategoriesClient) Get(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (WebCategoriesClientGetResponse, error) { @@ -72,14 +70,14 @@ func (client *WebCategoriesClient) Get(ctx context.Context, name string, options // getCreateRequest creates the Get request. func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}" - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err @@ -88,8 +86,8 @@ func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name st if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -104,8 +102,6 @@ func (client *WebCategoriesClient) getHandleResponse(resp *http.Response) (WebCa } // NewListBySubscriptionPager - Gets all the Azure Web Categories in a subscription. -// -// Generated from API version 2025-05-01 // - options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager // method. func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { @@ -143,8 +139,8 @@ func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250701) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go b/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go index eeb8e57365e9..7fdafacd269b 100644 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go +++ b/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go @@ -1,56 +1,55 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armnetwork_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v9" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v10" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureWebCategoryGet.json +// Generated from example definition: 2025-07-01/AzureWebCategoryGet.json func ExampleWebCategoriesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("4de8428a-4a92-4cea-90ff-b47128b8cab8", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewWebCategoriesClient().Get(ctx, "Arts", &armnetwork.WebCategoriesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewWebCategoriesClient().Get(ctx, "Arts", 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.AzureWebCategory = armnetwork.AzureWebCategory{ - // Name: to.Ptr("Arts"), - // Type: to.Ptr("Microsoft.Network/azureWebCategories"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), - // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ - // Group: to.Ptr("General"), + // res = armnetwork.WebCategoriesClientGetResponse{ + // AzureWebCategory: armnetwork.AzureWebCategory{ + // Name: to.Ptr("Arts"), + // Type: to.Ptr("Microsoft.Network/azureWebCategories"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), + // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ + // Group: to.Ptr("General"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/72410da64f6e945db1e1f1af220e077ba5bdb857/specification/network/resource-manager/Microsoft.Network/stable/2025-05-01/examples/AzureWebCategoriesListBySubscription.json +// Generated from example definition: 2025-07-01/AzureWebCategoriesListBySubscription.json func ExampleWebCategoriesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) + clientFactory, err := armnetwork.NewClientFactory("4de8428a-4a92-4cea-90ff-b47128b8cab8", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -65,17 +64,20 @@ func ExampleWebCategoriesClient_NewListBySubscriptionPager() { _ = 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.AzureWebCategoryListResult = armnetwork.AzureWebCategoryListResult{ - // Value: []*armnetwork.AzureWebCategory{ - // { - // Name: to.Ptr("Arts"), - // Type: to.Ptr("Microsoft.Network/azureWebCategories"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), - // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ - // Group: to.Ptr("General"), + // page = armnetwork.WebCategoriesClientListBySubscriptionResponse{ + // AzureWebCategoryListResult: armnetwork.AzureWebCategoryListResult{ + // Value: []*armnetwork.AzureWebCategory{ + // { + // Name: to.Ptr("Arts"), + // Type: to.Ptr("Microsoft.Network/azureWebCategories"), + // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), + // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), + // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ + // Group: to.Ptr("General"), + // }, // }, - // }}, + // }, + // }, // } } }